Name

ADD_POLICY

Synopsis

This procedure adds an RLS policy on a table.

   

Oracle Database version

Parameter name

Datatype

Description

9i

10g

object_schema

VARCHAR2

Owner of the table on which the RLS policy is placed. Default is the current user.

Yes

Yes

object_name

VARCHAR2

Name of the table on which the RLS policy is placed.

Yes

Yes

policy_name

VARCHAR2

Name of the RLS policy being created.

Yes

Yes

function_schema

VARCHAR2

Owner of the policy function. This function produces the predicate that is applied to the query to restrict rows. Default is the current user.

Yes

Yes

policy_function

VARCHAR2

Name of the policy function.

Yes

Yes

statement_types

VARCHAR2

Types of statements to which this policy is applied—SELECT, INSERT, UPDATE, and/or DELETE. Default is all. In Oracle Database 10g Release 2, a new type, INDEX, is also available.

Yes

Yes

update_check

BOOLEAN

Possible values—TRUE or FALSE. If set to TRUE, the policy makes sure that the user sees the rows even after the change. Default is FALSE.

Yes

Yes

enable

BOOLEAN

Possible values—TRUE or FALSE. Indicates whether the policy is enabled.

Yes

Yes

static_policy

BOOLEAN

Included if the policy is static.

Yes

Yes

policy_type

BINARY_INTEGER

Dynamism of the policy; STATIC, SHARED_STATIC, CONTEXT_SENSITIVE, SHARED_ CONTEXT_SENSITIVE, or DYNAMIC. Prefix with DBMS_RLS, as in POLICY_TYPE=> DBMS_RLS. STATIC. Default is DYNAMIC.

No

Yes

long_predicate

BOOLEAN

If the length of the predicate ...

Get Oracle PL/SQL for DBAs now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.