Page 1 of 1

updat or insert

Posted: Mon Dec 12, 2005 2:30 am
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
:(

Posted: Mon Dec 12, 2005 2:48 am
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.

Posted: Mon Dec 12, 2005 3:02 am
by rafidwh
iam using OCI stage,what condition should we put in the transformer stage,about the look up key columns

Posted: Mon Dec 12, 2005 3:13 am
by rafidwh
I need to overwrite on the duplicate rows and insert new rows

Posted: Mon Dec 12, 2005 3:36 am
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.

Posted: Mon Dec 12, 2005 4:37 am
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.