System functions

Function

System functions return system information.

Table 5-10 lists the system functions and their parameters.

Table 5-10: System functions

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 )

GROUP_MEMBER

( group-name-string-expression [ , user-name-string-expression ] )

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 ] )

Description

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.

Performance

System functions are processed differently than other Sybase IQ functions. For this reason, when queries to Sybase IQ tables include system functions, their performance is reduced.

Compatibility

Table 5-11 shows the Adaptive Server Enterprise system functions and their status in Sybase IQ:

Table 5-11: Status of ASE system functions 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

Notes