DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
nima511
Participant



Joined: 08 Oct 2009
Posts: 20

Points: 145

Post Posted: Wed Jul 28, 2010 10:33 am Reply with quote    Back to top    

DataStage® Release: 7x
Job Type: Parallel
OS: Unix
Hello,

I want to perform a Insert into one table (A) and based upon the Insert values in the first table (A) Update the second table (B).

Can I accomplish this using one stage like the ODBC or DRS Stage instead of 2 seperate jobs?
Database that I am using is SQL Server.
ArndW

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup

Joined: 16 Nov 2004
Posts: 14005
Location: Germany
Points: 79124

Post Posted: Wed Jul 28, 2010 10:42 am Reply with quote    Back to top    

Why not have two output stages in one job? Could you specify an example of what you want to do in a couple of words to explain the problem?

_________________
Image
Rate this response:  
Not yet rated
nima511
Participant



Joined: 08 Oct 2009
Posts: 20

Points: 145

Post Posted: Wed Jul 28, 2010 2:24 pm Reply with quote    Back to top    

My job looks like:
File -> Xfrm -> ODBC or DRS Stage

Table A has ID, Name Columns
Table B has ID Column.

In the ODBC or DRS Stage: I want to first insert records into Table A. After populating Table A I want to insert records into Table B based on the records that have been inserted into Table A (ID) Column .

I tried using the DRS Stage by using the After tab for inserting into Table B as below:
INSERT INTO B (ID)
SELECT ID FROM A
ORDER BY ID;

This works fine. But the only thing is that DRS Stage does not have a reject link to show how many records have been inserted and how many have been rejected.
Rate this response:  
Not yet rated
Sainath.Srinivasan

Premium Poster
Participant

Group memberships:
Heartland Usergroup

Joined: 17 Jan 2005
Posts: 3292
Location: United Kingdom
Points: 13962

Post Posted: Wed Jul 28, 2010 3:01 pm Reply with quote    Back to top    

Is the ID generated in the job or part of sequence in the db ? Why must there be two table having same data ? Can you provide bit more info. Maybe you can include a db trigger in A to i ...
Rate this response:  
Not yet rated
nima511
Participant



Joined: 08 Oct 2009
Posts: 20

Points: 145

Post Posted: Wed Jul 28, 2010 3:10 pm Reply with quote    Back to top    

ID is being generated in the transformer.
It is a requirement thats why we need to populate the ID COlumn in both tables.
Rate this response:  
Not yet rated
ArndW

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup

Joined: 16 Nov 2004
Posts: 14005
Location: Germany
Points: 79124

Post Posted: Thu Jul 29, 2010 3:08 am Reply with quote    Back to top    

If I understand your issue, you want to ensure that if records going to A are rejected during the write phase that they don't go into B? In that case, you can put a reject link out of A and then ...

_________________
Image
Rate this response:  
Not yet rated
nima511
Participant



Joined: 08 Oct 2009
Posts: 20

Points: 145

Post Posted: Fri Jul 30, 2010 8:19 am Reply with quote    Back to top    

Exactly.
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours