Maria wrote:
Hello
I have not used db2 in a long time, and I have this very long insert
script, which is giving me an error of duplicated inserts.
My question is how can I put something in the statment so that it will
ignore this message ?
Thank you all
Maria
Try this on DB2 V8.1.2 for LUW instead of a single row INSERT:
MERGE INTO T
USING TABLE(VALUES(1, 2, 3)) AS S(pk, c1, c2)
ON T.pk = S.pk
WHEN NOT MATCHED THEN INSERT VALUES (S.pk, S.c1, S.c2)
Can be extended to INSERT from a SELECT, by changing the USING part
Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab