我必須將數據插入到表,但這個表有兩列column_1
和column_2
唯一約束。現在在插入過程中出現以下錯誤:避免重複在插入
Lookup Error - DB2 Database Error: ERROR [23505] [IBM][DB2/AIX64] SQL0803N One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "1" constrains table "table_name" from having duplicate values for the index key. SQLSTATE=23505.
如何避免此錯誤?
請參閱https://www.withdata.com/blog/db2/replace-update-or-insert-a-row-into-db2-table-merge-into.html –