insert into dmitem@itf_jst(
      consignor_code, item_code, item_name, barcode, opcode, formulation, supplier_city,
      item_bigsort, item_hitsort, inner_code, pack_no, package_number, bigpackage_number,
      big_weight, big_length, big_width, big_height, weight, length, width, height, 
      storage_conditions, consignor_item_name, specifications, supplier_code, approval_number,
      trade, item_unit, item_cess, trade_price, retail_price, maintenance_cycle, 
      item_validity, state, isstimulant, specialsort, isbatchs, isimport, isregulation, isbirth,
      isexamine, istrack, isconsrelease, re)
    select
      consignor_code, item_code, item_name, barcode, "OPCODE", formulation, supplier_city,
      item_bigsort, item_hitsort, inner_code, pack_no, package_number, bigpackage_number,
      big_weight, big_length, big_width, big_height, weight, length, width, height, 
      storage_conditions, consignor_item_name, specifications, supplier_code, approval_number,
      trade, item_unit, item_cess, trade_price, retail_price, maintenance_cycle, 
      item_validity, state, isstimulant, specialsort, isbatchs, isimport, isregulation, isbirth,
      isexamine, istrack, isconsrelease, re
    from 
      jst_view_article;
提示:此操作的 global_names 参数必须设置为 True
但是奇怪的是我把 "OPCODE" 改为 'opcode' 就可以顺利执行(这样就不能插入字段的值了)
对方数据库的 global_names 要求不能设为 True; 我该怎么办?

解决方案 »

  1.   

    1、这里与global_names无关,global_names参数是用来设置DATABASE LINK的名称是否必须与被连接库的GLOBAL_NAME一致,对方数据库的global_names设为false的话你这边的数据库链路可以随便命名。
    2、select "OPCODE" from  jst_view_article;等同于 select opcode from  jst_view_article;
    但是,select 'opcode' from  jst_view_article;得到是值全是'opcode'的记录。
    不知道能不能解决你的问题?
      

  2.   

    我知道如果 'opcode' 的话,得到的就全是 'opcode'!
    既然与 global_names 无关的话,怎么解决我这个问题呢
      

  3.   

    你要想这张表dmitem@itf_jst中,给opcode字段,插入什么值?是‘opcode’?还是jst_view_article表中的OPCODE字段值?如果是后者,那么就别加双引号。如果是前者,相信你已经知道方法
      

  4.   

    楼上就是想插入 jst_view_article 中的 opcode 字段的值,因为这个好像是关键字,所以改成了 "OPCODE"; 问题是它提示错误,不能执行啊
    我想说的是,我把 jst_view_article.opcode 随便改成一个字符,比如:'test'; 它就能顺利执行,到底是怎么回事啊
      

  5.   

    我就是想插入 jst_view_article 中的 opcode 字段的值,因为这个好像是关键字,所以改成了 "OPCODE"; 问题是它提示错误,不能执行啊
    我想说的是,我把 jst_view_article.opcode 随便改成一个字符,比如:'test'; 它就能顺利执行,到底是怎么回事啊
      

  6.   

    我终于知道为什么了!!!
    我在试图 jst_view_article.opcode 字段中用到了一个自定义的函数 isnumeric
    将这个自定义函数注释掉就可以顺利执行,我想应该是权限问题!如何把这个权限问题解决呢?
    我的数据库用户本身就是 DBA 权限了,难道还要设置对方数据库用户的权限?!!