Welcome to the SQL Navigator Community
Advanced Search - Help - Search Toad World
Welcome, Guest
Login Login / Register
Help
NEW? Get Plugged In

Forums » Join Discussions About... » SQL Navigator BETA

Thread: Formatting Issue


Permlink Replies: 6 - Pages: 1 - Last Post: Nov 12, 2009 12:35 AM by: vliu
joethejet

Posts: 236
Registered: 1/29/07
Formatting Issue
Posted: Nov 6, 2009 11:32 AM
  Click to reply to this thread Reply

When you format a select statement with an order or group by, it always indents the "select" keyword. VERY annoying.



vliu

Posts: 91
Registered: 9/9/07
Re: Formatting Issue
Posted: Nov 8, 2009 4:48 PM   in response to: joethejet
  Click to reply to this thread Reply

Hi Joe,

The SELECT indents because it has to move right a little bit to align with the ORDER BY from right hand side. There's an option to select right aligned or left aligned for the DML statements. By default it's right aligned so you find that the SELECT always indents when there's an order by or group by. You can change the option to left aligned and it may help. See attached images.

Thanks,
Vincent


joethejet

Posts: 236
Registered: 1/29/07
Re: Formatting Issue
Posted: Nov 9, 2009 9:54 AM   in response to: vliu
  Click to reply to this thread Reply

Well, that's just silly. I guess I didn't realize just how lousy the two options are. either you get no indentation at all or, you get right justified indentation. Oh, and that doesn't always work as you describe it unless "rollup" isn't considered a keyword because it doesn't right justify to the rollup.

OK, then my comment is now. Please add another option that will indent the keywords under the "primary" command to a set column.

In actuality, the whole formatter needs some help with the options. I don't think certain commands (e.g. case) are even supported correctly.

Thanks,

Jet



vliu

Posts: 91
Registered: 9/9/07
Re: Formatting Issue
Posted: Nov 10, 2009 5:32 PM   in response to: joethejet
  Click to reply to this thread Reply

Hi Jet,

I have forwarded your comment to the formatter team. We're working on this and will keep you posted.

Thanks,
Vincent


vliu

Posts: 91
Registered: 9/9/07
Re: Formatting Issue
Posted: Nov 10, 2009 6:21 PM   in response to: joethejet
  Click to reply to this thread Reply

Hi Jet,

First, the "rollup" is not considered to be aligned because it's a function rather than a command. The option says "Keywords RIGHT aligned". The "keywords" is kind of misleading I think we may change it.

By "add another option that will indent the keywords under the "primary" command to a set column", do you mean you want to get the result like below?

SELECT      *
      FROM  DUAL
     WHERE  dummy <> ''
  ORDER BY  dummy;
or 
SELECT      *
  FROM      DUAL
  WHERE     dummy <> ''
  ORDER BY  dummy;


We want to know your exact requirement so that we can consider the implementation.

thanks,
Vincent




joethejet

Posts: 236
Registered: 1/29/07
Re: Formatting Issue
Posted: Nov 11, 2009 9:36 AM   in response to: vliu
  Click to reply to this thread Reply


Either of these options would be preferable and maybe that's what you should change the option to mean.

I think the critical part of this is that it's easy to identify the statement that's being run. So, having "Select" stand out with the indenting is good. Either ordering of the rest of the key words is fine. I would probably use the left justified one (the second one).

Thanks,

Jet
p.s. if you guys are serious about improving the formatter, let me know and I'll give you more feedback on how it should work.





vliu

Posts: 91
Registered: 9/9/07
Re: Formatting Issue
Posted: Nov 12, 2009 12:35 AM   in response to: joethejet
  Click to reply to this thread Reply

Hi Jet,

Thanks a lot for your comments. We will intrduce a new option to indent the other commands after "SELECT" and keep "SELECT" staying left. This option accepts integer value to set how many columns will the other commands indent. I will let you know once we include this into SQL Nav :).

Yes we surely want to make our formatter better and better. We really appreciate your feedbacks. Please feel free to bring them up anytime you want to.

Thanks,
Vincent


Legend
Guru: 2001 + pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums