[BUG] The beautifier caused an error - XMLQuery

braykov

Member³
We get an error trying to beatify the following:

Code:
SELECT XMLQuery('copy $d := $se
                        modify (
                         for $i in $d/PmtInf/DrctDbtTxInf/DrctDbtTxInf/DrctDbtTx/MndtRltdInf/AmdmntInfDtls/OrgnlCdtrSchmeId/Id/PrvtId/Othr/SchemeNm
                         return   rename node $i as "SchmeNm"
                        )
                        return $d' passing v_domxml AS "se" RETURNING content)
       INTO v_domxml
       FROM dual;

The bigger problem is that putting --NoFormat Start/End around this select changes nothing.
We needed to suppress beautification of the whole procedure.

 
I tested this and it seems to work fine. Can you send me a complete program source so that I can try to reproduce this?
 
I am not allowed to give you the full code, but I have narrowed it down to a small function which still fires the error. Try it:

Code:
FUNCTION My_FUNCTION(     p         NUMBER  ) RETURN NUMBER IS
    BEGIN

          IF FALSE IS NULL
          THEN
             IF TRUE
             THEN
   SELECT XMLQuery('copy $d := $se
             modify (
              for $i in $d/PmtInf/DrctDbtTxInf/DrctDbtTx/MndtRltdInf/AmdmntInfDtls/OrgnlCdtrSchmeId/Id/PrvtId/Othr/SchemeNm
              return   rename node $i as "SchmeNm"
             )
             return $d' passing v AS "se" RETURNING content)
     INTO v
     FROM dual;
              END IF;
          ELSE
             IF TRUE IS NOT NULL
             THEN
                SELECT INSERTCHILDXMLAFTER(v, '/PmtInf/PmtTpInf','SeqTp', XMLTYPE('<CtgyPurp> <Cd>' || '</Cd>
                                                      </CtgyPurp>'))
                  INTO v
                  FROM dual;
             END IF;
          END IF;
    END My_FUNCTION;

From here on, if I change anything in the multiline strings or if I remove any of both if then else (outer) blocks, it will beautify with no error.
 
Back
Top