Appending Data to Oracle Table using Enterprise Stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
RaviReena
Premium Member
Premium Member
Posts: 68
Joined: Tue Jul 29, 2008 10:01 am

Appending Data to Oracle Table using Enterprise Stage

Post by RaviReena »

I need to append data to existing Oracle Table with primark Key(Column1+Column2) using Oracle Enterprise Stage and the source is flat file,but i need to drop the records when i am appending the records when the primary key is already existing in the table.
What is the best way to design this scenario?
Any suggestions greatly appreciated.
Rao V
swapnilverma
Participant
Posts: 135
Joined: Tue Aug 14, 2007 4:27 am
Location: Mumbai

Post by swapnilverma »

You can use reject link to capture records failing with unique key constrain .... perform delete and then insert ...



hope this help ?

:)
Thanks
Swapnil

"Whenever you find whole world against you just turn around and Lead the world"
RaviReena
Premium Member
Premium Member
Posts: 68
Joined: Tue Jul 29, 2008 10:01 am

no delete is required.

Post by RaviReena »

I do not want to delete the existing records, just append the new record and if the key exists just drop the record.Since we are using Index Rebuild option, it is is inserting all rows and failing to build the indexes.
Can we use any other design approach to skip the records upfront, before coming to Oracle Enterprise stage?
Rao V
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then you need to not send them to the target, and that would typically mean a lookup against the target and only pass the records that 'fail'. Assuming your duplicates are not in your load data, that is.
-craig

"You can never have too many knives" -- Logan Nine Fingers
swapnilverma
Participant
Posts: 135
Joined: Tue Aug 14, 2007 4:27 am
Location: Mumbai

Re: no delete is required.

Post by swapnilverma »

Than u have to identify existing records... and as chulett mentioned should be identified before going to target ... use look up ....

otherwise ... enable index and use reject link logic ...

u can test both and find wt gives better performance.
Thanks
Swapnil

"Whenever you find whole world against you just turn around and Lead the world"
RaviReena
Premium Member
Premium Member
Posts: 68
Joined: Tue Jul 29, 2008 10:01 am

Look up with condition and drop worked

Post by RaviReena »

I tried with lookup and added a condition for key columns with "drop".It worked. thank you for all the support.
Rao V
Post Reply