由ORA-00979错误发现ORACLE一个BUG

由ORA-00979错误发现ORACLE一个BUG

今天测试在执行一个sql语句的时候,报错ora-00979错误。
SQL如下:
 
select rownum, k.*
  from (select A.t_contract_begindate,
               A.t_contract_enddate,
               A.T_CONTRACT_ID AS T_CONTRACT_ID,
               A.T_CONTRACT_CODE AS T_CONTRACT_CODE,
               A.T_CONTRACT_NAME AS T_CONTRACT_NAME,
               (select USER_NAME
                  from t_pub_user U
                 where U.USER_ID = A.t_Contract_Creator) AS T_CONTRACT_CREATOR,
               A.T_CONTRACT_CREATETIME AS T_CONTRACT_CREATETIME,
               (select D.dept_name
                  from t_pub_dept D
                 where D.dept_id = A.T_CONTRACT_CHENGBANDEPT) AS T_CONTRACT_ZHUBANDEPT,
              (select U.USER_NAME
                  from t_pub_user U
                 where U.USER_ID = A.T_CONTRACT_CHENGBANUSER) AS T_CONTRACT_CHENGBANUSER,
               (select U.USER_NAME
                  from t_pub_user U
                 where U.USER_ID = A.t_Contract_Execuser) AS t_Contract_Execdeptuser,
               (select S.NAME
                  from t_con_status S
                 where S.CODE = A.T_CONTRACT_CURSTATE) AS T_CONTRACT_CURSTATE,
               (select BASE.T_BASE_VALUENAME
                  from t_con_base BASE
                 where BASE.T_BASE_VALUEID = A.t_Contract_Phase) AS t_Contract_Phase,
               (select BASE.T_BASE_VALUENAME
                  from t_con_base BASE
                 where BASE.T_BASE_VALUEID = A.t_Contract_Type) AS t_Contract_Type,
               A.T_CONTRACT_VALIDFLAG AS T_CONTRACT_VALIDFLAG,
               A.T_CONTRACT_SIGNDATE AS T_CONTRACT_SIGNDATE,
               A.T_CONTRACT_SIGNPERSON AS T_CONTRACT_SIGNPERSON,
               A.T_CONTRACT_SENDCHECKDATE AS T_CONTRACT_SENDCHECKDATE,
               A.T_CONTRACT_CHECKENDDATE AS T_CONTRACT_CHECKENDDATE,
               B.T_FINANCE_RMBMONEY AS T_FINANCE_RMBMONEY,
               B.T_FINANCE_MONEY AS T_FINANCE_MONEY,
               V.JINGBANUSER AS JINGBANUSER,
               V.JINGBANDEPT AS JINGBANDEPT
          from t_con_contract A
          left join t_con_finance B on A.t_contract_id =
                                       B.t_finance_contractid
          left join t_con_consupplier G on A.t_contract_id = G.contractid
          left join t_con_approve V on A.t_contract_id = V.t_contract_id
         WHERE A.t_contract_validflag = 1
           and V.approveid =
               (select max(approveid)
                  from t_con_approve
                 where t_contract_id = A.T_CONTRACT_ID)
           AND 1 = 1
           AND A.t_contract_company = '0'
           AND (A.t_contract_htgs = 'CMHN' OR
               ',' || V.JINGBANUSER || ',' like '%,ADMIN,%')
           AND (A.T_CONTRACT_CURSTATE in ('50', '40', '84', '60', '$$$$'))
         ORDER BY t_contract_createtime desc) k
 where rownum < 1001
在网上查了一下资料,可能为oracle一个bug,需要修改oracle的一个设置:
在pl sql中运行:
alter system set "_complex_view_merging" = false scope = spfile;
然后重启oracle,再执行sql语句,执行正常。
  • 0
    点赞
  • 0
    评论
  • 1
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值