set_appcontext

Sets an application context name, attribute name, and attribute value for a user session, defined by the attributes of a specified application. set_appcontext is a provided by the ACF.

Syntax

set_appcontext(“context_name, “attribute_name”, “attribute_value”)

Parameters

Examples

Usage

  • set_appcontext returns 0 for success and -1 for failure.

  • If you set values that already exist in the current session, set_appcontext returns -1.

  • This function cannot override the values of an existing application context. To assign new values to a context, remove the context and re-create it using new values.

  • set_appcontext saves attributes as char datatypes. If you are creating an access rule that must compare the attribute value to another datatype, the rule should convert the char data to the appropriate datatype.

  • All the 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 set_appcontext differ based on your granular permissions settings.

Granular PermissionsDescription
Enabled

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

Disabled

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

Related reference
get_appcontext
list_appcontext
rm_appcontext