[resolved] Transfer data from a table to 2nd table based on MAX val of 2nd table

One Star

[resolved] Transfer data from a table to 2nd table based on MAX val of 2nd table

Hi,
I want to transfer the data from Sybase table to another Oracle table . following is the scenario.
Table Name : Orders
Column 1 : OrderNumber (PK)
Column 2 : OrderDescription

What i need is to copy all the records from sybase table having OrderNumber greater than Maximum OrderNumber of Oracle table.
Step 1 : Select Temp = Max(OrderNumber) from Orders --- from Oracle DB
Step 2 : Select * from Orders where OrderNumber > Temp --- from sybase DB
put the records from step 2 into the Oracle Table.

I couldn't find any example from Demo examples.
Any help will be greatly appreciated.

Best Regards,
Amin
Community Manager

Re: [resolved] Transfer data from a table to 2nd table based on MAX val of 2nd table

Hello
Your job looks like:
tOracleInput---tAggregateRow--tJavaRow
|
onsubjobok
|
tSysbaseInput---tOracleOutput
on tOracleInput: select all orderNumber
on tAggregateRow: get the max order
on tJavaRow: set the max order to a context var or global val, eg: globalMap.put("maxOrder", input_row.max)

tSysbaseInput: "select * from orders where orderNumber ">(Integer)globalMap.get("maxOrder")


Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Transfer data from a table to 2nd table based on MAX val of 2nd table

hi,
Thanks alot for your quick reply Shong.

Can't i use "Select MAX (OrderNumber) from Orders in the tOracleInput and store it using tSetGlobalVar instead of using tAggregateRow and tJavaRow?

Thanks again
Best Regards,
Amin
Community Manager

Re: [resolved] Transfer data from a table to 2nd table based on MAX val of 2nd table

Hello
Can't i use "Select MAX (OrderNumber) from Orders in the tOracleInput and store it using tSetGlobalVar instead of using tAggregateRow and tJavaRow?

Of course, you can. Select MAX (OrderNumber) from Orders in the tOracleInput and link it to tJavaRow, and set it to a global var.

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

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

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog