web stats
Array index out of range error - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 04-01-2015, 11:26 AM
mcampanella@rimirad.com mcampanella@rimirad.com is offline
Mirth Newb
 
Join Date: Apr 2009
Location: RI
Posts: 12
mcampanella@rimirad.com is on a distinguished road
Default Array index out of range error

Hello:

I set up a database reader using javascript. I am getting an error "Array index out of range error" which I believe is caused by no data getting returned by the query.

If I add a test like if (result.length > 0) { it prevents the error but it also prevents data from getting sent out when there is a query result.

The message goes out without the values that were retrieved.

Does anyone have an example of testing for an empty query?


Error Message:
DETAILS: Wrapped java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
Reply With Quote
  #2  
Old 04-01-2015, 11:38 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,210
cory_cole is on a distinguished road
Default

while (result.next())
{
...
}
Reply With Quote
  #3  
Old 04-17-2015, 06:46 AM
RwM RwM is offline
What's HL7?
 
Join Date: Jun 2013
Location: Cincinnati
Posts: 1
RwM is on a distinguished road
Talking cory_cole you have my vote!

Quote:
Originally Posted by cory_cole View Post
while (result.next())
{
...
}
Thank you! Same issue here and this is beautiful.
Reply With Quote
  #4  
Old 05-13-2019, 09:48 AM
lbittle lbittle is offline
Mirth Newb
 
Join Date: Sep 2018
Posts: 21
lbittle is on a distinguished road
Default Array Out of Bound Webinar

Mirth Minute Webinar on this error:

https://youtu.be/be9QnsbAPmk
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 04:01 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation