With Toad for Oracle 16.2.98.1741 when I format my code in Editor with Toad's Formatter, I can't get "ORDER BY" into new line if subquery is in brackets and UNION is present (see example queries below), like it is with Toad for Oracle 16.0.90.1509;
I tried to change a lot of Formatter Options in 16.2, however without success.
-- formatted with 16.0 - query with UNION - ORDER BY in new line
/* Formatted on 12/12/2022 13:34:18 (QP5 v5.381) */
BEGIN
FOR r_row IN (SELECT 'a' data_d, 0 sort
FROM dual
WHERE 1 = 1
UNION
SELECT 'b' data_d, 1 sort
FROM dual
WHERE 2 = 2
ORDER BY sort)
LOOP
NULL;
END LOOP;
RETURN NULL;
EXCEPTION
WHEN OTHERS
THEN
RETURN NULL;
END;
-- formatted with 16.2 - query with UNION - ORDER BY not in new line
/* Formatted on 12/12/2022 13:00:05 (QP5 v5.391) */
BEGIN
FOR r_row IN (SELECT 'a' data_d, 0 sort
FROM dual
WHERE 1 = 1
UNION
SELECT 'b' data_d, 1 sort
FROM dual
WHERE 2 = 2 ORDER BY sort)
LOOP
NULL;
END LOOP;
RETURN NULL;
EXCEPTION
WHEN OTHERS
THEN
RETURN NULL;
END;
-- formatted with 16.2 - query without UNION - ORDER BY in new line
/* Formatted on 12/12/2022 12:58:43 (QP5 v5.391) */
BEGIN
FOR r_row IN ( SELECT 'b' data_d, 1 sort
FROM dual
WHERE 2 = 2
ORDER BY sort)
LOOP
NULL;
END LOOP;
RETURN NULL;
EXCEPTION
WHEN OTHERS
THEN
RETURN NULL;
END;