Skip to main content

I'm querying an Oracle DB with Database Connector ( Select operation ) and I want to parametrize one field.

 

This is the query:

"SELECT id, name, code FROM employees WHERE code = nvl( :auxCode, '1-11') order by id"

 

This is the input parameter:

{

'auxCode': vars.code

}

 

And finally, this is de variable ( named code ):

(attributes.queryParams.code as String default '')

 

If I send code=2-22, I'm having this error:

Message        : An SQLException was provoked by the following failure: java.lang.NumberFormatException: For input string: "2-"

 

Please, any idea?

 

Best regards!!

1 件の回答
  1. 2023年6月30日 9:30

    Finally I cast to CHAR:

     

    nvl( TO_CHAR(:auxCode), '1-11')

0/9000