Formatter puts the column alias for the CASE statement onto a separate lines after the CASE statement. They are wrapping to the line below for each column.
The issue is caused when there is a CASE statement in the select. Because the Toad Formatter puts the column alias for the CASE statement onto a separate line after the CASE statement, then all the other column aliases are aligning with that CASE statement alias.
Even if the parameter or option setting under [Alignment | DML | "Align column aliases"] is un-checked, it still keeps aligning them (which seems there may be something about that checkbox that is not working properly in version 12.11).
Here are some sample code which shows the Formatter problem in v12.11. This issue does not happen on v12.10.
TFO 12.11:
/* Formatted on 8/4/2017 12:18:04 PM (QP5 v5.313) */
SELECT 'First field'
AS field_1,
'Second field'
AS field_2,
'Third field'
AS field_3,
CASE
WHEN SYSDATE > '31-JAN-2017' THEN 'It is 2017'
ELSE 'It is 2016'
END
AS case_test
FROM DUAL
TFO 12.10:
/* Formatted on 8/4/2017 12:17:47 PM (QP5 v5.300) */
SELECT 'First field' AS field_1,
'Second field' AS field_2,
'Third field' AS field_3,
CASE
WHEN SYSDATE > '31-JAN-2017' THEN 'It is 2017'
ELSE 'It is 2016'
END
AS case_test
FROM DUAL
*Please note that this issue may also occur in a SELECT statement with no CASE expression when a line having an alias contains more than 70 characters.
You need to be signed in and under a current maintenance contract to view premium knowledge articles.
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center