The quoted_identifier option

Both Adaptive Server Enterprise and Sybase IQ 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 Sybase IQ.

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

For a complete list of reserved words, see Table 3-1: “SQL reserved words”.

Setting the option

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

The following statement in either Sybase IQ 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 Sybase IQ 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 Sybase IQ 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 Sybase IQ setting), then the following statements involving the SQL keyword user are valid for both types of DBMS.

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 types of DBMS.

SELECT *
FROM employee
WHERE emp_lname = "Chin"