TOAD doesn't like blank lines in SQL statements

Using 12.9.0.49

When I have a SQL statement that has blank lines in it, TOAD syntax engine gives me an error, as if it believes that the SQL statement ended on the last non-blank line. This is not behavior that 12.7 or 12.8 has. Removing the blank lines makes TOAD happy again.

Due to popular demand a new option has been added for 12.9 and the default is enabled. Uncheck the “Treat blank line as statement terminator” option on the Execute/Compile page in Options. When checked it allows for lazy mode where you can omit statement terminators and have gibberish upstream of your SQL that will not affect the statement you’re working on. If you properly terminate your statements and generally try to follow rules of syntax give yourself a big pat on the back and uncheck the new option.

Thanks,

Michael

Really doubt it was popular demand. Let’s take a vote! Should toad constantly point out non-errors?

It was done less so for execution and showing non-errors and more so for other features like Code Insight and Explain Plan. A lot of folks still cling to Ctrl+Enter to execute code. That logic uses blank lines as statement terminators. However, most every other feature in Editor relies heavily on the parser. Code Insight, Explain Plan, etc. would not function unless the entire editor text was valid code including proper statement termination. So, we provide a new option that forces the parser to abide by legacy rules where blank line is terminator.

A common use case for blank line termination would be a select with union or subqueries. If you want to test an individual piece of a larger statement you can select the text you want to test and execute. With this option you can just place a blank line to isolate the piece. Blank line is an easier option in some cases. There have been countless examples over the years demonstrating its usefulness both here and through official support channels.

You’re asking the wrong question. Ask instead who wants to be required to use proper syntax throughout their entire editor text to ensure Code Insight, Explain Plan, and other features function? I think you’ll get a different set of responses.

You at least have a workaround, turn off the option. Prior to the option the other users who have used Toad for 10+ years and were used to old way of doing things have been left out in the cold. For the record, I’m in your camp. :wink:

Michael

Every company I’ve ever worked at or for, the rules of deploying code patches or new releases etc, stated that SQL*Plus was to be considered the only method of applying those scripts and or statements.

I’ve lost count of the number of “tested” scripts that worked fine in test and development environments but failed miserably when passing through the drployments processes - purely because they had been developed and tested in Toad, or the “other” SQL tool from Oracle, and which had blank lines scattered willy nilly throughout.

SQL*Plus failed at these blank lines. The deployments also failed.

So, Toad flagging errors in a manner similar to SQL*Plus is, in my humble opinion, a good thing.

Cheers,

Norm. [TeamT ]

Sent from my Android device with K-9 Mail. Please excuse my brevity.

I agree. Proper syntax should be the expected norm. To ease some confusion the default value of this option has been changed to disabled for 12.11. For those who wish to continue using the editor in a scratch pad fashion they can enable it.