I added a bit of code to align embedded single block-style comments /*....*/
in between the code tokens. It will be on by default, but there is an option to turn it off. (ref QP-3916)
Here are a few example (snippets), each time with option OFF and ON:
-- OFF
g_datatypes_by_name (
'Variant') /* Family placeholder */
:=
'{0F2EC0D8-4A1B-41E7-956D-7BB186E6EA16}';
-- ON
g_datatypes_by_name (
'Variant') /* Family placeholder */ :=
'{0F2EC0D8-4A1B-41E7-956D-7BB186E6EA16}';
-- OFF
TYPE type_attributes_aat
IS TABLE OF all_type_attrs%ROWTYPE
INDEX BY PLS_INTEGER /* Order of attributes */
;
-- ON
TYPE type_attributes_aat
IS TABLE OF all_type_attrs%ROWTYPE
INDEX BY PLS_INTEGER /* Order of attributes */;
-- OFF
CREATE VIEW v
(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
)
AS
SELECT x /*Igor: to avoid a syntax error , y, z*/
FROM t;
-- ON
CREATE VIEW v
(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
)
AS
SELECT x /*Igor: to avoid a syntax error , y, z*/ FROM t;
-- OFF
BEGIN
p4 (a, /*embedded*/
b);
END;
/
-- ON
BEGIN
p4 (a, /*embedded*/ b);
END;
/
-- OFF
DECLARE
a VARCHAR2 (7) := 'too long';
b VARCHAR2 (7) := 'too long';
c /*2804*/
CHAR (7) := 'too long';
d /*2804*/
CHARACTER (7) := 'too long';
e VARCHAR2 (8) := 'too long';
f VARCHAR2 (7) := 'too' || ' long';
g VARCHAR2 (8) := 'too' || CHR (30) || CHR (31) || 'long';
BEGIN
-- ON
DECLARE
a VARCHAR2 (7) := 'too long';
b VARCHAR2 (7) := 'too long';
c /*2804*/ CHAR (7) := 'too long';
d /*2804*/ CHARACTER (7) := 'too long';
e VARCHAR2 (8) := 'too long';
f VARCHAR2 (7) := 'too' || ' long';
g VARCHAR2 (8) := 'too' || CHR (30) || CHR (31) || 'long';
BEGIN
-- OFF
CASE 'S'
WHEN 'L'
THEN
SELECT CASE WHEN 1 > 0 THEN 'S' ELSE 'L' /*endcase1 */
END,
-- ,case '1' when 'D' then 'D' else 'M' end
CASE WHEN 1 > 0 THEN 'S' ELSE 'L' /*endcase2*/
END
INTO v_sit_id
FROM LOCATIONS_V;
/*endcase3*/
END CASE;
-- ON
CASE 'S'
WHEN 'L'
THEN
SELECT CASE WHEN 1 > 0 THEN 'S' ELSE 'L' /*endcase1 */ END,
-- ,case '1' when 'D' then 'D' else 'M' end
CASE WHEN 1 > 0 THEN 'S' ELSE 'L' /*endcase2*/ END
INTO v_sit_id
FROM LOCATIONS_V;
/*endcase3*/
END CASE;
-- OFF
VARRAY email_addrs
SUBSTITUTABLE AT ALL LEVELS
STORE AS LOB
lnt
(PARTITION partition1 LOB (a) STORE AS /* LOB */
(CACHE));
-- ON
VARRAY email_addrs
SUBSTITUTABLE AT ALL LEVELS
STORE AS LOB
lnt
(PARTITION partition1 LOB (a) STORE AS /* LOB */ (CACHE));
-- OFF
MEMBER FUNCTION open_account (
self IN OUT o_account,
ssn_num IN VARCHAR2,
accounttype IN VARCHAR2 /*test comments*/
,
amount IN NUMBER,
name /* comments */
IN VARCHAR2,
bday IN DATE,
gender IN CHAR,
addr o_address)
RETURN INTEGER
AS
-- ON
MEMBER FUNCTION open_account (
self IN OUT o_account,
ssn_num IN VARCHAR2,
accounttype IN VARCHAR2 /*test comments*/,
amount IN NUMBER,
name /* comments */ IN VARCHAR2,
bday IN DATE,
gender IN CHAR,
addr o_address)
RETURN INTEGER
AS
-- OFF
CREATE TABLE xml_oidindex2 OF XMLTYPE
OBJECT ID /*= IDENTIFIER; is undocumented*/
IS SYSTEM GENERATED
OIDINDEX ind2 (TABLESPACE Users STORAGE (MAXSIZE UNLIMITED));
-- ON
CREATE TABLE xml_oidindex2 OF XMLTYPE
OBJECT ID /*= IDENTIFIER; is undocumented*/ IS SYSTEM GENERATED
OIDINDEX ind2 (TABLESPACE Users STORAGE (MAXSIZE UNLIMITED));
-- OFF
SELECT AVG (x) OVER (ORDER /*SIBLINGS*/
BY z RANGE INTERVAL '30.12345' SECOND (2, 4) PRECEDING) FROM t;
-- ON
SELECT AVG (x) OVER (ORDER /*SIBLINGS*/ BY z RANGE INTERVAL '30.12345' SECOND (2, 4) PRECEDING) FROM t;
Will show up in component QP5.dll version 5.382.
Thoughts welcome.
Andre