ERROR in Generic_SQL_Operator: Error binding variables: The index 1 is out of range.

176 views
Skip to first unread message

Davo

unread,
Sep 12, 2012, 12:37:50 PM9/12/12
to itpam...@googlegroups.com
Hello,

I'm using CA_ITPAM_3.1SP01. Within the JDBC module, I'm using Generic_SQL_Operator operator, to inquire about the mdb database of ServiceDesk, the query is successful.
Query:


SELECT id, persid, chg_ref_num
FROM
chg
WHERE chg_ref_num = '22 '


At the moment of delivering the same query but now trying to pass the "22" as a parameter in a input_parameters within the Generic SQL Statement tab:




 throws me the following error:

Error binding variables: The index 1 is out of range.


Does anyone have any idea why this is happening and how to fix it?

Regards, David.

Miguel Silva

unread,
Sep 12, 2012, 12:54:05 PM9/12/12
to itpam...@googlegroups.com
Hi,

that error means that you're reading a non existing index of the query result array, that can happen for two reasons:
1 - You're indexing a out of range value (for example, the query result array returns 2 values and you try to index for example: result_array[5]
2 - the query it's incorrect and it returns an empty array

now, i think you're dealing with option 2

attached you can find an example of how i use JDBC operators, might be useful (see post execution code)

best regards

Miguel Silva

--
You received this message because you are subscribed to the Google Groups "CA Process Automation Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/itpam-forum/-/IF7QLXp-2fwJ.
To post to this group, send email to itpam...@googlegroups.com.
To unsubscribe from this group, send email to itpam-forum...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/itpam-forum?hl=en.

JDBC Example.xml

Davo

unread,
Sep 12, 2012, 1:37:58 PM9/12/12
to itpam...@googlegroups.com
Hi Miguel Silva,

Thank you for your prompt response.

I imported the example that you sent, but the Main Editor is in blank  : (



I will validate the output as you mention to see if that corrects the error.

Thank you.

Davo.

Davo

unread,
Sep 12, 2012, 2:15:55 PM9/12/12
to itpam...@googlegroups.com
Hello Miguel Silva,

I do not think the problem is to validate the answer.
I have my statement:

SELECT id, persid, chg_ref_num
FROM
chg
WHERE chg_ref_num = '63 '

Without adding input parameters, the operator runs correctly.

With exactly the same sentence before, but adding any value to the operator as an input parameter, the error is:

Error binding variables: The index 1 is out of range.



Davo.

Bill Messick

unread,
Sep 12, 2012, 3:23:11 PM9/12/12
to itpam...@googlegroups.com
You are passing a parameter into the SQL operator, but you didn't leave any place to insert it in the statement.

That last line should be:

WHERE chg_ref_num = '?'

The operator will replace the ? with your value.

Bill Messick

--
You received this message because you are subscribed to the Google Groups "CA Process Automation Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/itpam-forum/-/dJXxyRc52pwJ.

Davo

unread,
Sep 12, 2012, 4:52:41 PM9/12/12
to itpam...@googlegroups.com
Hi Bill ,

He had already attempted this test
     WHERE chg_ref_num = '?'
But neither solved the problem

: (

Davo

Johnson, Derek R

unread,
Sep 12, 2012, 6:09:26 PM9/12/12
to itpam...@googlegroups.com

I think the ‘?’ is causing you the grief.

 

I was able to get it to function in PAM 4.0.

 

Query Database Operator

 

Inline text:

SELECT persid, chg_ref_num from chg where chg_ref_num = ?

                Input Parameter:

                                Datasets["DB_Restore_Dataset"].chgRefNum

 

 

 

Derek Johnson

Senior Computer Specialist

UW Medicine IT Services

TSO Internal Applications

Work:     206.685.1893

Page:     206.350.3540

Cell:       425.319.6842

Reply all
Reply to author
Forward
0 new messages