Contents Index Compatibility of expressions Search conditions

ASA SQL Reference
  SQL Language Elements
    Expressions
      Compatibility of expressions

The quoted_identifier option

Both Adaptive Server Enterprise and Adaptive Server Anywhere provide a quoted_identifier option that allows the interpretation of delimited strings to be changed. By default, the quoted_identifier option is set to OFF in Adaptive Server Enterprise, and to ON in Adaptive Server Anywhere.

You cannot use SQL reserved words as identifiers if the quoted_identifier option is off.

For a complete list of reserved words, see Reserved words.

Setting the option 

While the Transact-SQL SET statement is not supported for most Adaptive Server Enterprise connection options, it is supported for the quoted_identifier option.

The following statement in either Adaptive Server Anywhere or Adaptive Server Enterprise changes the setting of the quoted_identifier option to ON:

SET quoted_identifier ON

With the quoted_identifier option set to ON, Adaptive Server Enterprise allows table, view, and column names to be delimited by quotes. Other object names cannot be delimited in Adaptive Server Enterprise.

The following statement in Adaptive Server Anywhere or Adaptive Server Enterprise changes the setting of the quoted_identifier option to OFF:

SET quoted_identifier OFF
Compatible interpretation of delimited strings 

You can choose to use either the SQL/92 or the default Transact-SQL convention in both Adaptive Server Enterprise and Adaptive Server Anywhere as long as the quoted_identifier option is set to the same value in each DBMS.

Examples 

If you choose to operate with the quoted_identifier option ON (the default Adaptive Server Anywhere setting), then the following statements involving the SQL keyword user are valid for both DBMSs.

CREATE TABLE "user" (
   col1 char(5)
) ;
INSERT "user" ( col1 )
VALUES ( 'abcde' ) ;

If you choose to operate with the quoted_identifier option off (the default Adaptive Server Enterprise setting), then the following statements are valid for both DBMSs.

SELECT *
FROM employee
WHERE emp_lname = "Chin"

Contents Index Compatibility of expressions Search conditions