syntax check

how do I check my sql syntax

Syntax Highlighting

The Editor supports flexible syntax highlighting. The highlighting is language-specific, and is configurable in the Language Management area of the Toad Options.

The list of reserved words used in each language is also customizable. If during a Toad session you have used any window or function that retrieves the table names for the active Oracle session, table names will be colored as well.

Syntax highlighting is based on your selection of languages. You can do this from either the options window, or from the Editor itself.

To select a language for highlighting

» Do one of the following:

From the Toad Options | Editor - Behavior page, in the Language Management area, select the language you want to apply and then click OK.

In the editor, right-click and select Language. From the menu provided, select the language you want to use.

Syntax Highlighting Table names, Views and Procedures

Toad can syntax highlight the table names, views and procedures in the current schema.

If the highlight table names (or views, or procedures) option is selected Toad will load and highlight these objects from your schema automatically. If it is not selected when you make a connection, but you turn it on while you are working, names will be highlighted as soon as you load them (by opening the Object Palette, or pressing CTRL+. or so on). If not selected, they will not be highlighted even when the object palette is loaded, loaded in the Schema Browser, and so on.

To highlight table names

» Select View | Toad Options | Editor | Display, and then select Highlight Table names in the Syntax Highlighting area.

To customize table names colors

Select View | Toad Options | Editor | Behavior, and then select the language you want to use in the Language Management area.

Click Syntax Highlighting and in the Styles list select Toad_UserTables.

Change the styles as described in the Highlighting tab topic. See Highlighting Tab for more information.

Click OK.

Syntax Highlighting SYS View Names

Toad can also syntax highlight SYS View names (for example, ALL_TABLES).

To initially populate SYS view names

» Using either the SYS schema or a schema with the DBA role, open the Schema Browser window to the Views tab, and if necessary select SYS from the username drop-down list.

Toad queries all SYS views, and caches the list in Toad for Oracle\User Files\DATABASE_ALIAS\SYSVIEW.TXT.

If you want to reload the list, simply delete the appropriate SYSVIEWS.TXT file and repeat the above steps. Be aware that different databases have different lists of SYS views, e.g., Oracle 8i, Personal Oracle, and so on.

To customize table names colors

Select View | Toad Options | Editor | Behavior, and then select the language you want to use in the Language Management area.

Click Syntax Highlighting and scroll down in the Styles list to Toad_SYSViews.

Change the styles as described in the Highlighting tab topic. See Highlighting Tab for more information.

Click OK.

Parser Scripts

The primary configuration for syntax parsing and highlighting in Toad comes from a parser script file that is loaded at runtime. This is the lexer.lib file, and is edited when you use the Language Management options. See Language Management Overview for more information.

You can modify the list of reserved words.

To modify reserved/keywords

From Language Management | Rules tab | Keywords, click the Conditions tab.

Modify keywords in the tokens panel. You can delete words, add new words, make words case sensitive, and so on.

You may want to add too that they should go to the reserved words rule (check that name, not sure that is what it is called exactly) and go to the conditions tab to modify the list of words

Removing Reserved and Keywords

If you want to add or remove Oracle SQL Reserved words, PL/SQL Reserved words, or Oracle keywords from the lists that are syntax highlighted, it can be done from the Language Management | Rules tab. Highlighting options may be changed from the Language Management | Highlighting tab.

Language Types

Language types are defined in the Toad Options | Editor - Behavior | Language Management area. You can create a new language by cloning one of the provided ones, or manually. The general tab specifies which file extensions are used with which language.