Collection Contents Index Interactive SQL options CHAPTER 6.  SQL Language Elements pdf/chap5.pdf

Reference Manual
   CHAPTER 5. Database Options     

Alphabetical list of options


This section lists options alphabetically

Top of page  AUDITING option

Function 

Enables and disables auditing in the database.

Allowed values 

ON, OFF

Scope 

Can be set for the PUBLIC group only. Takes effect immediately. DBA permissions are required to set this option.

Default 

OFF

Description 

This option switches auditing on and off.

Auditing is the recording of detailed information about many events in the database in the transaction log. Auditing provides some security features, at the cost of some performance.

Example 

Top of page  ALLOW_NULLS_BY_DEFAULT option

Function 

Controls whether new columns that are created without specifying either NULL or NOT NULL are allowed contain NULL values.

Allowed values 

ON, OFF

Default 

ON

OFF for Open Client and JDBC connections

Description 

The ALLOW_NULLS_BY_DEFAULT option is included for Transact-SQL compatibility.

For Info     For more information, see Setting options for Transact-SQL compatibility.

Top of page  ANSI_BLANKS option

Function 

Controls behavior when character data is truncated at the client side.

Allowed values 

ON, OFF

Default 

OFF

ON for Open Client and JDBC connections

Description 

The ANSI_BLANKS option has no effect unless the database was created with the -b command-line option. It forces a truncation error whenever a value of data type CHAR(N) is read into a C char(M) variable for values of N greater than or equal to M. With ANSI_BLANKS set to OFF, a truncation error occurs only when at least one non-blank character is truncated.

If ANSI_BLANKS is ON, when you supply a value of data type DT_STRING, the sqllen field must be set to the length of the value, including space for the terminating null character. With ANSI_BLANKS off, the length is determined solely by the position of the null character.

The ANSI_BLANKS setting persists for the life of a connection. Changing it after a connection has been established does not affect that connection.

Top of page  ANSI_CLOSE_CURSORS_ON_ROLLBACK option

Function 

Controls whether cursors that were opened WITH HOLD are closed when a ROLLBACK is performed.

Allowed values 

ON, OFF

Default 

OFF

Description 

The draft SQL/3 standard requires all cursors be closed when a transaction is rolled back. By default, on a rollback Adaptive Server Anywhere closes only those cursors that were opened without a WITH HOLD clause. This option allows you to force closure of all cursors.

The CLOSE_ON_ENDTRANS option overrides the ANSI_CLOSE_CURSORS_ON_ROLLBACK option.

Top of page  ANSI_INTEGER_OVERFLOW option

Function 

Controls what happens when an arithmetic expression causes an integer overflow error.

Allowed values 

ON, OFF

Default 

OFF

Description 

The ISO SQL/92 standard requires integer overflow should result in an SQLSTATE = 22003 - overflow error. Adaptive Server Anywhere behavior was previously different from this. The ANSI_INTEGER_OVERFLOW option can be set to OFF to maintain compatibility with previous releases of the software.

Top of page  ANSINULL option

Function 

Controls the interpretation of = and != with NULL values.

Allowed values 

ON, OFF

Default 

ON

Description 

With ANSINULL ON, any comparisons with NULL using = or != are unknown.

Also, aggregate functions on columns that icontain NULL values cause the warning 'null value eliminated in aggregate function' (SQLSTATE=01003).

Setting ANSINULL to OFF allows comparisons with NULL to yield results that are not unknown, for compatibility with Adaptive Server Enterprise, and turns off the warning.

Top of page  ANSI_PERMISSIONS option

Function 

Controls permissions checking for DELETE and UPDATE statements.

Allowed values 

ON, OFF

Default 

ON

Description 

With ANSI_PERMISSIONS ON, the SQL/92 permissions requirements for DELETE and UPDATE statements are checked. The default value is OFF in Adaptive Server Enterprise. The following table outlines the differences.

SQL Statement

Permissions Required with ansi_permissions off

Permissions Required with ansi_permissions on

UPDATE

UPDATE permission on the columns where values are being set

UPDATE permission on the columns where values are being set

SELECT permission on all columns appearing in the WHERE clause.

SELECT permission on all columns on the right side of the set clause.

DELETE

DELETE permission on the table

DELETE permission on the table.

SELECT permission on all columns appearing in the WHERE clause

The ANSI_PERMISSIONS option can be set only for the PUBLIC group. No private settings are allowed.

