Sybase System Functions

Sybase System functions are used to get special information from the database.

Syntax for System functions:

selectt function(“argument”)

Examples:
If we want to get user id of george, who is added to k2schools.

use k2schools
go
select user_id(“george”)
go

Sybase System Functions

Following are the System functions(daily used):

Function Argument Result
db_id database_name To get the database id number
db_name database_id To get the name using database id
object_id object_name TO get object id using object name
object_name object_ID To get object name using object id
suser_id server_user_name To get server user id from syslogins
suser_name server_user_id To get server user name
user_id user_name To get the user id
user_name user_id To get the user name

Other functions are: col_name,col_length,curunreservedpgs,data_pgs,datalength,host_id,host_name,index_col,isnull,lct_admin,reserved_pgs,rowcnt,tsequal,used_pgs,user,valid_user,valid_name

Powered by k2schools