【问题标题】:Unable to execute dynamic sql Error:global_names parameter must be set to TRUE for this operation无法执行动态 sql 错误:global_names parameter must be set to TRUE for this operation
【发布时间】:2016-11-26 09:15:13
【问题描述】:

我有一个远程表,其中包含通过数据库链接访问的 blob 列。我想将本地表中的 blob 插入到远程表 blob 列中。我正在执行动态sql,如下所示

declare
    theblob blob;
    theclob clob;
    thenumber number;
begin
   select base64encode2(image) into theclob from per_images where image_id = 113077;
   execute immediate 'insert into image@APPSERP2ERPAPPS(column1,column2,column3) values((select null from dual),(select base64encode2(image) from per_images where image_id = 113077),(select ceil(5.4) from dual))';
   commit; 
end;

当我运行 sql 时,我得到 ORA-02069: global_names parameter must be set to TRUE for this operation。

如果我执行ALTER SESSION SET GLOBAL_NAMES = true,那么我在插入 blob 时收到 数据库链接 APPSERP2ERPAPPS.CSN.EDU.PK 连接到 TEST.CSN.EDU.PK 错误。

请告诉我如何将 blob 插入远程表 blob 列。

谢谢

【问题讨论】:

  • 嗨,您是否寻找过连接问题或相关问题,您是否尝试过没有像这里 asktom.oracle.com/pls/apex/… 那样的“值”
  • 当我插入 null 它没有给出错误。 INSERT INTO image@APPSERP2ERPAPPS SELECT * FROM mview 但同样的错误
  • @karelss 谢谢。您提供的链接有效。
  • 你很高兴我会把这个作为答案,你能在这里发布最终解决方案
  • 是的,请确定...

标签: plsql dynamic-sql


【解决方案1】:

为了能够通过 dblink 插入,插入语句必须匹配此格式

Insert into table2@dblink select * from Table1

here 更多信息。

【讨论】:

    猜你喜欢
    • 2022-01-05
    • 2022-12-19
    • 1970-01-01
    • 2022-12-17
    • 2023-03-06
    • 2023-02-22
    • 2022-12-22
    • 2023-01-04
    • 2016-02-19
    相关资源
    最近更新 更多