A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  special characters  sybase-tech-blog


Category: ASE: Functions: System Functions

lockscheme()

The system function lockscheme() returns a string of datatype varchar (11), containing the lock scheme of a database object, specified in the parameter of the function. Possible return values are "allpages", "datapages", "datarows" "not a table", or "NULL". The function lockscheme() is a T-SQL extension. It can be executed by any Sie kann von jedem user.

Syntax of the System Function lockscheme()

    lockscheme(table_name|table_id [,dbid])
    

The parameters of the System Function lockscheme()

"table_name"
The parameter "table_name" is the name of an object, for which the lock scheme shall be determined. The object must of the type table. For any other object types, the function lockscheme will return the string "not a table". If no fully qualified table name is specified (following the pattern: "db.owner.object"), the function lockscheme expects the table in the current database. If this is not the case the return value will be "NULL". The name of a table is stored in the column "name" of the system table sysobjects. The value of the parameter "table_name" must be set in quotes. It can be specified fully qualified, i.e. in connection with database name and object owner. "table_id"
The parameter "table_id" is the identification number of the table, for which the lock scheme shall be returned. The identification number of a table is stored in the column "id" of the system table sysobjects. "dbid"
The parameter "dbid" describes the identification number of the database in which the object, for which the lock scheme shall be determined, is stored. This id must be specified, if the object is not stored in the database currently in use. The "dbid" is stored in the column "dbid" of the system table sysdatabases.

Example for the System Function lockscheme()

    select lockscheme("titles")
                               
    ------------------------------ 
    allpages      
    

Returns the lock scheme of the table "titles", in this case the table uses "allpages" locking.

    select lockscheme("titels_view")
                               
    ------------------------------ 
    not a table                    
    

The object queried is a view. Therefore, the return value of the function lockscheme is "not a table".

See also:

ASE T-SQL - Aggregate Functions,
audit_event_name(),
col_length(),
col_name(),
curunreservedpgs(),
datachange(),
datalength(),
data_pages(),
data_pgs(),
db_id(),
db_name(),
host_id(),
host_name(),
identity(),
index_col(),
index_colorder(),
isnull(),
lct_admin(),
license_enabled(),
next_identity(),
object_id(),
object_name(),
pagesize(),
pointer_size(),
ptn_data_pgs(),
reserved_pages(),
reserved_pgs(),
rowcnt(),
row_count(),
showplan_in_xml(),
syb_sendmsg(),
syb_sendmsg(),
System Functions,
tempdb_id(),
tran_dumpable_status(),
tsequal(),
used_pages(),
used_pgs().