Toad Formatter Vertical Alignment - Toad for Oracle Forum - Toad for Oracle - Toad World
This question is answered

Toad Formatter Vertical Alignment

Follow / 27 Jun 2016 at 6:48pm

Hello,

Is there a way to achieve vertical alignment in the code using toad formatter? Following are the questions.

Is there a way to vertically align = operator for multiple AND lines?

Current Format

SELECT *
  FROM table1 a, table2 b
 WHERE a.col1 = b.col1
   AND a.col999 = b.col999
   AND a.col999999 = b.col999999

Desired Format

SELECT *
  FROM table1 a, table2 b
 WHERE a.col1      = b.col1
   AND a.col999    = b.col999
   AND a.col999999 = b.col999999

Vertical Alignment for Tabular list?

Current Format

INSERT INTO sales(prod_id,cust_id,time_id,
                  amount,nextcolumn,nextcolumn1)
VALUES ( product_id,customer_id,weekly_start_date,
         sales_sun,nextcolumn,nextcolumn1);

 

Desired Format (Something like this)

INSERT INTO sales(prod_id ,cust_id    ,time_id,
                  amount  ,nextcolumn ,nextcolumn1)
VALUES ( product_id ,customer_id  ,weekly_start_date,
         sales_sun  ,nextcolumn   ,nextcolumn1);

 

Can we vertically align THEN values of Case statement ?

Current Format

SELECT CASE
         WHEN a.col5 = b.col5 THEN 'COL5'
         WHEN a.col55555555555555 = b.col5 THEN 'COL55555'
         WHEN a.col555555 = b.col5 THEN 'COL555555'
         WHEN a.col55555555 = b.col5 THEN 'COL5555555'
       END AS VAL
FROM   table1 a, table2 b
WHERE  a.col1 = b.col1
AND    a.col999 = b.col999
AND    a.col999999 = b.col999999

Desired Format

SELECT CASE
         WHEN a.col5              = b.col5 THEN 'COL5'
         WHEN a.col55555555555555 = b.col5 THEN 'COL55555'
         WHEN a.col555555         = b.col5 THEN 'COL555555'
         WHEN a.col55555555       = b.col5 THEN 'COL5555555'
       END AS VAL
FROM   table1 a, table2 b
WHERE  a.col1      = b.col1
AND    a.col999    = b.col999
AND    a.col999999 = b.col999999

Help is appreciated.

Thanks,

G.

Replies

All Replies
  • Verified Answer
    Follow / 27 Jun 2016 at 8:05pm

    Currently there are no options to enable all this.

    The '=' alignment is a request already in our queue (QP-1012). We'll try to process it asap.

    Tabular List alignment is a new enhancement request (QP-1701).

    The CASE / THEN alignment is also a great suggestion (QP-1702).

    Thanks,
    Andre