Syntax highlighting is based on language definition files (*.lng). These files are automatically installed when you install or upgrade Teradata SQL Assistant and are located in c:\Program Files (x86)\Teradata\Client\16.20\bin\Data.
There is a corresponding language file for each database type. The file name is the SQLType attribute defined in the Vendors.config file for that database vendor, with .lng appended. (For ‘unknown’ database types, it uses the SQL Type reported by ODBC.) The appropriate language file is loaded when you connect to a database. If you are not connected to a database, Teradata SQL Assistant loads the previously used language file.
The first time Teradata SQL Assistant is started, it uses the Teradata language file.
The BASE language file contains the most commonly used definitions found in most SQL languages. This file is the default that is used if you connect to a database type that Teradata SQL Assistant does not recognize. If you plan to work with an unknown database frequently, you can make a copy of the BASE file and save it with an appropriate name to match this unknown database. You can then modify it to match the syntax and keywords used by that language. For more information, see Teradata.lng.
In addition to the vendor-specific files, there are ANSI language files that defines the ANSI 2008 SQL language. Selectto switch the syntax highlighting to ANSI mode. If you are connected to Teradata, the ANSI language file is used which supports ANSI-compatible Teradata syntax. Otherwise, the ANSI2008 file is used which is a full implementation of the ANSI 2008 specification without regard to whether the vendor supports those statements or keywords.
The language files generally define the complete language. A DBA can, however, modify the files to suit the site requirements.
- Adding a keyword that is not defined in the file
- Matching an optional database setting. For example, some databases have a switch to define the use of double quotes. If the language file says that these double quotes define “Quoted Names”, but you have the option set to allow them to act as string delimiters, you can modify the file accordingly.
- Preventing users from submitting certain types of statements. Teradata SQL Assistant declares a statement invalid if the primary keyword (generally the first keyword in the statement) is not found in the “MainKeywords”, “BeginTrans”, or “EndTrans” lists. For example, you can prevent users from executing a DROP statement by moving the DROP keyword from the “MainKeywords” list to the “Keywords” list.