Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PL/SQL beautifier vs TOAD formatter

Igor S.Sep 13 2012 — edited Sep 13 2012
Hello people,

Recently I started working with TOAD IDE (used to work with PL/SQL Developer). So far I got used to it except
one small problem. I cant match TOAD formatter to PL/SQL Developer beautifier. Example how I write my sql queries and
how PL/SQL Dev formats them:
select column_1
      ,column_2
      ,column_3
  from table_1 tab1
  join table_2 tab2 on (tab1.id = tab2.tab1_id)
  join tabke_3 tab3 on (tab2.id = tab3.tab2_id)
 where 1=1
   and tab1.column1 = 'test'
   and tab2.coulmn2 = 1234
 order by tab3.column3; 
 
And in TOAD I keep getting this:
  select column_1, column_2, column_3
    from table_1 tab1
         join table_2 tab2
           on (tab1.id = tab2.tab1_id)
         join tabke_3 tab3
           on (tab2.id = tab3.tab2_id)
   where 1 = 1 and tab1.column1 = 'test' and tab2.coulmn2 = 1234
order by tab3.column3;
I managed to do some tweaks. For example the "where" and "and" clause will be in a new line and aligned right, but
TOAD formatter then also changes my PL/SQL code so my "if" statments look like this (which I dont want):

if (1 = 1
and 2 = 2
and 3 = 3) then
null;
end if;

So, Is there a way to force TOAD to align joins and understand diference between SQL "and" and PL/SQL "and"? or if it is not possible
is there any plugin or external program that is fully customizable (tried some plugins for notepad++ and couple of web services but none
matched what I am looking for).

Best regards,
Igor

Edited by: Sveprisutni on 2012.09.13 03:03
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 11 2012
Added on Sep 13 2012
9 comments
9,594 views