Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I need help to insert data into db2 table based on different conditions need to update / insert different columns in a same table.
for example
If (column1 == 1)
{
then insert/update into db2 table1 columns (column1, column2, column3)
}
else if (column1 == 2 )
{
then insert/update into db2 table1 columns (column4, column5, column6)
}
else if (column == 3)
{
then insert/update into db2 table1 columns are (column7,column8, column9)
}
On update where condition need to fetech data from table,
for example
UPDATE table1
SET
column1
column2
column3
WHERE
column0 = (SELECT MAX(date) FROM table1
WHERE column0 = 1)
Please suggest to create a talend job to cover the above scenarios.
Thanks,
Prasanth
Hi @prasanth kesana,
You can get your requirement done by using tmap.
The flow of job should be like,
tdbinput--> tmap--> 3*tdboutput
Write your condition for each insert/update (ex-row1.column1 == 1) in expression tab on tmap. And map the corresponding input columns to output table columns.
Hope this will help you.
Regards,
Shalini
@Shalini M ,you need to use tMap component to do your requirements.
Thanks,
Manohar
Hi Shalini,
Thank you.
please suggest on update statement in where condition need to fetch data from db2 table.
Regards,
Prasanth
@prasanth kesana, Could you please elaborate your requirement?
@Shalini M , I need to update table like this query using talend job.
for example-
UPDATE table1
SET
column1
column2
column3
WHERE
column0 = (SELECT MAX(date) FROM table1
WHERE column0 = 1)
Thanks,
Prasanth
@prasanth kesana, please try column0 equals 1 in tmap input flow and load to output as I mentioned in above reply.