SQLFLAGGER function [Miscellaneous]

Function

Returns the conformity of a given SQL statement to a specified standard.

Syntax

SQLFLAGGERsql-standard-stringsql-statement-string )

Parameters

sql-standard-string The standard level against which to test compliance. Possible values are the same as for the SQL_FLAGGER_ERROR_LEVEL database option:

sql-statement-string The SQL statement to check for conformance.

Examples

The following statement shows an example of the message that is returned when a disallowed extension is found:

SELECT SQLFLAGGER( 'SQL:2003/Package', 'SELECT top 1 dummy_col FROM sys.dummy ORDER BY dummy_col' );

This statement returns the message '0AW03 Disallowed language extension detected in syntax near 'top' on line 1'.

The following statement returns '00000' because it contains no disallowed extensions:

SELECT SQLFLAGGER( 'SQL:2003/Package', 'SELECT dummy_col FROM sys.dummy' );

Standards and compatibility

See also

“sa_ansi_standard_packages procedure”.

“SQL_FLAGGER_ERROR_LEVEL option [TSQL]” on page 489.

Chapter 5, “The SQL Preprocessor,” in the Utility Guide.

"Testing SQL compliance using the SQL Flagger"

in SQL Anywhere Server – SQL Usage.