Toad World® Forums

Formatting Select Statements


#1

thanks for adding the “Hanging ident” One thing that would be nice as an option: Allow the user to put the first table/column/where clause on the same line as the keyword.

So, right now it looks like this:

select
col1
col2
from
table
where
clause1 and
clause2

Would like option to display like:
select col1
col2
from table
where clause1 and
clause2


#2

Hi Jet,

You got the table/column/clause staying on new line because you selected the third option for DML Statement LHS Alignment. You should select the second one, “Keywords LEFT aligned”, then with a value for the Hanging indent. See attached image.

And here’s the result I got:

/* Formatted on 17-Dec-2009 10:10:23 (QP5 v5.141) */
SELECT col1,
col2,
col_longlooooooooooooooooooooooooooooooooooooooooooooooooong
FROM table1 a
WHERE col1 > 0 AND
col_longlooooooooooooooooooooooooooooooooooooooooooooooooong > 1
DML_alignment.jpeg


#3

Gotcha, I thought that the hanging ident was only good for the third option. I wonder if it should be moved to the left on the options screen? I don’t think it’s readily apparent that it’s available for all the options, but maybe that’s how it works in other places too.

thanks!

Jet