ORA-02069错误 处理办法

今天执行一条语句:

 

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
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值