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
updat or insert
Moderators: chulett, rschirm, roy
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.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
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.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
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.
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.