sql query on interger context variable

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.

Fifteen Stars TRF
Fifteen 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
Fifteen Stars TRF
Fifteen Stars

Re: sql query on interger context variable

Very strange.
Can you share your tOracleInput settings?

TRF
Fifteen Stars TRF
Fifteen 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

What’s New for Talend Spring ’19

Join us live for a sneak peek!

Sign up now

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads