appending data from 2 different soruces to a single table

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sunshine
Participant
Posts: 61
Joined: Wed Jan 04, 2006 10:24 am

appending data from 2 different soruces to a single table

Post by sunshine »

Hi,

subject:
appending data from 2 different sources to a single table.

I have 2 source systems

source_1:oracle database

cust_id cust_name cust_city cust_zip
101 XXX City_1 1234
102 YYY City_2 5432
103 ZZZ City_1 1234
104 PPP City_1 1234


source_2: flatfile.txt

cust_id,cust_name,cust_city,cust_zip
105,XXXX,City_1,1234
106,YYYY,City_2,5432
107,ZZZZ,City_1,1234
108,PPPP,City_1,1234



in both sources, the primary key is cust_id

I need to have the data from 2 sources to a oracle table.

output in oracle table should look as:

cust_id cust_name cust_city cust_zip
101 XXX City_1 1234
102 YYY City_2 5432
103 ZZZ City_1 1234
104 PPP City_1 1234
105 XXXX City_1 1234
106 YYYY City_2 5432
107 ZZZZ City_1 1234
108 PPPP City_1 1234



regards
sunshine
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Two separate streams into the same Oracle table. If the keys form disjoint sets, these streams can run in parallel.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sunshine
Participant
Posts: 61
Joined: Wed Jan 04, 2006 10:24 am

Post by sunshine »

[quote="ray.wurlod"]Two separate streams into the same Oracle table. If the keys form disjoint sets, these streams can run in parallel.[/quote]


hi Ray,

as i am novice, can you explain me in detail.

currently i am practising using server jobs..

Two separate streams into the same Oracle table. --> Yes


If the keys form disjoint sets, these streams can run in parallel --> ??

i mean which stages we need to use..

can you be more specific..


Thanks for your reply..

regards
sunshine
sunshine
Participant
Posts: 61
Joined: Wed Jan 04, 2006 10:24 am

Post by sunshine »

[quote="ray.wurlod"]Two separate streams into the same Oracle table. If the keys form disjoint sets, these streams can run in parallel.[/quote]


in both sources, cust_ID (first column) is primary key..
sunshine
Participant
Posts: 61
Joined: Wed Jan 04, 2006 10:24 am

Post by sunshine »

[quote="ray.wurlod"]Two separate streams into the same Oracle table. If the keys form disjoint sets, these streams can run in parallel.[/quote]

Thanks for the suggestion, it worked,got one more doubt, hope u will clear it. I took two instances of oracle, is it possible to have only one instance of the target?

Thanking you
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Post by rwierdsm »

Sunshine,

From your example above, it appears that your data streams have the same format. If this is true, use a collector stage to bring the two sources together and feed into your OCI.

Could look something like:

Seq ---> Xfm \
\
Collector --> XFM --> OCI
/
OCI ---> Xfm /

You wouldn't even need the three XFM, I put them there in the event that some work needs to be done to make the streams the same and that something needs to be done to manipulate data before it goes into the DB.

HTH

Rob Wierdsma
Rob Wierdsma
Toronto, Canada
bartonbishop.com
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post by elavenil »

Make sure that the same customer id does not exist in both streams otherwise primary key violation would occur while loading this data into a table.

Regards
Elavenil
sunshine
Participant
Posts: 61
Joined: Wed Jan 04, 2006 10:24 am

Post by sunshine »

[quote="rwierdsm"]Sunshine,

From your example above, it appears that your data streams have the same format. If this is true, use a collector stage to bring the two sources together and feed into your OCI.

Could look something like:

Seq ---> Xfm \
\
Collector --> XFM --> OCI
/
OCI ---> Xfm /

You wouldn't even need the three XFM, I put them there in the event that some work needs to be done to make the streams the same and that something needs to be done to manipulate data before it goes into the DB.

HTH

Rob Wierdsma[/quote]




but i am getting error:

Link collector Doesnot support in-process active-to-active inputs or outputs :(

Looking forward for your reply,

regards
sunshine
sunshine
Participant
Posts: 61
Joined: Wed Jan 04, 2006 10:24 am

Post by sunshine »

[quote="rwierdsm"]Sunshine,

From your example above, it appears that your data streams have the same format. If this is true, use a collector stage to bring the two sources together and feed into your OCI.

Could look something like:

Seq ---> Xfm \
\
Collector --> XFM --> OCI
/
OCI ---> Xfm /

You wouldn't even need the three XFM, I put them there in the event that some work needs to be done to make the streams the same and that something needs to be done to manipulate data before it goes into the DB.

HTH

Rob Wierdsma[/quote]




Thanks for your reply..


i need to set the option in JOb proeprties: in performance tab, set inprocess.
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post by elavenil »

My memory works correctly, the inter process option should be set in order to get rid of the error occurred.

HTWH.

Regards
Elavenil
sunshine
Participant
Posts: 61
Joined: Wed Jan 04, 2006 10:24 am

Post by sunshine »

[quote="elavenil"]My memory works correctly, the inter process option should be set in order to get rid of the error occurred.

HTWH.

Regards
Elavenil[/quote]


great job, Elavenil.

Thanks you very much.. :)
sunshine
Participant
Posts: 61
Joined: Wed Jan 04, 2006 10:24 am

Post by sunshine »

[quote="elavenil"]My memory works correctly, the inter process option should be set in order to get rid of the error occurred.

HTWH.

Regards
Elavenil[/quote]

if you have some time,can you look into this issue.. :)

viewtopic.php?t=98611
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

sunshine wrote:
elavenil wrote:My memory works correctly, the inter process option should be set in order to get rid of the error occurred.

HTWH.

Regards
Elavenil
if you have some time,can you look into this issue.. :)

viewtopic.php?t=98611
You could reply to Arnds post for the above link.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Post by kwwilliams »

ray.wurlod wrote:Two separate streams into the same Oracle table. If the keys form disjoint sets, these streams can run in parallel.
It looks like we have gone done the route of complexity when Ray offered a very simple solution to this requirement. Create two jobs where both of them insert into your target table. If the jobs do not contain the same data you can run the jobs at the same time which should perform better than using the collector and the IPC stage.
Post Reply