sql query on interger context variable

Highlighted
Six Stars
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.

Highlighted
Sixteen Stars
Sixteen Stars

Re: sql query on interger context variable

Try this for the condition:

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

Hope this helps.


TRF
Highlighted
Six Stars
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
Highlighted
Sixteen Stars
Sixteen Stars

Re: sql query on interger context variable

Very strange.
Can you share your tOracleInput settings?

TRF
Highlighted
Sixteen Stars
Sixteen 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 GARTNER 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

Talend Cloud Developer Series – Deploying First Job to Cloud

This video will show you how to run a job in Studio and then publish that job to Talend Cloud

Watch Now

Talend Cloud Developer Series – Fetching Studio License

This video will help someone new to using Talend Studio get started by connecting to Talend Cloud and fetching the Studio License

Watch Now

Talend Cloud Developer Series - Introduction

The Talend Cloud Developer Series was created to give you a solid foundational understanding of Talend’s Cloud Integration Platform

Watch Now