Top of page  AUTO_COMMIT option [ISQL

Function 

Controls whether a COMMIT is performed after each statement.

Allowed values 

ON, OFF

Default 

OFF

Description 

If AUTO_COMMIT is on, a database COMMIT is performed after each successful statement. If the COMMIT fails, you have the option to execute additional SQL statements and perform the COMMIT again, or execute a ROLLBACK statement.

By default, a COMMIT or ROLLBACK is performed only when the user issues a COMMIT or ROLLBACK statement or a SQL statement that causes an automatic commit (such as the CREATE TABLE statement).

Top of page  AUTO_REFETCH option [ISQL

Function 

Controls whether query results are fetched again after deletes, updates, and inserts.

Allowed values 

ON, OFF

Default 

ON

Description 

If AUTO_REFETCH is on, the current query results that are displayed in the Data window will be refetched from the database after any INSERT, UPDATE or DELETE statement. Depending on how complicated the query is, this may take some time. For this reason, it can be turned off.

Top of page  AUTOMATIC_TIMESTAMP option

Function 

Controls interpretation of new columns with the TIMESTAMP data type.

Allowed values 

ON, OFF

Default 

OFF

Description 

Controls whether any new columns with the TIMESTAMP data type that do not have an explicit default value defined are given a default value of the Transact-SQL timestamp value as a default. The AUTOMATIC_TIMESTAMP option is included for Transact-SQL compatibility. The default is OFF.

For Info     For more information, see Setting options for Transact-SQL compatibility.

Top of page  BACKGROUND_PRIORITY option

Function 

To limit impact on the performance of connections other than the current connection.

Allowed Values 

ON or OFF

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

OFF

Description 

When set to ON, it requests that the current connection have minimal impact on the performance of other connections. This option allows tasks for which responsiveness is critical to coexist with other tasks for which performance is not as important.

Top of page  BELL option [ISQL

Function 

Controls whether the bell sounds when an error occurs.

Allowed values 

ON, OFF

Default 

ON

Description 

Set this option according to your preference.

Top of page  BLOB_THRESHOLD option

Function 

Controls the size of value that the Message Agent treats as a long object (blob).

Allowed values 

Integer, in kilobytes

Default 

256

Description 

Any value longer than the BLOB_THRESHOLD option is replicated as a blob. That is, it is broken into pieces and replicated in chunks, before being reconstituted by using a SQL variable and concatenating the pieces at the recipient site.

If you set BLOB_THRESHOLD to a high value in remote Adaptive Server Anywhere databases, blobs are not broken into pieces, and operations can be applied to Adaptive Server Enterprise by the Message Agent. Each SQL statement must fit within a message, so this only allows replication of small blobs.

Top of page  BLOCKING option

Function 

Controls the behavior in response to locking conflicts.

Allowed Values 

ON or OFF

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

ON

Description 

If BLOCKING is ON, any transaction that attempts to write must wait until every conflicting transaction releases its read lock. At that time, the write goes through. If BLOCKING is OFF, the transaction that attempts to write receives an error.

For Info     For more information, see Transaction blocking and deadlock.

Top of page  CHAINED option

Function 

Controls transaction mode in the absence of a BEGIN TRANSACTION statement.

Allowed values 

ON, OFF

Default 

ON

OFF for Open Client and JDBC connections

Description 

Controls the Transact-SQL transaction mode. In Unchained mode (CHAINED = OFF), each statement is committed individually unless an explicit BEGIN TRANSACTION statement is executed to start a transaction. In chained mode (CHAINED = ON) a transaction is implicitly started before any data retrieval or modification statement.

Top of page  CHAR_OEM_TRANSLATION option [ISQL

Function 

Controls whether ANSI-to-OEM code page translation is carried out.

Allowed values 

ON, OFF, DETECT

Default 

DETECT

Description 

Each time Interactive SQL connects to a database or uses SET CONNECTION, it determines the setting of Char_OEM_Translation.

If the option is set to ON or OFF, translation is set accordingly. If the option is set to DETECT (the recommended and default setting), Interactive SQL fetches the collation label from the database and examines it. If the collation label starts with a string that generally indicates an ANSI code page, then Interactive SQL turns off translation.

The strings that indicate ANSI code pages are as follows:

For all other prefixes, translation is turned on. When the option is set to DETECT, Interactive SQL displays a message in the status window indicating the collation label and the display translation setting.

Top of page  CHECKPOINT_TIME option

Function 

Set the maximum number of minutes that the database server will run without doing a checkpoint.

Allowed Values 

Integer

Scope 

Can be set only for the PUBLIC group. You must shut down and restart the database server for the change to take effect.

Default 

60

Description 

This option is used with the RECOVERY_TIME option to decide when checkpoints should be done.

For Info     For information on checkpoints, see The checkpoint log.

Top of page  CLOSE_ON_ENDTRANS option

Function 

Controls the closing of cursors at the end of a transaction.

Allowed values 

ON, OFF

Default 

ON

Description 

When CLOSE_ON_ENDTRANS is set to ON, cursors are closed whenever a transaction is committed unless the cursor was opened WITH HOLD. The behavior when a transaction is rolled back is governed by the ANSI_CLOSE_CURSORS_AT_ROLLBACK option.

When CLOSE_ON_ENDTRANS is set to OFF, cursors are not closed at either a commit or a rollback, regardless of the ANSI_CLOSE_CURSORS_AT_ROLLBACK option setting or whether the cursor was opened WITH HOLD or not.

Setting this to OFF provides Adaptive Server Enterprise compatible behavior.

Top of page  COMMAND_DELIMITER option [ISQL

Function 

Sets the string that indicates the end of a statement in Interactive SQL.

Allowed values 

String

Default 

Semi-colon (;)

Description 

If the command delimiter is set to a string beginning with a character that is valid in identifiers, the command delimiter must be preceded by a space.

Top of page  COMMIT_ON_EXIT option [ISQL

Function 

Controls behavior when Interactive SQL disconnects or terminates.

Allowed values 

ON, OFF

Default 

ON

Description 

Controls whether a COMMIT or ROLLBACK is done when you leave Interactive SQL. When COMMIT_ON_EXIT is set to ON, a COMMIT is done; otherwise a ROLLBACK is done.

Top of page  CONTINUE_AFTER_RAISE_ERROR option

Function 

Controls behavior following a RAISERROR statement.

Allowed values 

ON, OFF

Default 

OFF

ON for Open Client and JDBC connections

Description 

Deprecated option    
This option is deprecated in favor of the ON_TSQL_ERROR option.

For more information, see ON_TSQL_ERROR option.

The RAISERROR statement is used within procedures and triggers to generate an error. When this option is set to OFF, the execution of the procedure or trigger is stopped whenever the RAISERROR statement is encountered.

If you set the CONTINUE_AFTER_RAISERROR switch to ON, the RAISERROR statement no longer signals an execution-ending error. Instead, the RAISERROR status code and message are stored and the most recent RAISERROR is returned when the procedure completes. If the procedure which caused the RAISERROR was called from another procedure, the RAISERROR is not returned until the outermost calling procedure terminates.

Intermediate RAISERROR statuses and codes are lost after the procedure terminates. If, at return time, an error occurs along with the RAISERROR, then the information for the new error is returned and the RAISERROR information is lost. The application can query intermediate RAISERROR statuses by examining the @@error global variable at different execution points.

Top of page  CONVERSION_ERROR option

Function 

Controls the reporting of data type conversion failures on fetching information from the database.

Allowed values 

ON, OFF

Default 

ON

Description 

This option controls whether data type conversion failures, when data is fetched from the database or inserted into the database, are reported by the database as errors (CONVERSION_ERROR set to ON) or as a warning (CONVERSION_ERROR set to OFF).

When CONVERSION_ERROR is set to ON, the SQLE_CONVERSION_ERROR error is generated. If the option is set to OFF, the warning SQLE_CANNOT_CONVERT is produced.

If conversion errors are reported as warnings only, the NULL value is used in place of the value that could not be converted. In Embedded SQL, an indicator variable is set to -2 for the column or columns that cause the error.

Top of page  COOPERATIVE_COMMITS option

Function 

Controls when commits are written to disk.

Allowed Values 

ON or OFF

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

ON

Description 

If COOPERATIVE_COMMITS is set to OFF, a COMMIT is written to disk as soon as the database server receives it, and the application is then allowed to continue.

If COOPERATIVE_COMMITS is set to ON (the default), the database server does not immediately write the COMMIT to the disk. Instead, the application waits for up to the maximum length set by the COOPERATIVE_COMMIT_TIMEOUT option for something else to put on the pages before they are written to disk.

Setting COOPERATIVE_COMMITS to ON, and increasing the COOPERATIVE_COMMIT_TIMEOUT setting, increases overall database server throughput by cutting down the number of disk I/Os, but at the expense of a longer turnaround time for each individual connection.

If both COOPERATIVE_COMMITS and DELAYED_COMMITS are set to ON, and the COOPERATIVE_COMMIT_TIMEOUT interval passes without the pages getting written, the application is resumed (as if the commit had worked), and the remaining interval (DELAYED_COMMIT_TIMEOUT - COOPERATIVE_COMMIT_TIMEOUT) is used as a DELAYED_COMMIT interval. The pages will then be written, even if they are not full.

Top of page  COOPERATIVE_COMMIT_TIMEOUT option

Function 

Governs when a COMMIT entry in the transaction log is written to disk.

Allowed Values 

Integer, in milliseconds

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

250

Description 

This option has meaning only when COOPERATIVE_COMMITS is set to ON. The database server waits for the specified number of milliseconds for other connections to fill a page of the log before writing to disk. The default setting is 250 milliseconds.

Top of page  DATE_FORMAT option

Function 

Sets the format for dates retrieved from the database.

Allowed Values 

String

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

'YYYY-MM-DD'. This corresponds to ISO date format specifications.

Description 

The format is a string using the following symbols:

Symbol

Description

yy

Two digit year

yyyy

Four digit year

mm

Two digit month, or two digit minutes if following a colon(as in hh:mm)

mmm[m...]

Character short form for months—as many characters as there are m's

d

Single digit day of week, (0 = Sunday, 6 = Saturday)

dd

Two digit day of month

ddd[d...]

Character short form for day of the week

hh

Two digit hours

nn

Two digit minutes

ss[.ss..]

Seconds and parts of a second

aa

AM or PM (12 hour clock)

pp

PM if needed (12 hour clock)

jjj

Day of the year, from 1 to 366.

Each symbol is substituted with the appropriate data for the date that's being formatted. Any format symbol that represents character rather than digit output can be put in upper case which causes the substituted characters to also be in upper case. For numbers, using mixed case in the format string suppresses leading zeros.

You can control the padding of numbers by changing the case of the symbols. Same-case symbols (MM, mm, DD, dd) all pad number with zeroes. Mixed case (Mm, mM, Dd, or dD) cause the number to not be zero padded: the value takes as much room as required. For example

SELECT dateformat( '1998/01/01', 'yyyy/Mm/Dd')

returns the following value:

1998/1/1

Examples 

Top of page  DATE_ORDER option

Function 

Controls the interpretation of date formats.

Allowed Values 

'MDY', 'YMD', or 'DMY'

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

YMD. This corresponds to ISO date format specifications.

For Open Client and JDBC connections, the default is set to MDY.

Description 

The database option DATE_ORDER is used to determine whether 10/11/12 is Oct 11 1912, Nov 12 1910, or Nov 10 1912. The option can have the value 'MDY', 'YMD', or 'DMY'.

Top of page  DEFAULT_TIMESTAMP_INCREMENT option

Function 

Specifies the number of microseconds to add to a column of type TIMESTAMP in order to keep values in the column unique.

Allowed Values 

Integer

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

1

Description 

Since a TIMESTAMP value is precise to six decimal places in Adaptive Server Anywhere, by default 1 microsecond (0.000001 of a second) is added to differentiate between two identical TIMESTAMP values.

Some software, such as Microsoft Access, truncates TIMESTAMP values to three decimal places, making valid comparisons a problem. Setting this value to a larger number, such as 0.001 of a second (an option value of 100), alleviates this problem.

Top of page  DELAYED_COMMITS option

Function 

Determines when the server returns control to an application following a COMMIT.

Allowed Values 

ON or OFF

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

OFF. This corresponds to ISO COMMIT behavior.

Description 

When set to ON, the database server replies to a COMMIT statement immediately instead of waiting until the transaction log entry for the COMMIT has been written to disk. When set to OFF, the application must wait until the COMMIT is written to disk.

When this option is ON, the log is written to disk when the log page is full or according to the DELAYED_COMMIT_TIMEOUT option setting, whichever is first. There is a slight chance that a transaction may be lost even though committed if a system failure occurs after the server replies to a COMMIT, but before the page is written to disk. Setting DELAYED_COMMITS to ON, and the DELAYED_COMMIT_TIMEOUT option to a high value, promotes a quick response time at the cost of security.

If both COOPERATIVE_COMMITS and DELAYED_COMMITS are set to ON, and if the COOPERATIVE_COMMIT_TIMEOUT interval passes without the pages getting written, the application is resumed (as if the commit had worked), and the remaining interval (DELAYED_COMMIT_TIMEOUT - COOPERATIVE_COMMIT_TIMEOUT) is used as a DELAYED_COMMIT interval, after which the pages will be written, even if they are not full.

Top of page  DELAYED_COMMIT_TIMEOUT option

Function 

Determines when the server returns control to an application following a COMMIT.

Allowed Values 

Integer, in milliseconds.

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

500

Description 

This option has meaning only when DELAYED_COMMITS is set to ON. it governs when a COMMIT entry in the transaction log is written to disk. With DELAYED_COMMITS set to ON, the database engine waits for the number of milliseconds set in the DELAYED_COMMIT_TIMEOUT option for other connections to fill a page of the log before writing the current page contents to disk.

For Info     For more information, see DELAYED_COMMITS option.

Top of page  DELETE_OLD_LOGS option

Function 

Controls whether transaction logs are deleted when their messages have been replicated.

Allowed values 

ON, OFF

Default 

OFF

Description 

This option is used by SQL Remote and by the Adaptive Server Anywhere Replication Agent. The default setting is OFF. When it is set to ON, the Message Agent (DBREMOTE) deletes each old transaction log when all the changes it contains have been sent and confirmed as received.

Top of page  DESCRIBE_JAVA_FORMAT option [ISQL]

Function 

Controls whether Java objects are interpreted as strings (for display) or as binary (for loading and unloading).

Allowed values 

varchar, binary

Default 

OFF

Description 

When set to varchar, Interactive SQL converts all data fetched from the database to strings. The database server calls the toString() method on Java columns to provide formatted output for the Interactive SQL data window.

When set to binary, Interactive SQL does no data conversion.

Top of page  DIVIDE_BY_ZERO_ERROR option

Function 

Controls the reporting of division by zero.

Allowed values 

ON, OFF

Default 

ON

Description 

This option indicates whether division by zero is reported as an error. If the option is set ON, then division by zero results in an error with SQLSTATE 22012.

If the option is set OFF, division by zero is not an error. Instead, a NULL is returned.

Top of page  ECHO option [ISQL

Function 

Controls whether statements are echoed before they are executed.

Allowed values 

ON, OFF

Default 

ON

Description 

This option is most useful when you use the READ statement to execute a Interactive SQL command file.

Top of page  ESCAPE_CHARACTER option

This option is reserved for system use. Do not change the setting of this option.

Top of page  FIRE_TRIGGERS option

Function 

Controls whether triggers are fired in the database.

Allowed values 

ON, OFF

Default 

ON

Description 

When set to ON, triggers are fired. When set to OFF, no triggers are fired, including referential integrity triggers (such as cascading updates and deletes). Only a user with DBA authority can set this option. The option is overridden by the -gf command-line option, which turns off all trigger firing regardless of the FIRE_TRIGGERS setting.

This option is relevant when replicating data from Adaptive Server Enterprise to Adaptive Server Anywhere, because all actions from Adaptive Server Enterprise transaction logs are replicated to Adaptive Server Anywhere, including actions carried out by triggers.

Top of page  FLOAT_AS_DOUBLE option

Function 

Controls the interpretation of the FLOAT keyword.

Allowed values 

ON, OFF

Default 

OFF

ON for Open Client and JDBC connections

Description 

The FLOAT_AS_DOUBLE option makes the FLOAT keyword behave like Adaptive Server Enterprise's FLOAT keyword when a precision is not specified.

When enabled (set to ON), all occurrences of the keyword FLOAT are interpreted as equivalent to the keyword DOUBLE within SQL statements.

By default, Adaptive Server Anywhere FLOAT values are interpreted by Adaptive Server Enterprise as REAL values. Since Adaptive Server Enterprise treats its own FLOAT values as DOUBLE, enabling this option makes Adaptive Server Anywhere treat FLOAT values in the same way Enterprise treats FLOAT values.

REAL values are four bytes; DOUBLE values are eight bytes. According to the ANSI SQL/92 specification, FLOAT can be interpreted based on the platform. It is up to the database to decide what size the value is, so long as it can handle the necessary precision. Adaptive Server Enterprise and Adaptive Server Anywhere exhibit different default behavior.

The FLOAT_AS_DOUBLE option takes effect only when no precision is specified. For example, the following statement is not affected by the option setting:

create table t1( 
   c1 float(5)
)

The following statement is affected by the option setting:

create table t2( 
   c1 float)
// affected by option setting

Top of page  HEADINGS option [ISQL

Function 

Controls whether headings will be displayed for the results of a SELECT statement.

Allowed values 

ON, OFF

Default 

ON

Description 

Set this option according to your preference.

Top of page  INPUT_FORMAT option [ISQL

Function 

Sets the default data format expected by the INPUT statement.

Allowed values 

String. See below.

Default 

ASCII

Description 

Certain file formats contain information about column names and types. Using this information, the INPUT statement will create the database table if it does not already exist. This is a very easy way to load data into the database. The formats that have enough information to create the table are: DBASEII, DBASEIII, DIF, FOXPRO, LOTUS, and WATFILE.

Allowable input formats are:

Top of page  ISQL_LOG option [ISQL

Function 

Controls logging behavior.

Allowed values 

String containing a file name.

Default 

Empty string.

Description 

If ISQL_LOG is set to a non-empty string, all Interactive SQL statements are added to the end of the named file. Otherwise, if ISQL_LOG is set to the empty string, Interactive SQL statements are not logged.

Individual session only    
This option logs an individual Interactive SQL session only. See Backup and Data Recovery for a description of the transaction log that logs all changes to the database by all users.

Top of page  ISOLATION_LEVEL option

Function 

Controls the locking isolation level.

Allowed Values 

0, 1, 2, or 3

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

0

1 for Open Client and JDBC connections

Description 

This option controls the locking isolation level as follows.

For Info     For more information, see Isolation levels and consistency.

Top of page  JAVA_HEAP_SIZE option

Function 

To limit the memory used by Java applications for a connection.

Allowed values 

Integer

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately. DBA permissions are required to set this option for any connection.

Default 

1000000

Description 

This option sets the maximum size (in bytes) of the memory that is allocated to Java applications on a per-connection basis. Per-connection memory allocations typically consist of the user's working set of allocated Java variables and Java application stack space.

While a Java application is executing on a connection, the per-connection allocations come out of the fixed cache of the database server, so it is important that a run-away Java application is prevented from using up too much memory.

Top of page  JAVA_NAMESPACE_SIZE option

Function 

To limit the memory used by Java applications for a connection.

Allowed values 

Integer

Scope 

Can be set only for the PUBLIC group. Takes effect immediately.

Default 

4000000

Description 

This option sets the maximum size (in bytes) of the memory that is allocated to Java applications on a per-database basis.

Per-database memory allocations include Java class definitions. Because class definitions are effectively read-only, they are shared between connections. Consequently, their allocations come right out of the fixed cache, and this option sets a limit on the size of these allocations.

Top of page  LOGIN_MODE option

Function 

Controls the use of integrated logins for the database.

Allowed Values 

Standard, Mixed, or Integrated

Scope 

Can be set only for the PUBLIC group. Takes effect immediately.

Default 

Standard

Description 

This option specifies whether integrated logins are permitted. The following values are accepted (the values are case insensitive):

For Info     For more information on integrated logins see Using an integrated login

Top of page  LOGIN_PROCEDURE option

Function 

A login procedure that sets connection compatibility options at startup. By default the procedure calls the sp_login_environment procedure to determine which options to set.

Allowed Values 

String

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

sp_login_environment

Description 

This login procedure calls the sp_login_environment procedure at run time to determine the database connection settings.

You can customize the default database option settings by creating a new procedure and setting LOGIN_PROCEDURE to call the new procedure. You should not edit either sp_login_procedure or sp_tsql_environment.

Top of page  MAX_CURSOR_COUNT option

Function 

A resource governor to limit the maximum number of cursors that a connection can use at once.

Allowed Values 

Integer

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately. DBA permissions are required to set this option for any connection.

Default 

50

Description 

For Info    This resource governor allows a DBA to limit the number of cursors per connection that a user can use. If an operation would exceed the limit for a connection, an error is generated, indicating that the governor for the resource has been exceeded.

For Info    If a connection executes a stored procedure, that procedure is executed under the permissions of the procedure owner. However, the resources used by the procedure are assigned to the current connection.

For Info    You can remove resource limits by setting the option to 0 (zero).

Top of page  MAX_STATEMENT_COUNT option

Function 

A resource governor to limit the maximum number of prepared statements that a connection can use at once.

Allowed Values 

Integer

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately. DBA permissions are required to set this option for any connection.

Default 

50

Description 

For Info    This resource governor allows a DBA to limit the number of prepared statements per connection a user can use. If an operation would exceed the limit for a connection, an error is generated, indicating that the governor for the resource has been exceeded.

For Info    If a connection executes a stored procedure, that procedure is executed under the permissions of the procedure owner. However, the resources used by the procedure are assigned to the current connection.

For Info    You can remove resource limits by setting the option to 0 (zero).

Top of page  MIN_PASSWORD_LENGTH option

Function 

Sets the minimum length for new passwords in the database.

Allowed values 

Integer, greater than or equal to zero.

The value is in bytes. For single-byte character sets, this is the same as the number of characters.

Scope 

Can be set for the PUBLIC group. Takes effect immediately. DBA permissions are required to set this option.

Default 

0 characters

Description 

This option allows the database administrator to impose a minimum length on all new passwords for greater security. Existing passwords are not affected.

Example 

Top of page  NEAREST_CENTURY option

Function 

Controls the interpretation of two-digit years, in string-to-date conversions.

Allowed values 

Integer between 0 and 100

Default 

50 for databases created with Version 6 or later.

0 for databases created with Version 5.5 or earlier.

Description 

This option controls the handling of two-digit years, when converting from strings to dates or timestamps.

The NEAREST_CENTURY setting is a numeric value that acts as a rollover point. Two digit years less than the value are converted to 20yy, while years greater than or equal to the value are converted to 19yy.

The historical Adaptive Server Anywhere behavior is to add 1900 to the year. Adaptive Server Enterprise behavior is to use the nearest century, so any year value yy is less than 50, the year is set to 20yy.

Top of page  NON_KEYWORDS option

Function 

Turns off individual keywords, allowing their use as identifiers.

Allowed values 

String

Default 

The empty string.

Description 

This option turns off individual keywords, or all keywords introduced since a specific release of the product. This provides a way of ensuring that applications created with older versions of the product are not broken by new keywords. If you have an identifier in your database that is now a keyword, you can either add double quotes around the identifier in all applications or scripts, or turn off the keyword using the NON_KEYWORDS option.

In addition to specifying individual keywords, you can turn off all keywords since a specified release, using one of the following special values in the list of keywords:

keywords_4_0_d, keywords_4_0_c, keywords_4_0_b, keywords_4_0_a, keywords_4_0, keywords_5_0_01, keywords_5_0

The following statement prevents TRUNCATE and SYNCHRONIZE from being recognized as keywords:

SET OPTION NON_KEYWORDS = 'TRUNCATE, SYNCHRONIZE'

The following statement prevents all keywords introduced since release 4.0d from being recognized as keywords:

SET OPTION NON_KEYWORDS = 'keywords_4_0_d'

Each new setting of this option replaces the previous setting. The following statement clears all previous settings.

SET OPTION NON_KEYWORDS =

A side-effect of this options is that SQL statements that use a turned off keyword cannot be used: they produce a syntax error.

Top of page  NULLS option [ISQL

Function 

Specifies how NULL values in the database are displayed.

Allowed values 

ON, OFF

Default 

(NULL)

Description 

Set this according to your preference.

Top of page  ON_ERROR option [ISQL

Function 

Controls what happens if an error is encountered while reading statements from a command file.

Allowed values 

String. See below for allowed values.

Default 

PROMPT

Description 

Controls what happens if an error is encountered while reading statements from a command file, as follows:

Top of page  ON_TSQL_ERROR option

Function 

Controls what happens if an error is encountered in a stored procedure/

Allowed values 

String. See below for allowed values.

Default 

CONDITIONAL

See also 

CREATE PROCEDURE statement

CREATE PROCEDURE statement

Transact-SQL procedure language overview

Description 

Controls what happens if an error is encountered while executing a Transact-SQL stored procedure.

This option deprecates CONTINUE_AFTER_RAISEERROR as a way of simulating Adaptive Server Enterprise behavior for stored procedures..

Top of page  OUTPUT_FORMAT option [ISQL

Function 

Sets the output format for the data retrieved by the SELECT statement and redirected into a file, or output using the OUTPUT statement.

Allowed values 

String. See below for allowed values.

Default 

ASCII

Description 

The valid output formats are:

Top of page  OUTPUT_LENGTH option [ISQL

Function 

Controls the length used when Interactive SQL exports information to an external file.

Allowed values 

Integer

Default 

0 (no truncation)

Description 

This option controls the length used when Interactive SQL exports information to an external file (using output redirection or the OUTPUT statement).

Top of page  PERCENT_AS_COMMENT option

Function 

Controls the interpretation of the percent character.

Allowed values 

ON, OFF

Default 

ON

Description 

It is recommended that you not use % as a comment marker.

Versions of this product before Version 6 treated the percent character (%) in SQL statements exclusively as a comment delimiter. Since Version 5, alternative comment markers such as //, /* */, and -- (double dash) have been available. The double-dash style is the SQL/92 comment delimiter.

Adaptive Server Enterprise treats % as a modulo operator and does not support the Adaptive Server Anywhere mod function. Writing a statement that works in both environments and performs a modulo operation was previously impossible.

The PERCENT_AS_COMMENT option controls the meaning of %. The default setting for is ON, for backwards compatibility. You can set the option to OFF for compatibility with Adaptive Server Enterprise.

Procedures, triggers and views that were created with %-style comments are converted to double-dash comments when they are stored in the catalog.

Existing procedures must be recreated before changing option    
Any existing procedures that contain %-style comments must be recreated before you change the option setting; otherwise, the procedures will fail to load.

The Sybase Central code editor does not highlight %-style comments. If you wish to have your comments highlighted in the Sybase Central editor, you should use one of the other comment delimiters.

Top of page  PRECISION option

Function 

Specifies the maximum number of digits in the result of any decimal arithmetic.

Allowed Values 

Integer, with a maximum of 127

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

30

Description 

Precision is the total number of digits to the left and right of the decimal point. The SCALE option specifies the minimum number of digits after the decimal point when an arithmetic result is truncated to the maximum PRECISION.

Multiplication, division, addition, subtraction, and aggregate functions can all have results that exceed the maximum precision.

For example, when a DECIMAL(8,2) is multiplied with a DECIMAL(9,2), the result could require a DECIMAL(17,4). If PRECISION is 15, only 15 digits will be kept in the result. If SCALE is 4, the result will be a DECIMAL(15,4). If SCALE is 2, the result will be a DECIMAL(15,2). In both cases, there is a possibility of overflow.

Top of page  PREFETCH option

Function 

The PREFETCH option acts as a toggle allowing you to turn fetching on and off.

Allowed Values 

ON, OFF

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

ON

Description 

This option controls whether rows are fetched to the client side in advance of being made available to the client application. Fetching a number of rows at a time, even when the client application requests rows one at a time (for example, when looping over the rows of a cursor) both cuts down on response time and improves overall throughput by cutting down the number of requests to the database.

The setting of PREFETCH is ignored by Open Client and JDBC connections.

Top of page  QUERY_PLAN_ON_OPEN option

Function 

Controls whether a plan is returned when a cursor is opened.

Allowed values 

ON, OFF

Default 

OFF

Description 

In early versions of the software, each time an OPEN was done on a cursor, the server would return in the SQLCA sqlerrmc field a string representing the query plan (limited to 70 bytes). A more complete description can be obtained using the EXPLAIN statement or the PLAN function. For this reason, computing and returning the query plan on an OPEN is needed only for compatibility with old applications. The QUERY_PLAN_ON_OPEN option controls whether the plan is returned on an OPEN. By default, the setting is OFF.

Top of page  QUOTED_IDENTIFIER option

Function 

Controls the interpretation of strings that are enclosed in double quotes.

Allowed values 

ON, OFF

Default 

ON

OFF for Open Client and JDBC connections

Description 

This option controls whether strings that are enclosed in double quotes are interpreted as identifiers (ON) or as literal strings (OFF). The QUOTED_IDENTIFIER option is included for Transact-SQL compatibility.

Sybase Central resents QUOTED_IDENTIFER temporarily to ON if it is set to OFF. A message is displayed informing you of this change. The change is in effect only for the Sybase Central connection.

For Info     For more information, see Setting options for Transact-SQL compatibility.

Top of page  RECOVERY_TIME option

Function 

Sets the maximum length of time, in minutes, that the database server will take to recover from system failure.

Allowed Values 

Integer, in minutes

Scope 

Can be set only for the PUBLIC group. Takes effect when server is restarted.

Default 

2

Description 

This option is used with the CHECKPOINT_TIME option to decide when checkpoints should be done.

Adaptive Server Anywhere uses a heuristic to estimate the recovery time based on the operations that have been performed since the last checkpoint. Thus, the recovery time is not exact.

For Info     For more information, see Recovery from system failure.

Top of page  ROW_COUNTS option

Function 

Specifies whether the database will always count the number of rows in a query when it is opened.

Allowed Values 

ON, OFF

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

OFF

Description 

If this option is set to OFF, the row count is usually only an estimate. If this option is set to ON, the row count is always accurate. Opening queries may take significantly longer.

Top of page  REPLICATE_ALL option

Function 

Allows an entire database to act as a primary site in a Replication Server setup.

Allowed values 

ON, OFF

Default 

OFF

Description 

This option is used by the LTM only. When it is set to ON, the entire database is set to act as a primary site in a Replication Server installation. All changes to the database are sent to Replication Server by the LTM.

Top of page  REPLICATION_ERROR option

Function 

For SQL Remote, allows you to specify a stored procedure to be called by the Message Agent when a SQL error occurs.

Allowed values 

Stored procedure name.

Default 

No procedure

Description 

For SQL Remote, the REPLICATION_ERROR option allows you to specify a stored procedure to be called by the Message Agent when a SQL error occurs. By default no procedure is called.

The procedure must have a single argument of type CHAR, VARCHAR, or LONG VARCHAR. The procedure is called once with the SQL error message and once with the SQL statement that causes the eror.

Although the option allows you to track and monitor SQL errors in replication, you must still design them out of your setup; this option is not intended to resolve such errors.

Top of page  RI_Trigger_time option

Function 

Controls the relative timing of referential integrity checks and trigger actions.

Allowed values 

BEFORE, AFTER

Default 

AFTER

Description 

The option can be set to either BEFORE or AFTER. When it's set to AFTER, referential integrity actions are executed after the UPDATE or DELETE.

Only the PUBLIC setting can be used; any other setting is ignored.

Prior to release 5.5, the referential integrity triggers were always fired BEFORE. Starting with release 5.5, the default has been AFTER.

The reason for the change of default behavior is that BEFORE triggers can lead to infinitely recursing triggers, when delete self-referencing rows.

Top of page  SCALE option

Function 

Specifies the minimum number of digits after the decimal point when an arithmetic result is truncated to the maximum PRECISION.

Allowed Values 

Integer, with a maximum of 127.

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

6

Description 

Multiplication, division, addition, subtraction, and aggregate functions can all have results that exceed the maximum precision. See PRECISION option for an example.

Top of page  SQL_FLAGGER_ERROR_LEVEL option

Function 

Controls the response to any SQL that is not part of a specified set of SQL/92.

Allowed values 

E, I, F, or W

Default 

W

Description 

This option flags any SQL that is not part of a specified set of SQL/92 as an error.

The allowed values of level are as follows:

Top of page  SQL_FLAGGER_WARNING_LEVEL option

Function 

Controls the response to any SQL that is not part of a specified set of SQL/92.

Allowed values 

E, I, F, or W

Default 

W

Description 

This option flags any SQL that is not part of a specified set of SQL/92 as a warning.

The allowed values of level are as follows:

Top of page  STATISTICS option [ISQL

Function 

Controls whether execution times, optimization strategies and other statistics are displayed in the statistics window.

Allowed values 

0, 3, 4, 5, or 6.

Default 

3

Description 

When the option is set to 0, the statistics window is not displayed. Otherwise, the value represents the height of the statistics window, in lines.

Top of page  STRING_RTRUNCATION option

Function 

Determines whether an error is raised when an INSERT or UPDATE truncates a CHAR or VARCHAR string.

Allowed values 

ON, OFF

Default 

OFF

Description 

If the truncated characters consist only of spaces, no exception is raised. The setting of ON corresponds to ANSI/ISO SQL/92 behavior. When it is set to OFF, the exception is not raised and the character string is silently truncated.

Top of page  SUBSCRIBE_BY_REMOTE option

Function 

Controls interpretation of NULL or empty-string SUBSCRIBE BY values.

Allowed values 

ON, OFF

Default 

ON

Description 

When the option is set to ON, operations from remote databases on rows with a SUBSCRIBE BY value that is NULL or an empty string assume that the remote user is subscribed to the row. When it is set to OFF, the remote user is assumed not to be subscribed to the row.

Top of page  TEXTSIZE option

Function 

Controls the maximum size (in bytes) of text or image type data to be returned with a SELECT statement.

Allowed values 

Integer, in bytes.

Default 

32765 bytes

Description 

The @@textsize global variable stores the current setting. To reset to the default size (32765 bytes), which is also the maximum value, use the statement:

set textsize 0

Top of page  THREAD_COUNT option

Function 

Historical

Allowed Values 

Integer

Default 

Not applicable

Description 

This option is now ignored by the server. For Version 6 you should use the -gn server command-line option to set the maximum number of requests that the server handles simultaneously.

For Info     For information on the command-line switch, see The database server.

Top of page  TIME_FORMAT option

Function 

Sets the format for times retrieved from the database.

Allowed Values 

A string composed of the symbols listed below.

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

HH:NN:ss.SSS

For Open Client and JDBC connections the default is set to HH:NN:SS.SSS.

Description 

The format is a string using the following symbols:

Each symbol is substituted with the appropriate data for the time that is being formatted. Any format symbol that represents character rather than digit output can be put in uppercase, which causes the substituted characters to also be in uppercase. For numbers, using mixed case in the format string suppresses leading zeros.

Top of page  TIMESTAMP_FORMAT option

Function 

Sets the format for timestamps that are retrieved from the database.

Allowed Values 

A string composed of the symbols listed below.

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

YYYY-MM-DD HH:NN:ss.SSS

For Open Client and JDBC connections the default is set to YYYY-MM-DD HH:NN:SS.SSS.

Description 

The format is a string using the following symbols:

Symbol

Description

yy

Two digit year

Yyyy

Four digit year

Mm

Two digit month, or two digit minutes if following a colon(as in 'hh:mm')

Mmm[m...]

Character short form for months—as many characters as there are m's

dd

Two digit day of month

Ddd[d...]

Character short form for day of the week

hh

Two digit hours

nn

Two digit minutes

ss.ssssss

Seconds and fractions of a second, up to six decimal places. Not all platforms support timestamps to a precision of six places.

aa

am or pm (12 hour clock)

pp

Pm if needed (12 hour clock)

f

Use French days and months (deprecated)

Each symbol is substituted with the appropriate data for the timestamp that is being formatted. Any format symbol that represents character rather than digit output can be put in uppercase, which causes the substituted characters to also be in uppercase. For numbers, using mixed case in the format string suppresses leading zeros.

Top of page  TRUNCATION_LENGTH option [ISQL

Function 

Controls the truncation of wide columns for displays to fit on a screen.

Allowed values 

Integer

Default 

30

Description 

When SELECT statement results are displayed on the screen, each column of output is limited to the width of the screen. The TRUNCATION_LENGTH option is used to reduce the width of wide columns so that more than one column will fit on the screen. A value of 0 means that columns are not truncated.

The default TRUNCATION_LENGTH is 30. For character-mode systems, this is an actual number of characters. For windowing systems, TRUNCATION_LENGTH is used to estimate an area of the screen to be used for display since proportional fonts are used.

Top of page  TSQL_HEX_CONSTANT option

Function 

Controls whether hexadecimal constants are treated as binary typed constants.

Allowed values 

ON, OFF

Default 

ON

Description 

When this option is set to ON, hexadecimal constants are treated as binary typed constants. To get the historical behavior, set the option to OFF.

Top of page  TSQL_VARIABLES option

Function 

Controls whether the @ sign can be used as a prefix for Embedded SQL host variable names.

Allowed values 

ON, OFF

Default 

OFF

ON for Open Client and JDBC connections

Description 

When this options set to ON, you can use the @ sign instead of the colon as a prefix for host variable names in Embedded SQL. This is implemented primarily for Transact-SQL compatibility.

Top of page  VERIFY_ALL_COLUMNS option

Function 

Controls whether messages that contain updates published by the local database are sent with all column values included.

Allowed values 

ON, OFF

Default 

OFF

Description 

This option is used by SQL Remote only. When it is set to ON, messages that contain updates published by the local database are sent with all column values included, and a conflict in any column triggers a RESOLVE UPDATE trigger at the subscriber database.

Top of page  VERIFY_THRESHOLD option

Function 

Controls which columns are verified when updates are replicated.

Allowed values 

Integer, in bytes

Default 

1000

Description 

This option is used by SQL Remote only. If the data type of a column is longer than the threshold, old values for the column are not verified when an UPDATE is replicated. This keeps the size of SQL Remote messages down, but has the disadvantage that conflicting updates of long values are not detected.

Top of page  WAIT_FOR_COMMIT option

Function 

Determines when foreign key integrity is checked, as data is manipulated.

Allowed Values 

ON or OFF

Scope 

Can be set for an individual connection or the PUBLIC group. Takes effect immediately.

Default 

OFF

Description 

If this option is set to ON, the database does not check foreign key integrity until the next COMMIT statement. Otherwise, all foreign keys that are not created with the CHECK ON COMMIT option are checked as they are inserted, updated or deleted.

Top of page  

Collection Contents Index Interactive SQL options CHAPTER 6.  SQL Language Elements pdf/chap5.pdf