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: Security Functions

set_appcontext()

The security function set_appcontext() sets "application context name", "application attribute name" and "application attribute value" for a user session. set_appcontext() is a so-called built-in function, provided by the Application Context Facility (ACF). It can only be executed by users with according privileges. User attempting to execute this function without correct privileges are presented with an error message and a return value of "-1". Users with correct privileges get a return value of "0" and the "application context attribute name".

Syntax of the Security Function set_appcontext()

    set_appcontext("context_name", "attribute_name", "attribute_value")
    

The parameters of the Security Function set_appcontext()

context_name
The parameter "context_name" is a placeholder for a row, specifying the "application context name". The parameter is stored as datatype char(30).

attribute_name
The parameter "attribute_name" is a placeholder for a row, specifying the "application context attribute name". The parameter is stored as datatype char(30).

attribute_value
The parameter "attribute_value" is a placeholder for a row, specifying the "application attribute value". The parameter is stored as datatype char(30).

Example for the Security Function set_appcontext()

    select set_appcontext("context_name_1", "attribut_1", "value_1")
go
-----
0

Sets a "context" called "context_name_1", with the attribute "attribut_1" and a value of "value_1".

    select set_appcontext("context_name_1", "attribut_1", "value_1")
go
-----
-1

When trying to set a "context", which has already been specified, i.e. when trying to overwrite an existing context, return value of "-1" is displayed. The same holds true when attempting to execute the function without correct privileges.

See also:

ASE T-SQL - Aggregate Functions,
get_appcontext(),
is_sec_service_on(),
list_appcontext(),
rm_appcontext(),
Security Functions,
show_sec_services().