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

get_appcontext()

The Security Function get_appcontext() returns "attribute_name" in the context of the given application. get_appcontext() is a so-called built-in function, which is provided by the Application Context Facility (ACF). It can only be executed by users with according privileges. Users trying to execute this function without according privileges, receive an error message and the return value "-1". Privileged users will receive the return value "0" or respectively the "application context attribute name".

Syntax of the Security Function get_appcontext()

    get_appcontext("context_name", "attribute_name")
    

Parameters of the Security Function get_appcontext()

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

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

Example for the Security Function get_appcontext()

    select get_appcontext("context_name_1", "attribute_name_1")
go
-----
attribute_value_1

In this example the attribute attribut_value_1 is returned.

    select get_appcontext("context_name_1", "attribute_name_1")
go
Select permission denied on built-in get_appcontext, database dbid
-----
-1

In this example the user is lacking correct privileges to execute the function. This is why the error message is returned with value "-1".

See also:

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