Print Thread
Beutifier breaks formatting enclosed in NoFormat
#64792 09/14/23 02:40 PM
Joined: Sep 2016
Posts: 8
Sweden
J
jaw Offline OP
Member
OP Offline
Member
J
Joined: Sep 2016
Posts: 8
Sweden
Hi,

The beautifier is great most of the time, but there are things it can't handle. For example, it sucks when generating large XML files directly from query.

That is where I found that I could use the "--NoFormat Start" and "--NoFormat End" keywords to have a part of the SELECT ignored. But in 15.0.4 I have found a problem with it.

To recreate. Open a Test window.

Enter below:
Code
WITH a AS
 (SELECT 123
    FROM DUAL)

--NoFormat Start
SELECT XMLElement("DATA",  XMLCDATA('Hi,


This is some long data that shouldn''t be touched since it is enclosed as string.

Best Regards'))
  FROM a  
--NoFormat End

First time I hit beautifier I get this:
Code
WITH a AS
 (SELECT 123
    FROM DUAL)

 --NoFormat Start
SELECT XMLElement("DATA",  XMLCDATA('Hi,


This is some long data that shouldn''t be touched since it is enclosed as string.

Best Regards'))
  FROM a  
--NoFormat End

It might be hard to notice, but I got an extra indention on the "--NoFormat Start" line.

If I rerun the beautifier this happens:

Code
WITH a AS
 (SELECT 123
    FROM DUAL)

    --NoFormat Start
   SELECT XMLElement("DATA",  XMLCDATA('Hi,
   
   
   This is some long data that shouldn''t be touched since it is enclosed as string.
   
   Best Regards'))
     FROM a  
   --NoFormat End


Suddenly everything gets indented, including the string, which really messes up my data output.

Please fix as soon as possible.

Best regards,
jaw

Re: Beutifier breaks formatting enclosed in NoFormat
jaw #64794 09/15/23 08:19 AM
Joined: Aug 1999
Posts: 22,218
Member
Offline
Member
Joined: Aug 1999
Posts: 22,218
What happens if you enclose the complete "with" statement by the NoFormat directives?


Marco Kalter
Allround Automations
Re: Beutifier breaks formatting enclosed in NoFormat
jaw #64797 09/18/23 12:14 PM
Joined: Sep 2016
Posts: 8
Sweden
J
jaw Offline OP
Member
OP Offline
Member
J
Joined: Sep 2016
Posts: 8
Sweden
Then I get an error PL/SQL Beautifier couldn't parse text, or similar.

More importantly, I guess even if it would work then PL/SQL Developer wouldn't beautify the parts of the code that I actually want it to beautify...


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.043s Queries: 15 (0.009s) Memory: 2.5064 MB (Peak: 3.0408 MB) Data Comp: Off Server Time: 2024-05-14 09:34:21 UTC
Valid HTML 5 and Valid CSS