Toad World® Forums

Formatter bug


#1

It seems the query attached will not format properly, despite being valid and runnable

When I try to format (CTRL-R) I get the message in the second file attached (too long to show here).

DK
Derive_email_bad_emailto.ppt (101 KB)


#2

Hi Dwayne,

Unfortunately, we have no plan to make any changes to the Formatter component for 6.0. It was actually developed by a team in Belgium. It was a pretty old component so undoubtedly it wouldn’t be able to pick up some of the code. But for later version of NAV, this component will be updated with a newer version developed by the same team.

Gwen


#3

After I replied to you, Andrew wrote me an email suggesting that the Code may be incorrect.
Steps to verify (use SQL Nav)

  1. copy SQL to Editor,

  2. press CTRL+R to format SQL,

  3. in Output you will get exact spot where syntax is wrong:

10:52:04 AM UNRECOGNIZED CONSTRUCT OR SYNTAX ERROR at LINE 44, COL 188, OFFSET 6501 :

  1. place cursor on this spot and user CTRL+] (to find matching bracket), this will get you to LINE 41, COL 321 (this info is on status bar),

  2. copy and paste a selection from LINE 41, COL 321 to LINE 44, COL 188 into a new Tab in Editor

  3. press CTRL+R,

  4. in Output, you will find information following information:

    • location of syntax error,

    • copy of the code you have attempted to format, and

    • this info telling user what to do to fix the problem:

10:52:04 AM ------------------------------------------------^–

10:52:04 AM (S160) Expecting: CROSS FULL INNER JOIN LEFT NATURAL RIGHT

10:52:04 AM ---------------------------------------------------------------

You can look at this issue from another angle:

  1. go back to Editor the point (5) in above testing and look closely at the SQL

  2. NOTE at the end of SQL a word se: see attachment for explanation

Message was edited by: Gwen
untitled.bmp


#4

While I agree the SQL is ugly indeed, this is exactly why I like using the format feature (to try to make some sense of someone elses terrible SQL habits).

It does indeed execute as-is though, which is why I believed that it should format. I thought (not at the office now so I can’t check) that it formatted OK in nav 5.x, but I’ll check that on Monday.

DK