updat or insert

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
rafidwh
Participant
Posts: 179
Joined: Mon Oct 10, 2005 11:30 pm

updat or insert

Post by rafidwh »

I need to update existing rows or insert rows based on two look up keys
can anyone tell me what the condition to be written in the constraint for both UPDATE AND INSERT
PL HELP ME OUT
THANKS
:(
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The method you use depends upon the target database stage. If you are using Oracle then there is a "update or insert" as well as a "insert or update" option.
rafidwh
Participant
Posts: 179
Joined: Mon Oct 10, 2005 11:30 pm

Post by rafidwh »

iam using OCI stage,what condition should we put in the transformer stage,about the look up key columns
rafidwh
Participant
Posts: 179
Joined: Mon Oct 10, 2005 11:30 pm

Post by rafidwh »

I need to overwrite on the duplicate rows and insert new rows
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

This "condition" is part of the OCI stage attributes and is not done in a transform stage. From your description you would want to do a "update existing or insert new" in the OCI stage.
ridar
Participant
Posts: 10
Joined: Wed Sep 28, 2005 5:59 am

Post by ridar »

Hi rafidwh,
Arnd's answer is enough to solve ur problem. But, if u r very much insisting on adding conditions in the transformer(by conditions i hope u r referring to the constraint to be put in the transformer for the look up) then u can check for NULL value returned from the lookup. If the lookup value is null then direct it to insert, else u can direct it to update. Hope this answers ur question.

Ridar.
Post Reply