Sets database options in an Adaptive Server Enterprise-compatible manner.
SET option-name option-value
Table 6-14 lists the available options.
Option name |
Option value |
---|---|
ANSINULL |
ON | OFF |
ANSI_PERMISSIONS |
ON | OFF |
CLOSE_ON_ENDTRANS |
ON | OFF |
QUOTED_IDENTIFIER |
ON | OFF |
ROWCOUNT |
integer |
STRING_RTRUNCATION |
ON | OFF |
TRANSACTION ISOLATION LEVEL |
0 | 1 | 2 | 3 |
Database options in Sybase IQ are set using the SET OPTION statement. However, IQ also provides support for the Adaptive Server Enterprise SET statement for a set of options particularly useful for compatibility.
The following options can be set using the Transact-SQL SET statement in Sybase IQ, as well as in Adaptive Server Enterprise:
SET ANSINULL { ON | OFF } The default behavior for comparing values to NULL in Sybase IQ and Adaptive Server Enterprise is different. Setting ANSINULL to OFF provides Transact-SQL compatible comparisons with NULL
SET ANSI_PERMISSIONS { ON | OFF } The default behavior in Sybase IQ and Adaptive Server Enterprise regarding permissions required to carry out a DELETE containing a column reference is different. Setting ANSI_PERMISSIONS to OFF provides Transact-SQL compatible permissions on DELETE
SET CLOSE_ON_ENDTRANS { ON | OFF } The default behavior in Sybase IQ and Adaptive Server Enterprise for closing cursors at the end of a transaction is different. Setting CLOSE_ON_ENDTRANS to OFF provides Transact-SQL compatible behavior.
SET QUOTED_IDENTIFIER { ON | OFF } Controls whether strings enclosed in double quotes are interpreted as identifiers (ON) or as literal strings (OFF).
SET ROWCOUNT integer The Transact-SQL ROWCOUNT option limits to the specified integer the number of rows fetched for any cursor. This includes rows fetched by re-positioning the cursor. Any fetches beyond this maximum return a warning. The option setting is considered when returning the estimate of the number of rows for a cursor on an OPEN request.
The ROWCOUNT option has no effect on UPDATE and DELETE operations in IQ. Also note that Sybase IQ does not support the @@rowcount global variable.
In Sybase IQ, if the ROWCOUNT setting is greater than the number of rows that DBISQL can display, DBISQL may do some extra fetches to reposition the cursor. Thus, the number of rows actually displayed may be less than the number requested. Also, if any rows are re-fetched due to truncation warnings, the count may be inaccurate.
A value of zero resets the option to get all rows.
SET STRING_RTRUNCATION { ON | OFF } The default behavior in Sybase IQ and Adaptive Server Enterprise when non-space characters are truncated on assigning SQL string data is different. Setting STRING_RTRUNCATION to ON provides Transact-SQL compatible string comparisons, including hexadecimal string (binary data type) comparisons.
SET TRANSACTION ISOLATION LEVEL { 0 | 1 | 2 | 3 } Sets the locking isolation level for the current connection, as described in Chapter 10, “Transactions and Versioning” in the Sybase IQ System Administration Guide. For Adaptive Server Enterprise, only 1 and 3 are valid options. For Sybase IQ, only 3 is a valid option.
In addition, the following SET statement is allowed by Sybase IQ for compatibility, but has no effect:
None.
None.