|
|
Archives of the TeradataForum
Message Posted: Fri, 18 Feb 2005 @ 11:51:11 GMT
Subj: | | Re: Upsert with added Update in Multiload |
|
From: | | Dieter Noeth |
Christian Holzapfel wrote:
| I' m writing a mulitload script which should do two things from one record: | |
| First, do an UPSERT, if a row for a specific ID exists, just add the values from the record, if it doesn't, insert it. | |
| Next, do an UPDATE all the time to a different table, adding some values in a status record. | |
| So far the statement looks like this, but Multiload dislikes the second update which actually does not really belong to the UPSERT, and
therefore I get a ML error (**** 09:43:34 UTY1612 Invalid 'INSERT MISSING UPDATE ROWS' .dml request). | |
You need two DML LABEL and two APPLYs:
.DML LABEL Pos DO INSERT FOR MISSING UPDATE ROWS;
UPDATE 1
INSERT
.DML LABEL Pos2;
UPDATE 2
.IMPORT ....
APPLY Pos [WHERE...]
APPLY Pos2 [WHERE...]
Dieter
| |