cancel
Showing results for 
Search instead for 
Did you mean: 

getting data from 3 tables

Former Member
0 Kudos

Hi all,

Iam working with a jdbc-to-jdbc scenario.In this I am having 3 tables on source side called t1 , t2 & t3. On target side I am having 2 tables called tb1 & tb2. Now I have to retrieve data from 3 tables and insert into 2 tables using one type of condition with t1 & t2 and another condition with t1 & t3 . Can I do this with single scenario, If yes How can I?

Can anybody pleaseeee.......

Thanks & Regards,

Radhika.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member189387
Active Contributor
0 Kudos

Hi ,

Yes , You can do Please refer the following link for teh SQL query

http://yaodba.blogspot.com/2007/03/insert-into-multiple-tables-from-single.html

Regards.,

V.Rangarajan

prateek
Active Contributor
0 Kudos

Sender

Use join to pick up the data from more than 1 table.

In mapping, specify ur conditions for grouping the data

Receiver

Use stored procedure to update two tables.

Regards,

Prateek

Former Member
0 Kudos

Hi,

There are 3 tables U1, U2, U3.From these 3 tables I have to retrive data with the conditions given below.....

U1.a1 = U3.c1 and U3.c2 = 'N' and U3.c3 = 'C' ---> this is from two tables U1 and U3

U2.b1 = U3.c1 and U3.c2 = 'N' and U3.c3 = 'B' ---> this is from another two tables U2 and U3

The data from U1, U3 tables has to come in seperate set as that of the data from tables U2, U3.

Please suggest me in this case....

Former Member
0 Kudos

>>>The data from U1, U3 tables has to come in <b>seperate set</b> as that of the data from tables U2, U3.

JDBC sender adapter works with only one resultset. That is the reason we use joins in sender JDBC adapter when we need data from multiple tables.

Regards,

Jai Shankar

Former Member
0 Kudos

Hi,

How can I use join here can tell me

Former Member
0 Kudos

Hi Prateek,

Can u tell me how to write join condition for three tables inorder to get the data in seperate sets from two-two tables..Pleasee.......

Thanks & Regards,

Radhika.

Message was edited by:

Radhika P

former_member192892
Active Contributor
0 Kudos

Radhika,

Can you please give the brief outline of the database table fields you are using here ,and also info on the dependant fields

Thanks

Varun

Message was edited by:

Varun Mukund

Former Member
0 Kudos

Hi Varun,

My tables are UTOIP, UTTMS, UTCT.And the corresponding fields are as follows...

UTOIP ---> OPGUI

UTTMS -- > MSGUI

UTCT ---> CTGUI, CTSTS, CTECMA

The condition to retrieve data from UTOIP and UTCT is < UTOIP.OPGUI = UTCT.CTGUI and UTCT.CTSTS = 'N' and UTCT.CTECMA = 'OPSOIP' >

The condition to retrieve data from UTTMS and UTCT is < UTTMS.MSGUI = UTCT.CTGUI and UTCT.CTSTS = 'N' and UTCT.CTECMA = 'OPSOCLM' >

Can u please tell me how to get the seperate data of both tables using these conditions....

Thanks & Regards,

Radhika.