更新到数据库时,我的更新收到以下错误:
ORA-00001: 违反了唯一约束 (DONALDBURY.BARS_ID_PK)
我正在使用以下代码作为我的更新。我不想摆脱约束,而是想找到一种解决方法。我想停止设置重复值。
MERGE INTO bars DEST_TABLE
USING (select :P3_filename as filename from dual) SOURCE_TABLE
ON (DEST_TABLE.name = SOURCE_TABLE.filename)
WHEN MATCHED THEN
UPDATE SET image = ORDSYS.ORDImage()
WHEN NOT MATCHED THEN
INSERT (
image_id,
filename,
image,
name,
address,
postcode,
description)
VALUES (:P3_image_id,
:P3_filename,
ORDSYS.ORDImage(),
:P3_NAME,
:P3_ADDRESS,
:P3_POSTCODE,
:P3_DESCRIPTION);