Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

formatting PLSQL developer

Is there any shortcut for formatting the query in plsql developer? I want to format below query:

SELECT * FROM T1, T2 WHERE T1.ID = T2.ID

like:

select 
  *
from
  T1, T2
WHERE
  T1.ID = T2.ID
like image 357
mohammad_1m2 Avatar asked Jul 09 '26 02:07

mohammad_1m2


2 Answers

I am using version 12.0.7.

For this version, function name is not Edit / PL/SQL Beautifier

It is Tools / Source / PL/SQL Beautifier

It took some time for me to find it. I hope this help others.

enter image description here

enter image description here

like image 69
Berk Avatar answered Jul 11 '26 20:07

Berk


PL/SQL Developer does not have a default keyboard shortcut to launch the PL/SQL Beautifier but it is easy to configure one.

Open Tools --> Preferences, click on "Key Configuration", find the item "Edit / PL/SQL Beautifier", double-click on the empty space, click whatever keys you want to use for the shortcut, then click OK: enter image description here

You can also enable the PL/SQL Beautifier to run automatically: enter image description here

But be careful before you become too dependent on the code beautifier. They generally do not work well for Oracle SQL and PL/SQL. PL/SQL has a huge grammar and no code beautifier in existence can handle all types of code well. Also, dynamic code is much more important in PL/SQL than in other languages; beautifiers won't help with dynamic code so you'll likely need to manually format some code anyway.

like image 30
Jon Heller Avatar answered Jul 11 '26 21:07

Jon Heller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!