Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Other SQL Dialects

Introduction to SQL Anywhere compliance Next Page

Testing SQL compliance using the SQL Flagger


In SQL Anywhere, the database server and the SQL preprocessor (sqlpp) can identify SQL statements that are vendor extensions, are non-compliant with respect to a specific ISO/ANSI SQL standard, or are not supported by UltraLite. This functionality is called the SQL Flagger, and is part of the SQL/1999 and SQL/2003 ISO/ANSI SQL standards. The SQL Flagger helps an application developer to identify SQL language constructs that violate a specified subset of the SQL language. The SQL Flagger can be used to ensure compliance with core features of a SQL standard, or compliance with a combination of core and optional features. The SQL Flagger can also be used when prototyping an UltraLite application with SQL Anywhere, to ensure that the SQL being used is supported by UltraLite.

The SQL Flagger is intended to provide static, compile-time checking of compliance, although both syntactic and semantic elements of a SQL statement are candidates for analysis by the SQL Flagger. An example of syntactic compliance is the lack of the optional INTO keyword in an INSERT statement (for example, INSERT Products VALUES( ...), which is a SQL Anywhere grammar extension to the SQL language. The use of an INSERT statement without the INTO keyword is flagged as a vendor extension because the ANSI SQL/2003 standard mandates the use of the INTO keyword. Note, however, that the INTO keyword is optional for UltraLite applications.

Implicit primary-foreign key joins between two tables are also flagged as a vendor extension. Use of the explicit KEY JOIN syntax is a syntactic vendor extension (and not supported by UltraLite). In addition, an implicit key join—that is, a join formed using the JOIN keyword, but without an accompanying ON clause—is also flagged as a vendor extension. For example, the following query specifies an implicit join condition between the Products and SalesOrderItems tables. This query is flagged by the SQL Flagger as a vendor extension.

SELECT * FROM Products JOIN SalesOrderItems;

SQL Flagger functionality is not dependent on the execution of a SQL statement; all flagging logic is done only as a static, compile-time process.

See also

Invoking the SQL Flagger
Standards and compatibility