• ORA02070: database SALES does not support operator USERENV in this context


    insert into erp_customer3@erpsales
                  (cust_acct_site_id,
                   meaning,
                   segment2,
                   status,
                   creation_date,
                   created_by,
                   last_update_date,
                   last_updated_by)
                  select csua.cust_acct_site_id,
                         flvv.meaning,
                         gcc.segment2,
                         csua.status,
                         csua.creation_date,
                         csua.created_by,
                         csua.last_update_date,
                         csua.last_updated_by
                    from hz_cust_site_uses_all   csua,
                         fnd_lookup_values       flvv,
                         gl_code_combinations    gcc,
                         apps.fnd_flex_values_vl ffvv
                   where csua.site_use_code = flvv.lookup_code
                     and flvv.lookup_type = 'SITE_USE_CODE'
                     and flvv.language = userenv('LANG')
                     and csua.gl_id_rev = gcc.code_combination_id(+)
                     and gcc.segment2 = ffvv.flex_value(+)
                     and ffvv.flex_value_set_id(+) = 1009628
                     and csua.status = 'A';

    ERROR:ORA-02070: database SALES does not support operator USERENV in this context

    临时解决办法:

      and flvv.language = userenv('LANG')替换成and flvv.language = 'ZHS'

      另外建立临时表fnd_flex_values_vl_tmp存储fnd_flex_values_vl的数据。

            delete from fnd_flex_values_vl_tmp;
            commit;
                       
            --插入数据到临时表
            insert into fnd_flex_values_vl_tmp
            select * from apps.fnd_flex_values_vl;
            commit;

                insert into erp_customer3@erpsales
                  (cust_acct_site_id,
                   meaning,
                   segment2,
                   status,
                   creation_date,
                   created_by,
                   last_update_date,
                   last_updated_by)
                  select csua.cust_acct_site_id,
                         flvv.meaning,
                         gcc.segment2,
                         csua.status,
                         csua.creation_date,
                         csua.created_by,
                         csua.last_update_date,
                         csua.last_updated_by
                    from hz_cust_site_uses_all   csua,
                         fnd_lookup_values       flvv,
                         gl_code_combinations    gcc,
                         fnd_flex_values_vl_tmp  ffvv
                   where csua.site_use_code = flvv.lookup_code
                     and flvv.lookup_type = 'SITE_USE_CODE'
                     and flvv.language = 'ZHS'

                     and csua.gl_id_rev = gcc.code_combination_id(+)
                     and gcc.segment2 = ffvv.flex_value(+)
                     and ffvv.flex_value_set_id(+) = 1009628
                     and csua.status = 'A';

  • 相关阅读:
    改变对象的字符串提示
    perl 和 python中的回调函数
    shiro权限验证标签
    user_tables 的信息依赖于统计信息
    centos jdk 1.7升级到1.8后显示还是1.7
    7.1 可接受任意数量参数的函数:
    IntelliJ IDEA中怎么查看文件中所有方法(类似eclipse里面的outline)
    Intellij IDEA 代码格式化与eclipse保持风格一致
    jquery-1.9.1.min.js:69 Uncaught TypeError: Illegal invocation
    python json模块
  • 原文地址:https://www.cnblogs.com/benio/p/1632073.html
Copyright © 2020-2023  润新知