代码之家  ›  专栏  ›  技术社区  ›  Matt

Oracle SQL ORA-00600:最大和regexp_replace子查询错误

  •  0
  • Matt  · 技术社区  · 6 年前

    regexp_replace 获取时间戳的函数,它位于 GREATEST

    我在子查询中使用的数据如下所示:

    IDDate      IDKeys
    17-DEC-16   Q=INT^A_NO=123^
    03-OCT-18   B_ID=123^
    18-OCT-18   C_ID=123^
    28-OCT-18   C_ID=123^
    

    SELECT MAX(IDDate) GDATE
    FROM HHL h
    WHERE regexp_replace(IDKeys, '[^0-9]', '') = '123'
    AND LEFT(IDKeys, 1) = 'C'
    

    它返回正确的信息

    GDATE
    28-OCT-18
    

    但是,当我将其作为子查询合并到外部查询中时,如下所示:

    SELECT DISTINCT
    c.P_ID,
    GREATEST((SELECT MAX(IDDate) GDATE
              FROM HHL h
              WHERE regexp_replace(IDKeys, '[^0-9]', '') = c.P_ID
              AND LEFT(IDKeys, 1) = 'C'), c.CIDDate) GCDate
    FROM CICC c
    

    我得到以下错误:

    ORA-00600: internal error code, arguments: [kkqcsfixfro:1 -- frooutj], [], [], [], [], [], [], [], [], [], [], []
    00600. 00000 -  "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]"
    *Cause: This is the generic internal error number for Oracle program
            exceptions. It indicates that a process has encountered a low-level,
            unexpected condition. The first argument is the internal message
            number. This argument and the database version number are critical in
            identifying the root cause and the potential impact to your system.
    

    编辑

    SUBSTR INSTR 功能而不是 :

    SELECT DISTINCT
    c.P_ID,
    GREATEST((SELECT MAX(IDDate) GDATE
              FROM HHL h
              WHERE SUBSTR(NVL(SUBSTR(IDKeys, 0, INSTR(IDKeys, '^')-1), IDKeys), INSTR(NVL(SUBSTR(IDKeys, 0, INSTR(IDKeys, '^')-1), IDKeys), '=') + 1) = c.P_ID
              AND LEFT(IDKeys, 1) = 'C'), c.CIDDate) GCDate
    FROM CICC c
    
    1 回复  |  直到 6 年前
        1
  •  2
  •   Jacek Wróbel    6 年前

    我建议您创建一个对Oracle支持的服务请求。好像你要面对 错误19894622-ORA-600[kkqcsfixfro:1--frooutj]12c中发生错误(文档ID 19894622.8) . 受影响的软件版本为>=12.1.0.1但低于12.2的版本。你至少应该向你的dba确认你有什么软件版本,以及补丁是否能解决问题。

    便条上描述了一次散步。

    alter session set "_optimizer_unnest_scalar_sq"=false;