0
我在創建下面的過程時遇到了以下錯誤,我也從過程中刪除了大部分部分,僅包含了我正面臨的部分問題。問題在解碼條款中,請幫助!編譯過程時出現oracle錯誤
[警告] ORA-24344:成功與編譯錯誤41分之84PL/SQL: ORA-00907:錯過右括號四分之三十三PL/SQL:SQL語句 忽略(2:0):警告:編譯但編譯錯誤
CREATE OR REPLACE PROCEDURE ERR_OUT (
in_Srcsyscd IN VARCHAR2)
IS
rcrdnums VARCHAR2 (32767);
rcrd_cnt INT;
BEGIN
rcrd_cnt := 500;
SELECT RTRIM (
XMLCAST (
XMLAGG (XMLELEMENT (e, RCRDNUM) ORDER BY RCRDNUM) AS CLOB),
',')
INTO rcrdnums
FROM (SELECT (ERR.RCRDNUM || ',') AS RCRDNUM
FROM tableName ERR
WHERE ROWNUM <= rcrd_cnt
AND ( in_srcsyscd IS NULL
OR (decode (REGEXP_COUNT (in_srcsyscd, ','),0,(ERR.Srcsyscd = in_srcsyscd),
(ERR.Srcsyscd IN
(SELECT DISTINCT srcsyscd
FROM tableName
WHERE srcsyscd IN
(SELECT err.srcsyscd
FROM tableName ERR
RIGHT OUTER JOIN
( SELECT UPPER (
REGEXP_SUBSTR (
in_Srcsyscd,
'[^,]+',
1,
LEVEL))
CNTRY_CD
FROM DUAL
CONNECT BY REGEXP_SUBSTR (in_Srcsyscd,
'[^,]+',
1,
LEVEL)
IS NOT NULL) CNTRY_P
ON (UPPER (
ERR.srcsyscd) !=
CNTRY_P.CNTRY_CD))
OR srcsyscd IS NULL)))))
下面是我現在所面臨的問題,並沒有與括號的數量沒有問題,我可以觀察,但仍甲骨文拋出錯誤此where子句:
AND ( in_srcsyscd IS NULL
OR (decode (REGEXP_COUNT (in_srcsyscd, ','),0,(ERR.Srcsyscd = in_srcsyscd),
(ERR.Srcsyscd IN
(SELECT DISTINCT srcsyscd
FROM AMT_OWNER.AMT_EVNT_SPND_ERR_STG
WHERE srcsyscd IN
(SELECT err.srcsyscd
FROM TableName
RIGHT OUTER JOIN
( SELECT UPPER (
REGEXP_SUBSTR (
'CONCUR',
'[^,]+',
1,
LEVEL))
CNTRY_CD
FROM DUAL
CONNECT BY REGEXP_SUBSTR (
'CONCUR',
'[^,]+',
1,
LEVEL)
IS NOT NULL) CNTRY_P
ON (UPPER (
ERR.srcsyscd) !=
CNTRY_P.CNTRY_CD))
OR srcsyscd IS NULL)))))
「缺少右括號」給你所有。如果您使用記事本++或一些括號的幫助,你會發現你錯過了最後一個圓括號 ...「或srcsyscd IS NULL)))))」 –
這似乎不是一個括號的問題。 –