Format Code [message #602319] |
Tue, 03 December 2013 03:23 |
|
rc3d
Messages: 213 Registered: September 2013 Location: Baden-Württemberg
|
Senior Member |
|
|
Hi
I use a lot the "Format Code" feature in Toad. See screenshot.
Now I see that pro Oracle guys format the code other:
Select rowid
, xxx
, xxxx
, xxxxx
, xxxxxx
, xxxxxxx
FROM DUAL
Toad "Format Code" places the commas end of column name.
Is there a way to change "Format code"?
|
|
|
|
Re: Format Code [message #602324 is a reply to message #602319] |
Tue, 03 December 2013 03:53 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
Currently I use PL/SQL Developer for application development. However, complete formatting is done in Ultra-edit. By the way in TOAD or any other 3rd party tool you should have some settings file which can be used to keep the formatting and indentation per your development standards. However, at macro level I don't think it will be possible. So, it has to be done manually. TOAD doesn't know precisely your coding/development standards.
|
|
|
Re: Format Code [message #602348 is a reply to message #602319] |
Tue, 03 December 2013 04:44 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
rc3dI see that pro Oracle guys
They do? Then I'm far from being a pro as I don't format code in that manner (which is OK, no problem). However, what substantial advantage do you see in
select col1
, col2
from table over
select col1,
col2
from table and what makes the first one "pro" formatting, while the other one is ... what, "amateur"?
I know one difference: it is easier to comment certain columns in the first example - you have to put "--" in front of the whole line, you don't have to pay attention to commas leading column names:
select col1
-- , col2 --> easy!
from table
vs.
select col1, --> you have to remove comma
-- col2
from table
|
|
|
Re: Format Code [message #602351 is a reply to message #602348] |
Tue, 03 December 2013 05:25 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Littlefoot wrote on Tue, 03 December 2013 10:44rc3dI see that pro Oracle guys
I know one difference: it is easier to comment certain columns in the first example - you have to put "--" in front of the whole line, you don't have to pay attention to commas leading column names:
select col1
-- , col2 --> easy!
from table
vs.
select col1, --> you have to remove comma
-- col2
from table
It's only easier for commenting the last column:
select --col1, --> easy!
col2
from table
select --col1 --> you have to remove comma
, col2
form table
Which is why I never bother. As far as I'm concerned the benefit is illusionary and it's harder on the eyes.
If you really want this then I'm sure TOAD has settings for where the commas go. PL/SQL Developer certainly does.
|
|
|
|
Re: Format Code [message #602358 is a reply to message #602357] |
Tue, 03 December 2013 06:11 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
No - it's only easier for the last one. Columns in the middle work just the same with the comma on either side.
|
|
|
|
Re: Format Code [message #602366 is a reply to message #602360] |
Tue, 03 December 2013 08:44 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
rc3d wrote on Tue, 03 December 2013 18:17Lalit Kumar B suggested I should switch to SQL Developer from Oracle?
I said I use PL/SQL Developer. It is a 3rd party tool. It has all those options which you might be looking for. I keep it in sync with ultraedit for format and indent. I have an oracle.uew file associated with ultraedit so that it understands the keywords etc. of my PL/SQL code. We do it because that's what is the application development standards being followed in my project.
|
|
|