hint IGNORE_ROW_ON_DUPKEY_INDEX
11G新加 IGNORE_ROW_ON_DUPKEY_INDEX 這個hint可以讓對有主鍵的重複值時,不去報錯:
SQL> drop table test purge;
Table dropped.
SQL> create table test (id number primary key, name varchar2(10));
Table created.
SQL> insert into test values (1,'111');
1 row created.
SQL> insert into test values (1,'111');
insert into test values (1,'111')
*
ERROR at line 1:
ORA-00001: unique constraint (SONG.SYS_C0011677) violated
SQL> insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(test,SYS_C0011677)*/ into test values (1,'111');
0 rows created.
SQL> insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(test,aaa)*/ into test values (1,'111'); --hints用錯,會報錯
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(test,aaa)*/ into test values (1,'111')
*
ERROR at line 1:
ORA-38913: Index specified in the index hint is invalid
SQL> drop table test purge;
Table dropped.
SQL> create table test (id number primary key, name varchar2(10));
Table created.
SQL> insert into test values (1,'111');
1 row created.
SQL> insert into test values (1,'111');
insert into test values (1,'111')
*
ERROR at line 1:
ORA-00001: unique constraint (SONG.SYS_C0011677) violated
SQL> insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(test,SYS_C0011677)*/ into test values (1,'111');
0 rows created.
SQL> insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(test,aaa)*/ into test values (1,'111'); --hints用錯,會報錯
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(test,aaa)*/ into test values (1,'111')
*
ERROR at line 1:
ORA-38913: Index specified in the index hint is invalid
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25099483/viewspace-1068150/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle hintOracle
- oracle hint之hint_index_ffs,index_joinOracleIndex
- ORACLE 部分HINTOracle
- Append HintAPP
- oracle hint (續)Oracle
- Oracle Hint 精華Oracle
- 【sql hint 提示】SQL
- sql hint articleSQL
- Oralce SQL hintSQL
- 【TUNE_ORACLE】Oracle Hint之常用Hint功能概述(五)Oracle
- 【TUNE_ORACLE】Oracle Hint之常用Hint功能概述(四)Oracle
- 【TUNE_ORACLE】Oracle Hint之常用Hint功能概述(三)Oracle
- 【TUNE_ORACLE】Oracle Hint之常用Hint功能概述(二)Oracle
- 【TUNE_ORACLE】Oracle Hint之常用Hint功能概述(一)Oracle
- 【HINT】使用“NO_INDEX ”Hint提示避免SQL使用特定索引IndexSQL索引
- zt_Oracle hint driving_site Hint的用法Oracle
- LOCAL INDEX和HINT的使用【DO BE USED LOCAL INDEX IN HINT】薦Index
- oracle之hint概述Oracle
- oracle常見hintOracle
- mysql常用的hintMySql
- MySQL SQL hint 提示MySql
- oracle hint簡述Oracle
- oracle hint (續-0)Oracle
- oracle hint_no_indexOracleIndex
- Oracle Hint 精華文章Oracle
- 常用的Oracle HintOracle
- Oracle Hint 詳解Oracle
- Oracle Hint的用法Oracle
- 【sql調優之執行計劃】使用hint(五)Hint for parallelSQLParallel
- ORACLE11GR2 中使用 IGNORE_ROW_ON_DUPKEY_INDEXOracleIndex
- Oracle11gr2新增提示IGNORE_ROW_ON_DUPKEY_INDEXOracleIndex
- ORACLE的HINT詳解Oracle
- SAP HANA Hint簡介
- Hint學習筆記筆記
- Oracle中Hint隨記Oracle
- oracle hint no_mergeOracle
- oracle hint_no_expand_no_factOracle
- oracle hint_cache_nocacheOracle