topic: At least two issues in PL/SQL beautifier in PL/SQL Developer v7.0.3

There are at least two issues in PL/SQL beautifier. See below.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Before and after PL/SQL beautifier was invoked... (PL/SQL Developer v7.0.3.1123)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Code:
1)
++++++++++
+ BEFORE +
++++++++++
CREATE OR REPLACE PROCEDURE abc(v_command_type IN VARCHAR2,
                                v_table_name   IN VARCHAR2) IS

BEGIN

   -- set global table name
   set_table_name(v_table_name);

   $IF trace_level > 3 $THEN
   /*  -- comment lines inside / * and /  will increase indentation everytime when PL/SQL beautifier is invoked
   -- test comment line
   */

   trace('command type:' || v_command_type);

   $END

END;

+++++++++
+ AFTER +
+++++++++
CREATE OR REPLACE PROCEDURE abc(v_command_type IN VARCHAR2,
                                v_table_name   IN VARCHAR2) IS

BEGIN

   -- set global table name
   set_table_name(v_table_name);

   $IF trace_level > 3 $THEN
   /*  -- comment lines inside / * and /  will increase indentation everytime when PL/SQL beautifier is invoked
         -- test comment line
         */

   trace('command type:' || v_command_type);

   $END

   END;

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2)
++++++++++
+ BEFORE +
++++++++++
CREATE OR REPLACE PROCEDURE abc(v_command_type IN VARCHAR2,
                                v_table_name   IN VARCHAR2) IS

BEGIN

   -- $IF followed by IF with no line in between will merge into one line and screw up the format
   -- of following statements when PL/SQL beautifier is invoked
   $IF dw_installed = 1 $THEN
   IF v_command_type IN ('INSERT', 'UPDATE')
   THEN
      --  comments ...
      v_tag := v_command_type;
   END IF;

   $END

END;

+++++++++
+ AFTER +
+++++++++
CREATE OR REPLACE PROCEDURE abc(v_command_type IN VARCHAR2,
                                v_table_name   IN VARCHAR2) IS

BEGIN

   -- $IF followed by IF with no line in between will merge into one line and screw up the format
   -- of following statements when PL/SQL beautifier is invoked
   $IF dw_installed = 1 $THEN IF v_command_type IN ('INSERT', 'UPDATE') THEN
   --  comments ...
   v_tag := v_command_type;
END IF;

$END

END;

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3)
++++++++++
+ BEFORE +
++++++++++
CREATE OR REPLACE PROCEDURE abc(v_command_type IN VARCHAR2,
                                v_table_name   IN VARCHAR2) IS

BEGIN

   $IF dw_installed = 0 $THEN

   -- comments...
   v_tag := 'DELETE';

   -- $END followed by EXCEPTION/BEGIN/IF with no line in between will merge into one line and screw up the format
   -- of following statements when PL/SQL beautifier is invoked
   $END

EXCEPTION
   -- comments...
   WHEN OTHERS THEN
      BEGIN

         trace('ERROR');

         RAISE;

      END;

END;

+++++++++
+ AFTER +
+++++++++
CREATE OR REPLACE PROCEDURE abc(v_command_type IN VARCHAR2,
                                v_table_name   IN VARCHAR2) IS

BEGIN

   $IF dw_installed = 0 $THEN

   -- comments...
   v_tag := 'DELETE';

   -- $END followed by EXCEPTION/BEGIN/IF with no line in between will merge into one line and screw up the format
   -- of following statements when PL/SQL beautifier is invoked
   $END

   EXCEPTION
   -- comments...
   WHEN OTHERS THEN BEGIN

   trace('ERROR');

   RAISE;

END;

END;
 
Back
Top