Print Thread
[BUG] The beautifier caused an error - XMLQuery
#53287 03/15/16 09:46 AM
Joined: Feb 2007
Posts: 134
Bulgaria
braykov Offline OP
Member
OP Offline
Member
Joined: Feb 2007
Posts: 134
Bulgaria
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.


Re: [BUG] The beautifier caused an error - XMLQuery
braykov #53288 03/15/16 09:57 AM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
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?


Marco Kalter
Allround Automations
Re: [BUG] The beautifier caused an error - XMLQuery
Marco Kalter #53290 03/15/16 03:38 PM
Joined: Feb 2007
Posts: 134
Bulgaria
braykov Offline OP
Member
OP Offline
Member
Joined: Feb 2007
Posts: 134
Bulgaria
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.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.054s Queries: 14 (0.007s) Memory: 2.5093 MB (Peak: 3.0430 MB) Data Comp: Off Server Time: 2024-05-20 05:30:00 UTC
Valid HTML 5 and Valid CSS