rm_appcontext

Description

Removes a specific application context, or all application contexts. rm_appcontext is provided by the ACF.

Syntax

rm_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

Removes an application context by specifying some or all attributes:

select rm_appcontext("CONTEXT1", "*")
----------
0
select rm_appcontext("*", "*")
---------
0
select rm_appcontext("NON_EXISTING_CTX","ATTR")
---------
-1

Example 2

Shows the result when a user without appropriate permissions attempts to remove an application context:

select rm_appcontext("CONTEXT1","ATTR2")
----------
-1

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

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

Granular permissions enabled

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

Granular permissions disabled

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

See also

For more information on the ACF see “Row-level access control” in Chapter 11, “Managing User Permissions” of the System Administration Guide.

Functions get_appcontext, list_appcontext, set_appcontext