An escape clause is a syntactic mechanism for using vendor-specific SQL extensions in a standardized SQL application.
Using escape clauses, an application can request a vendor-specific function in a way that does not keep it from compiling or executing in an environment that does not support the function.
However, if the application depends on the vendor-specific SQL functions, it will be restricted in its portability, since a standard-compliant SQL implementation need not provide the vendor-specific SQL extensions that are used.
Escape clauses are allowed in SQL statements submitted using dynamic SQL, see the Mimer SQL Programmer's Manual, Dynamic SQL, and in interactive SQL.
Escape Clause Syntax
Syntax for the escape clause:
ExampleSELECT name, salary FROM employee WHERE company = 'Important Stuff Organization' --(* VENDOR(MIMER), PRODUCT(MIMER)
AND TAIL(manager,4) <> 'Boss' *)-- AND salary > 20000;
Note: Mimer SQL strictly follows the defined standards and has only a few vendor-specific extensions so vendor-specific statements in Mimer SQL are usually quite simple.
The escape clause allows coherent interpretation of different SQL dialects.
The extended-SQL-text contains all, or part of, a valid SQL statement in the SQL dialect that the escape clause specifies.
The text must not contain an SQL-prefix (EXEC SQL), an SQL-terminator (;), a dynamic parameter or a host variable.
There are two forms for the escape clause: ISO-based escape clauses and vendor-based escape clauses.
ISO-based Escape Clauses
This form of the escape clause introduces SQL syntax that is supported by a specified dialect of the International Standard.
Through this escape clause, the database can reject the clause if it does not support the specified SQL dialect.
ISO-year specifies the publication year of the standard, e.g. "1989" for the SQL89 standard.
ISO-conformance specifies the conformance level:
- CONFORMANCE(1) for Entry level conformance
- CONFORMANCE(2) for Intermediate level conformance
- CONFORMANCE(3) for Full level conformance.
Vendor-based Escape Clauses
This form of the escape clauses introduces vendor-specific SQL syntax.
The vendor-id for Mimer SQL is "MIMER", and the product-id is "MIMER".
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40