Returns the conformity of a given SQL statement to a specified standard.
Parameter |
Description |
---|---|
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. |
LONG VARCHAR
The result data type is a LONG VARCHAR. If you use SQLFLAGGER in a SELECT INTO statement, you must have an Unstructured Data Analytics Option license or use CAST and set SQLFLAGGER to the correct data type and size.
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' );