今天執行一條語句:
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