How to enable TOAD to check syntax ONLY where I'm typing?

We are working in a team and often edit the same .sql scripts.

The thing is - not everyone uses the same formatting style for their code and when I’m working with some code - I am allowed to write in my formatting style only where I make the changes in the code.

The problem is - TOAD automatically checks the syntax for the whole .sql file when I open it and changes UPPLER/LOWER-case for the keywords etc.

So the question:
Is there a way to disable checking the whole file, but keep the option when the syntax is checked where I type (right after I type a keyword or something)?
(Btw SQL Navigator does this by default).

Hi,

Please see the attached --and let me know if the option marked is what you are looking for.
Syntax.doc (90 KB)

You say syntax checking, but do you mean syntax highlighting? The syntax checking option that Anand pointed out will check or validate that the syntax you have entered is correct. It does not highlight or decorate the text in any way. There is a syntax highlighter/decorator that scans the code all of the time to stylize the code. This cannot be modified to apply only to a portion of a file.

The ideal solution may be too difficult to implement for you guys, but since everyone owns a portion of the script why not break out those portions into subscripts and have a master script that just calls all of the subscripts using the @filename.sql command?

A much easier workaround would be to enforce some coding standards where all code is formatted in much the same way regardless of who is responsible for it. It would make the code more readable as well when looking at others’ code.

Anand, no, that is not what I’m looking for. I have already checked it and it works fine.

And yes, Michael, I mean syntax highlighting :slight_smile:

I didn’t quite get the idea about the @filename.sql command but I assume that it wouldn’t be applicable in my case. Let’s say the sql file is a package body creation script or a database view creation script - then it would not make sense to divide the file in some way.

And there is no owner for any code - one day I can modify something, and the next day my co-worker will edit the same piece of code.

I switched from SQL Navigator to TOAD (because of the different file encoding support) and now I am collecting pros and cons for TOAD. And this appears to be one of the major problems in TOAD.

Coding standards are good - that is a matter of discipline and politics :slight_smile:

But sometimes the automatic syntax highlighter is too diligent.

A typical example:

DECLARE

l_precision fnd_currencies.precision%TYPE;

BEGIN

NULL;

END;

TOAD will transform the “precision” to UPPERCASE although it is a column name.

Maybe there is a way to configure this somehow?

(Without removing “PRECISION” from keywords)