Six Stars SD
Six Stars

sql query on interger context variable

I want to write a condition with two where condition on Context integer value on tOracleInput

 

Select order_num from order_table

where id >= context.a1

and id<= context.a2;

 

Where a1 and a1 and id are all integer value.How to achieve that in tOracleInput.

4 REPLIES
Forteen Stars TRF
Forteen Stars

Re: sql query on interger context variable

Try this for the condition:

"id >= " + context.a1 + " and id<= " + context.a2

Hope this helps.


TRF
Six Stars SD
Six Stars

Re: sql query on interger context variable

I tried that before :I get this error:
Invalid operation: relation "context" does not exist;
This is my full query:
"Select order_num from order_table
where id >= " + context.a1 + " and id<= " + context.a2;

And two context variable has been defined as integer. Why does it give the error
Forteen Stars TRF
Forteen Stars

Re: sql query on interger context variable

Very strange.
Can you share your tOracleInput settings?

TRF
Forteen Stars TRF
Forteen Stars

Re: sql query on interger context variable

Based on your pm, what if you remove the semicolumn at the end of the query (or if you replace it by + ";")?

TRF