程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle數據庫基礎 >> ORA-02069錯誤 處理辦法

ORA-02069錯誤 處理辦法

編輯:Oracle數據庫基礎
 

今天執行一條語句:

 

INSERT INTO a@ora156
SELECT seq_sysalert_id.NEXTVAL,
'15098727782' AS MSISDN,
'0' AS MSTYPE,
'sfafs' AS MSMESSAGE,
'0' AS MSFLAG
FROM DUAL

 

拋出錯誤碼為ORA-02069 ,錯誤解釋如下:ORA-02069 global_names parameter must be set to TRUE for this operation

Cause: A remote mapping of the statement is required but cannot be achieved because GLOBAL_NAMES should be set to TRUE for it to be achieved.

Action: Issue ALTER SESSION SET GLOBAL_NAMES = TRUE if possible

 

實際引發錯誤的原因並非如此,而是因為插入的表是遠程數據庫的表,而序列不是遠程數據庫的序列,這時需要將序列後面也添加遠程標識,修改為如下即可:

 

INSERT INTO a@ora156
SELECT seq_sysalert_id.NEXTVAL@ora156,
'15098727782' AS MSISDN,
'0' AS MSTYPE,
'sfafs' AS MSMESSAGE,
'0' AS MSFLAG
FROM DUAL
 

 
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved