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

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Self-service Talend Migration: Moving from On-Premises to the Cloud

Move from On-Premises to the Cloud by following the advice of experts

Read Now

Modern Data Engineering in the Cloud

Learn about modern data engineering in the Cloud

Watch Now

How to deploy Talend Jobs as Docker images to Amazon, Azure and Google Cloud reg...

Learn how to deploy Talend Jobs as Docker images to Amazon, Azure and Google Cloud registries

Blog