By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,024 Members | 1,945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,024 IT Pros & Developers. It's quick & easy.

how to ignore in an insert statment

P: n/a
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
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.