Toad World® Forums

Alignment of column aliases


#1

All,

I’m on Toad 12.12.0.7.

I noticed the new(?) formatter option to align column aliases.
Thanks for adding this feature!

However, it seems not to be aware of the optional AS keyword:

select w1.namenamename as nam1
, w2.name nam2

I think the missing AS on the second line should be noticed and either

  1. the omitted keyword AS is inserted, or
  2. the aliases are aligned and the missing AS keyword is replaced by two blanks

I do no care much whether or not missing AS keywords are forced in or left absent,
but I do like the vertical alignment of the proper aliases.

Kind regards,
Abe Kornelis


#2

Where can you change these setting? I don’t see Column Alignment options in the Toad Options dialog under the formater.

Thanks


#3

Scott,

Alignments --> DML Statements --> Alias Alignment (at bottom of page, need to scroll down)

Abe


#4

thanks that works fine until I have a sub-select in my field list, then all the aliases go to a separate line. I don’t mind if the alias on the sub-select goes to the next line, but I don’t want the others to do it too. Is there a setting i’m missing.

for example:

this works like I’d like:

SELECT a aa,
b bb,
c cc,
d dd
FROM table1 t1, table2 t2
WHERE t1.id = t2.id

but as soon as I add the sub-select it goes “bad”.

SELECT a
aa,
b
bb,
c
cc,
d
dd,
(SELECT description
FROM table3 t3
WHERE t3.id = t1.d)
ddd
FROM table1 t1, table2 t2
WHERE t1.id = t2.id

Thanks,

Scott


#5

Scott,

There’s no such option. However, it seems Beta 13.0 is doing better here.
But I’ve only just upgraded to Beta 13.0, so I haven’t seen enough of it yet to be sure.

Kind regards,
Abe


#6

Were you ever able to resolve this issue?