Oracle 11g使用MERGE報錯'ORA-02287..The specified sequence number (CURRVAL'
執行SQL語句報錯
MERGE INTO OAPS_PARAMETERS a
USING (select SEQ_OAPS_PARAMETER.NEXTVAL N_ID,'OSMSR' C_PRODUCT_TYPE,'core' C_GROUP_NAME,'sendAdminAgentParamsUpdate' C_PARAM_NAME,'true' C_PARAM_VALUE,'true' C_PARAM_DEFAULT,0 N_CATEGORY,0 N_PARAMETER_TYPE,
'whether AdminAgentParamsUpdate APDU is sent (true) or not sent (false) during SM-SR change' C_DESCRIPTION,2 N_ACCESS_TYPE,'System' C_PARAM_NAME_SUFFIX,systimestamp D_TIMESTAMP from dual) b
ON (a.C_PARAM_NAME = b.C_PARAM_NAME)
WHEN NOT MATCHED THEN
insert (N_ID,C_PRODUCT_TYPE,C_GROUP_NAME,C_PARAM_NAME,C_PARAM_VALUE,C_PARAM_DEFAULT,N_CATEGORY,N_PARAMETER_TYPE,C_DESCRIPTION,N_ACCESS_TYPE,C_PARAM_NAME_SUFFIX,D_TIMESTAMP) values
(b.N_ID,b.C_PRODUCT_TYPE,b.C_GROUP_NAME,b.C_PARAM_NAME,b.C_PARAM_VALUE,b.C_PARAM_DEFAULT,b.N_CATEGORY,
b.N_PARAMETER_TYPE,b.C_DESCRIPTION,b.N_ACCESS_TYPE,b.C_PARAM_NAME_SUFFIX,b.D_TIMESTAMP);
SQL 錯誤: ORA-02287: 此處不允許序號
02287. 00000 - "sequence number not allowed here"
*Cause: The specified sequence number (CURRVAL or NEXTVAL) is inappropriate
here in the statement.
*Action: Remove the sequence number.
報錯原因:
在USING語句中不能使用序列
解決方法:
將序列放到下方的INSERT語句中
MERGE INTO OAPS_PARAMETERS a
USING (select 'OSMSR' C_PRODUCT_TYPE,'core' C_GROUP_NAME,'sendAdminAgentParamsUpdate' C_PARAM_NAME,'true' C_PARAM_VALUE,'true' C_PARAM_DEFAULT,0 N_CATEGORY,0 N_PARAMETER_TYPE,
'whether AdminAgentParamsUpdate APDU is sent (true) or not sent (false) during SM-SR change' C_DESCRIPTION,2 N_ACCESS_TYPE,'System' C_PARAM_NAME_SUFFIX,systimestamp D_TIMESTAMP from dual) b
ON (a.C_PARAM_NAME = b.C_PARAM_NAME)
WHEN NOT MATCHED THEN
insert (N_ID,C_PRODUCT_TYPE,C_GROUP_NAME,C_PARAM_NAME,C_PARAM_VALUE,C_PARAM_DEFAULT,N_CATEGORY,N_PARAMETER_TYPE,C_DESCRIPTION,N_ACCESS_TYPE,C_PARAM_NAME_SUFFIX,D_TIMESTAMP) values
(SEQ_OAPS_PARAMETER.NEXTVAL,b.C_PRODUCT_TYPE,b.C_GROUP_NAME,b.C_PARAM_NAME,b.C_PARAM_VALUE,b.C_PARAM_DEFAULT,b.N_CATEGORY,
b.N_PARAMETER_TYPE,b.C_DESCRIPTION,b.N_ACCESS_TYPE,b.C_PARAM_NAME_SUFFIX,b.D_TIMESTAMP);
MERGE INTO OAPS_PARAMETERS a
USING (select SEQ_OAPS_PARAMETER.NEXTVAL N_ID,'OSMSR' C_PRODUCT_TYPE,'core' C_GROUP_NAME,'sendAdminAgentParamsUpdate' C_PARAM_NAME,'true' C_PARAM_VALUE,'true' C_PARAM_DEFAULT,0 N_CATEGORY,0 N_PARAMETER_TYPE,
'whether AdminAgentParamsUpdate APDU is sent (true) or not sent (false) during SM-SR change' C_DESCRIPTION,2 N_ACCESS_TYPE,'System' C_PARAM_NAME_SUFFIX,systimestamp D_TIMESTAMP from dual) b
ON (a.C_PARAM_NAME = b.C_PARAM_NAME)
WHEN NOT MATCHED THEN
insert (N_ID,C_PRODUCT_TYPE,C_GROUP_NAME,C_PARAM_NAME,C_PARAM_VALUE,C_PARAM_DEFAULT,N_CATEGORY,N_PARAMETER_TYPE,C_DESCRIPTION,N_ACCESS_TYPE,C_PARAM_NAME_SUFFIX,D_TIMESTAMP) values
(b.N_ID,b.C_PRODUCT_TYPE,b.C_GROUP_NAME,b.C_PARAM_NAME,b.C_PARAM_VALUE,b.C_PARAM_DEFAULT,b.N_CATEGORY,
b.N_PARAMETER_TYPE,b.C_DESCRIPTION,b.N_ACCESS_TYPE,b.C_PARAM_NAME_SUFFIX,b.D_TIMESTAMP);
SQL 錯誤: ORA-02287: 此處不允許序號
02287. 00000 - "sequence number not allowed here"
*Cause: The specified sequence number (CURRVAL or NEXTVAL) is inappropriate
here in the statement.
*Action: Remove the sequence number.
報錯原因:
在USING語句中不能使用序列
解決方法:
將序列放到下方的INSERT語句中
MERGE INTO OAPS_PARAMETERS a
USING (select 'OSMSR' C_PRODUCT_TYPE,'core' C_GROUP_NAME,'sendAdminAgentParamsUpdate' C_PARAM_NAME,'true' C_PARAM_VALUE,'true' C_PARAM_DEFAULT,0 N_CATEGORY,0 N_PARAMETER_TYPE,
'whether AdminAgentParamsUpdate APDU is sent (true) or not sent (false) during SM-SR change' C_DESCRIPTION,2 N_ACCESS_TYPE,'System' C_PARAM_NAME_SUFFIX,systimestamp D_TIMESTAMP from dual) b
ON (a.C_PARAM_NAME = b.C_PARAM_NAME)
WHEN NOT MATCHED THEN
insert (N_ID,C_PRODUCT_TYPE,C_GROUP_NAME,C_PARAM_NAME,C_PARAM_VALUE,C_PARAM_DEFAULT,N_CATEGORY,N_PARAMETER_TYPE,C_DESCRIPTION,N_ACCESS_TYPE,C_PARAM_NAME_SUFFIX,D_TIMESTAMP) values
(SEQ_OAPS_PARAMETER.NEXTVAL,b.C_PRODUCT_TYPE,b.C_GROUP_NAME,b.C_PARAM_NAME,b.C_PARAM_VALUE,b.C_PARAM_DEFAULT,b.N_CATEGORY,
b.N_PARAMETER_TYPE,b.C_DESCRIPTION,b.N_ACCESS_TYPE,b.C_PARAM_NAME_SUFFIX,b.D_TIMESTAMP);
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-2133187/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- mongodb報錯:the limit must be specified as a number。MongoDBMIT
- oracle 11g登陸報錯'ORA-12162: TNS:net service name is incorrectly specified'Oracle
- 頁面報錯 No input file specified
- oracle 11g安裝報錯Oracle
- oracle ORA-01722 報錯 "invalid number"Oracle
- HDU 1711 Number Sequence(KMP)KMP
- Oracle中Sequence的使用Oracle
- 在intersect中利用oracle sequence報錯_ora-02287Oracle
- HDU 1005 Number Sequence(矩陣)矩陣
- HDU4390Number Sequence(容斥原理)
- oracle中sequence使用的限制Oracle
- 使用oracle 11g bbed dump undo header block報錯之系列六OracleHeaderBloC
- oracle中的CURRVAL和NEXTVAL用法Oracle
- Oracle中sequence的使用方法Oracle
- ORACLE SEQUENCEOracle
- Oracle 11g 報錯 ORA-28000 the account is lockedOracle
- HDU 1005 Number Sequence(矩陣快速冪)矩陣
- HDU 1005 Number Sequence:矩陣快速冪矩陣
- opatch報錯:The oraInst.loc file specified is not validAI
- oracle中merge 語句使用Oracle
- oracle 11.2.0.4 sequence之dba_sequences last_number含義測試之一OracleAST
- ORACLE SEQUENCE用法Oracle
- Oracle - Sequence序列Oracle
- Oracle Sequence NocacheOracle
- Oracle序列sequenceOracle
- Oracle實驗(03):number的使用Oracle
- MySQL過程報 Parameter number N is not an OUT parameter錯誤MySql
- JBoss部署啟動後報錯“Apparently wrong driver class specified for URL”APP
- 執行gedit報No protocol specifiedProtocol
- Oracle之Sequence(序列)Oracle
- Oracle Sequence Audses$研究Oracle
- oracle sequence語法Oracle
- oracle sequence 試用Oracle
- oracle 11g 錯誤收集Oracle
- Oracle 11g報錯"ORA-00845: MEMORY_TARGET not supported on this system"Oracle
- oracle 11g報錯ORA-00845: MEMORY_TARGET not supported on this systemOracle
- 【Sequence】序列操作start with,nextval,currval三者之間的“複雜”關係與重要結論
- Oracle 11G靜默安裝報錯Oracle recommends that if you want to keep this log...Oracle