get_appcontext

Returns the value of the attribute in a specified context. get_appcontext is provided by the Application Context Facility (ACF).

Syntax

get_appcontext (“context_name”, “attribute_name”)

Parameters

Examples

Usage

  • This function returns 0 for success and -1 for failure.

  • If the attribute you require does not exist in the application context, get_appcontext returns NULL.

  • get_appcontext saves attributes as char datatypes. If you are creating an access rule that compares the attribute value to other datatypes, the rule should convert the char data to the appropriate datatype.

  • All arguments for this function are required.

  • For more information on the ACF, see Row-Level Access Control in System Administration Guide.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

The permission checks for get_appcontext differ based on your granular permissions settings.

Granular PermissionsDescription
Enabled

With granular permissions enabled, you must have select permission on get_appcontext to execute the function.

Disabled

With granular permissions disabled, you must have select permission on get_appcontext or be a user with sa_role to execute the function.

Related reference
get_appcontext
list_appcontext
rm_appcontext
set_appcontext