Semantic Validation

From DBArtisan
Jump to: navigation, search

Go Up to Automated Error Detection and Coding Aid Features

Semantic validation is an on-the-fly ISQL editor feature that verifies that object names are correctly specified. It ensures that the names of supported object types (columns, tables, synonyms, and views) present in a script match those for the connected datasource. Minimizing errors associated with typographical errors or references to obsolete object definitions, the names of supported object types are analyzed as you type, and an error condition is raised when it detects a name not present on the datasource.

at16c70e.jpg

A semantic error can indicate one of the following conditions:

  • The object name as specified in the script is not present on the database
  • The referenced object is hidden by a SQL filter
  • The schema information obtained to implement this feature is outdated. This can happen if other users or applications modify the schema during your ISQL editor session. For information on refreshing this information, see ISQL Options - Code Assist Tab.

When making use of this feature, always consider the following points

  • Semantic validation is only available for objects and object types configured to be included in the datasource index. For more information, see ISQL Options - Code Assist - Advanced Tab on page 214.
  • For SQL Server and Sybase ASE datasources, statements that contain temporary table names (that is, tables whose name begins with the # character) are ignored by the semantic validation feature.
  • Semantic errors in a statement are not displayed for a statement that currently has outstanding syntax errors. For more information, see Syntax Checking.
  • For SQL Server and Sybase ASE datasources, system table names (that is tables whose name begins with the # character) are ignored by the semantic validation feature.
  • While semantic errors can be flagged with an ERROR severity level, they can be more easily distinguished from syntax errors by setting a severity level of WARNING. Similarly, if you do not want semantic errors flagged, you can set the severity level to IGNORE. For details, see ISQL Options - Code Assist Tab.
  • Ensure that the ISQL Editor window is connected to a datasource. A datasource name is required in order to resolve an object name.
In the case of SQL Server and Sybase ASE, you must also select a database. The exception to this requirement is scripts that have a USE statement, specifying a database, appearing before any object name references.
Note: A line-by-line listing of individual semantic errors is also available in the ISQL editor’s Error pane. For more information, see Using the DDL Editor.