Adaptive Server Enterprise Global Variables Supported in Sybase IQ

This table includes all Adaptive Server Enterprise global variables that are supported in Sybase IQ. Adaptive Server Enterprise global variables that are not supported by Sybase IQ are not included in the list.

This list includes all global variables that return a value, including those for which the value is fixed at NULL, 1, -1, or 0, and might not be meaningful.

Adaptive Server Enterprise global variables supported in Sybase IQ

Global variable

Returns

@@char_convert

Returns 0.

@@client_csname

In Adaptive Server Enterprise, the client’s character set name. Set to NULL if client character set has never been initialized; otherwise, contains the name of the most recently used character set. Returns NULL in Sybase IQ.

@@client_csid

In Adaptive Server Enterprise, the client’s character set ID. Set to -1 if client character set has never been initialized; otherwise, contains the most recently used client character set ID from syscharsets. Returns -1 in Sybase IQ.

@@connections

The number of logins since the server was last started.

@@cpu_busy

In Adaptive Server Enterprise, the amount of time, in ticks, that the CPU has spent performing Adaptive Server Enterprise work since the last time Adaptive Server Enterprise was started. In Sybase IQ, returns 0.

@@error

Commonly used to check the error status (succeeded or failed) of the most recently executed statement. Contains 0 if the previous transaction succeeded; otherwise, contains the last error number generated by the system. A statement such as:

if @@error != 0 return

causes an exit if an error occurs. Every statement resets @@error, including PRINT statements or IF tests, so the status check must immediately follow the statement whose success is in question.

@@identity

In Adaptive Server Enterprise, the last value inserted into an IDENTITY column by an INSERT, LOAD, or SELECT INTO statement. @@identity is reset each time a row is inserted into a table. If a statement inserts multiple rows, @@identity reflects the IDENTITY value for the last row inserted. If the affected table does not contain an IDENTITY column, @@identity is set to 0. The value of @@identity is not affected by the failure of an INSERT or SELECT INTO statement, or the rollback of the transaction that contained the failed statement. @@identity retains the last value inserted into an IDENTITY column, even if the statement that inserted that value fails to commit.

@@idle

In Adaptive Server Enterprise, the amount of time, in ticks, that Adaptive Server Enterprise has been idle since the server was last started. In Sybase IQ, returns 0.

@@io_busy

In Adaptive Server Enterprise, the amount of time, in ticks, that Adaptive Server Enterprise has spent performing input and output operations since the server was last started. In Sybase IQ, returns 0.

@@isolation

Current isolation level of the connection. In Adaptive Server Enterprise, @@isolation takes the value of the active level.

@@langid

In Adaptive Server Enterprise, defines the local language ID of the language currently in use. In Sybase IQ, returns 0.

@@language

In Adaptive Server Enterprise, defines the name of the language currently in use. In Sybase IQ, returns “English”.

@@maxcharlen

In Adaptive Server Enterprise, maximum length, in bytes, of a character in the Adaptive Server Enterprise default character set. In Sybase IQ, returns 1.

@@max_ connections

For the network server, the maximum number of active clients (not database connections, as each client can support multiple connections). For Adaptive Server Enterprise, the maximum number of connections to the server.

@@ncharsize

In Adaptive Server Enterprise, average length, in bytes, of a national character. In Sybase IQ, returns 1.

@@nestlevel

In Adaptive Server Enterprise, nesting level of current execution (initially 0). Each time a stored procedure or trigger calls another stored procedure or trigger, the nesting level is incremented. In Sybase IQ, returns -1.

@@pack_received

In Adaptive Server Enterprise, number of input packets read by Adaptive Server Enterprise since the server was last started. In Sybase IQ, returns 0.

@@pack_sent

In Adaptive Server Enterprise, number of output packets written by Adaptive Server Enterprise since the server was last started. In Sybase IQ, returns 0.

@@packet_errors

In Adaptive Server Enterprise, number of errors that have occurred while Adaptive Server Enterprise was sending and receiving packets. In Sybase IQ, returns 0.

@@procid

Stored procedure ID of the currently executing procedure.

@@servername

Name of the local Adaptive Server Enterprise or Sybase IQ server.

@@spid

In Adaptive Server Enterprise, server process ID number of the current process. In Sybase IQ, the connection handle for the current connection. This is the same value as that displayed by the sa_conn_info procedure.

@@sqlstatus

Contains status information resulting from the last FETCH statement. @@sqlstatus may contain the following values:

  • 0 – the FETCH statement completed successfully.

  • 1 – the FETCH statement resulted in an error.

  • 2 – there is no more data in the result set.

@@thresh_hysteresis

In Adaptive Server Enterprise, change in free space required to activate a threshold. In Sybase IQ, returns 0.

@@timeticks

In Adaptive Server Enterprise, number of microseconds per tick. The amount of time per tick is machine-dependent. In Sybase IQ, returns 0.

@@total_errors

In Adaptive Server Enterprise, number of errors that have occurred while Adaptive Server Enterprise was reading or writing. In Sybase IQ, returns 0.

@@total_read

In Adaptive Server Enterprise, number of disk reads by Adaptive Server Enterprise since the server was last started. In Sybase IQ, returns 0.

@@total_write

In Adaptive Server Enterprise, number of disk writes by Adaptive Server Enterprise since the server was last started. In Sybase IQ, returns 0.

@@tranchained

Current transaction mode of the Transact-SQL program. @@tranchained returns 0 for unchained or 1 for chained.

@@trancount

Nesting level of transactions. Each BEGIN TRANSACTION in a batch increments the transaction count.

@@transtate

In Adaptive Server Enterprise, current state of a transaction after a statement executes. In Sybase IQ, returns -1.

@@version

Information about the current version of Adaptive Server Enterprise or Sybase IQ.