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.

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

Re: sql query on interger context variable

Very strange.
Can you share your tOracleInput settings?

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

Talend Cloud Available on Microsoft Azure

An integration platform-as-a-serviceto help enterprises collect, govern, transform, and share data from any data sources

Watch Now