System functions return system information.
Table 5-9 lists the system functions and their parameters.
System function |
Parameters |
---|---|
COL_LENGTH |
( table-name, column-name ) |
COL_NAME |
( table-id, column-id [ ,database-id ] ) |
CONNECTION_PROPERTY |
( { property-id | property-name } ... [ , connection-id ] ) |
DATALENGTH |
( expression ) |
DB_ID |
( [ database-name ] ) |
DB_NAME |
( [ database-id ] ) |
DB_PROPERTY |
( { property-id | property-name } ... [,{database-id | database-name } ] ) |
EVENT_CONDITION |
( condition-name ) |
EVENT_CONDITION_NAME |
( integer ) |
EVENT_PARAMETER |
( context-name ) |
INDEX_COL |
( table-name, index-id, key_# [ ,user-id ] ) |
NEXT_CONNECTION |
( { NULL | connection-id } ) |
NEXT_DATABASE |
( { NULL | database-id } ) |
OBJECT_ID |
( object-name ) |
OBJECT_NAME |
( object-id [, database-id ] ) |
PROPERTY |
( { property-number | property-name } ) |
PROPERTY_DESCRIPTION |
( { property-number | property-name } ) |
PROPERTY_NAME |
( property-number ) |
PROPERTY_NUMBER |
( property-name ) |
SUSER_ID |
( [ user-name ] ) |
SUSER_NAME |
( [ user-id ] ) |
USER_ID |
( [ user-name ] ) |
USER_NAME |
( [ user-id ] ) |
Databases currently running on a server are identified by a database name and a database ID number. The db_id and db_name functions provide information on these values.
A set of system functions provides information about properties of a currently running database, or of a connection, on the database server. These system functions take the database name or ID, or the connection name, as an optional argument to identify the database or connection for which the property is requested.
System functions are processed differently from other Sybase IQ functions. For this reason, when queries to Sybase IQ tables include system functions their performance is reduced.
Table 5-10 shows the Adaptive Server Enterprise system functions and their status in Sybase IQ:
Function |
Status |
---|---|
col_length |
Implemented |
col_name |
Implemented |
db_id |
Implemented |
db_name |
Implemented |
index_col |
Implemented |
object_id |
Implemented |
object_name |
Implemented |
proc_role |
Always returns 0 |
show_role |
Always returns NULL |
tsequal |
Not implemented |
user_id |
Implemented |
user_name |
Implemented |
suser_id |
Implemented |
suser_name |
Implemented |
datalength |
Implemented |
curunreservedpgs |
Not implemented |
data_pgs |
Not implemented |
host_id |
Not implemented |
host_name |
Not implemented |
lct_admin |
Not implemented |
reserved_pgs |
Not implemented |
rowcnt |
Not implemented |
used_pgs |
Not implemented |
valid_name |
Not implemented |
valid_user |
Not implemented |
Some of the system functions are implemented in Sybase IQ as system stored procedures.
The db_id, db_name, datalength, suser_id, and suser_name functions are implemented as built-in functions.