Bug in Beautifier

Patric

Member

SQL:
SELECT CASE
               WHEN listagg(DISTINCT t, ',') within GROUP(ORDER BY LENGTH(t) DESC) LIKE 'XXX%' THEN
                                  'XXX'
         ELSE
          'YY'
                                   END my_result
  FROM (SELECT 'XXX,YY,XXX,YY' AS t FROM dual);

This gives the error "PL/SQL Beautifier could not parse text".

It works fine with the same code but the expression between WHEN and LIKE is framed in parentheses:

SQL:
SELECT CASE
               WHEN (listagg(DISTINCT t, ',') within GROUP(ORDER BY LENGTH(t) DESC)) LIKE 'XXX%' THEN
                                  'XXX'
         ELSE
          'YY'
                                   END my_result
  FROM (SELECT 'XXX,YY,XXX,YY' AS t FROM dual);
 
In 16.0.3 this bug still breaks development, my 2000 line package suddenly becomes 'dead'.

This simple piece of code causes ' PL/SQL Beautifier could not parse text':

SQL:
CREATE OR REPLACE PACKAGE BODY DPS.TTTTT AS
  FUNCTION xxxx RETURN NUMBER IS
  BEGIN
    FOR lcur IN (SELECT 1
                  FROM DUAL)
    LOOP
			NULL;
    END LOOP;
    RETURN 1;
  END;
END;
 
It works fine when I copy this text into a Program Window and beautify it. Can you try the same and confirm that it does not work for you? Can you also let me know your exact PL/SQL Developer version?
 
My version is 16.0.3.2156

Immediately after pasting, beautifier does nothing
Add a single new line above FUNCTION and DON'T select (highlight) anything and it fails.

If I select everything, it works.
 
Back
Top