get_appcontext

Description

Returns the value of the attribute in a specified context. get_appcontext is a built-in function provided by the Application Context Facility (ACF). For more information on the ACF see "Row Level Access Control," in the System Administration Guide.

Syntax

get_appcontext (“context_name”, “attribute_name”)

Parameters

context_name

is a row specifying an application context name. It is saved as datatype char(30).

attribute_name

is a row specifying an application context attribute name. It is saved as datatype char(30).

Examples

Example 1

Shows VALUE1 returned for ATTR1.

select get_appcontext("CONTEXT1", "ATTRI1")

--------------
VALUE1

ATTR1 does not exist in CONTEXT2:

select get_appcontext("CONTEXT2", "ATTR1")

Example 2

Shows the result when a user without appropriate permissions attempts to get the application context.

select get_appcontext("CONTEXT1", "ATTR2", "VALUE1")

Select permission denied on built-in get_appcontext, database dbid
-----------
-1

Usage

Standards

SQL92 – Compliance level: Transact-SQL extension.

Permissions

Permissions depend on the user profile and the application profile, and are stored by ACF.

See also

Functions get_appcontext, list_appcontext, rm_appcontext, set_appcontext