Search This Blog

2016/12/20

Insert: Ignore duplicate key|插入数据时无视一致性错误|インサート: 一意制約を無視する

Use hint:
IGNORE_ROW_ON_DUPKEY_INDEX

Example|例
example_tbl and example_tbl_pk
Code:
INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(example_tbl, example_tbl_pk) */
INTO example_tbl
VALUES (id, ...);

If this id (primary key) isn't exist in example_tbl, insert this record. Or ignore this record and do next function.


No comments :

Post a Comment