index

Package gb_pii_tables

This package provides the Common Business interface for the gb_pii_tables API.
 
GORFDPI: (FGAC PII Tables).
FGAC PII processing is centralized in the GOKFGAC package.
PII Table Rules define the policies for each PII domain.
PII Table Rules may be set up in advance and enabled with the Active indicator.  The driver table should have a SQL statement specified.  When a Table Rule is made active (Active indicator is 'Y') or inactive (Active indicator is 'N'), the DBMS_RLS set context function will enable or disable the policies in that domain.
After PII Table Rules have been created, the policies must be added to the database with gorfdpl.sql.  This script creates the respective "_SEL" (select), "_INS" (insert), "_UPD" (update) and "_DEL" (delete) records in dba_policies.  Only one policy may exist per table.
 
FGAC PII processing is centralized in the GOKFGAC package.
The benefit of this approach to securing data access and manipulation to authorized users only is that it is completely table-driven.


Program units
f_api_version   Returns the API version number.
f_exists   Checks to see if a record exists.
f_exists   Checks to see if a record exists.
f_sys_req   Checks to see if a record is system required.
f_isequal   Compares two records for equality.
f_query_all   Selects all records for the entity.
f_query_one   Selects one record using the key.
f_query_by_rowid   Selects one record using the ROWID.
f_query_one_lock   Selects one record and locks it.
p_create   Creates a record.
p_delete   Deletes a record.
p_lock   Locks a record.
p_update   Updates a record.

Types
pii_tables_rec   Entity record type.
pii_tables_ref   Entity cursor variable type.
pii_tables_tab   Entity table type.

Constants
M_ENTITY_NAME   Business Entity name.


M_ENTITY_NAME

M_ENTITY_NAME    CONSTANT VARCHAR2(10) := 'PII_TABLES';

Business Entity name.


pii_tables_rec

TYPE pii_tables_rec IS RECORD (
   r_table_name              gorfdpi.gorfdpi_table_name%TYPE,
   r_column_name     gorfdpi.gorfdpi_column_name%TYPE,
   r_sys_req_ind             gorfdpi.gorfdpi_sys_req_ind%TYPE,
   r_active_ind              gorfdpi.gorfdpi_active_ind%TYPE,
   r_user_id                 gorfdpi.gorfdpi_user_id%TYPE,
   r_driver_sql              gorfdpi.gorfdpi_driver_sql%TYPE,
   r_internal_record_id      gb_common.internal_record_id_type);

Entity record type.


pii_tables_ref

TYPE pii_tables_ref IS REF CURSOR RETURN pii_tables_rec;

Entity cursor variable type.


pii_tables_tab

TYPE pii_tables_tab IS TABLE OF pii_tables_rec INDEX BY BINARY_INTEGER;

Entity table type.


f_api_version

FUNCTION f_api_version RETURN PLS_INTEGER

Returns the API version number.

Returns
Version of the API signature. Changes only when the signature changes.


f_exists

FUNCTION f_exists(p_table_name  gorfdpi.gorfdpi_table_name%TYPE,
                  p_column_name gorfdpi.gorfdpi_column_name%TYPE,
                  p_rowid       VARCHAR2 DEFAULT NULL) RETURN VARCHAR2

Checks to see if a record exists.

Parameters
p_table_name   Table name that the policy covers. VARCHAR2(30) Required Key.
p_column_name   Column name that the policy covers. VARCHAR2(30) Required Key.
p_rowid   Database ROWID of the record to be selected. VARCHAR(18).

Returns
Y if found, otherwise N.


f_exists

FUNCTION f_exists(p_table_name  gorfdpi.gorfdpi_table_name%TYPE,
                  p_column_name gorfdpi.gorfdpi_column_name%TYPE,
                  p_sys_req_ind gorfdpi.gorfdpi_sys_req_ind%TYPE,
                  p_active_ind  gorfdpi.gorfdpi_active_ind%TYPE,
                  p_user_id     gorfdpi.gorfdpi_user_id%TYPE DEFAULT gb_common.f_sct_user,
                  p_driver_sql  gorfdpi.gorfdpi_driver_sql%TYPE DEFAULT NULL,
                  p_rowid       VARCHAR2 DEFAULT NULL) RETURN VARCHAR2

Checks to see if a record exists.

Parameters
p_table_name   Table name that the policy covers. VARCHAR2(30) Required Key.
p_column_name   Column name that the policy covers. VARCHAR2(30) Required Key.
p_sys_req_ind   Indicates whether or not this domain is system required. VARCHAR2(1) Required.
p_active_ind   Indicates if the policy is active ('Y') or inactive ('N'). VARCHAR2(1) Required.
p_user_id   Oracle ID of the user who created or last updated the record. VARCHAR2(30).
p_driver_sql   SQL statement that contains the SQL statement to execute the PII procedure. VARCHAR2(2000).
p_rowid   Database ROWID of the record to be created. VARCHAR(18).


f_sys_req

FUNCTION f_sys_req(p_table_name  gorfdpi.gorfdpi_table_name%TYPE,
                   p_column_name gorfdpi.gorfdpi_column_name%TYPE,
                   p_rowid       VARCHAR2 DEFAULT NULL) RETURN VARCHAR2

Checks to see if a record is system required.

Parameters
p_table_name   Table name that the policy covers.  VARCHAR2(30) Required Key.
p_column_name   Column name that the policy covers. VARCHAR2(30) Required Key.

Returns
Y if found, otherwise N.


f_isequal

FUNCTION f_isequal(rec_one pii_tables_rec,
                   rec_two pii_tables_rec) RETURN VARCHAR2

Compares two records for equality.
Tests each field of rec_one against the corresponding field of rec_two.
Two null values are considered equal.

Parameters
rec_one   The first record to compare. Type pii_tables_rec Required.
rec_two   The second record to compare. Type pii_tables_rec Required.

Returns
Y if all values in records are equal, otherwise N. Nulls match Nulls.


f_query_all

FUNCTION f_query_all(p_table_name gorfdpi.gorfdpi_table_name%TYPE)
  RETURN pii_tables_ref

Selects all records for the entity.

Parameters
p_table_name   Table name that the policy covers. VARCHAR2(30) Required Key.

Returns
A cursor variable that will fetch the set of records.


f_query_one

FUNCTION f_query_one(p_table_name  gorfdpi.gorfdpi_table_name%TYPE,
                     p_column_name gorfdpi.gorfdpi_column_name%TYPE)
  RETURN pii_tables_ref

Selects one record using the key.

Parameters
p_table_name   Table name that the policy covers. VARCHAR2(30) Required Key.
p_column_name   Column name that the policy covers. VARCHAR2(30) Required Key.

Returns
A cursor variable that will fetch exactly one record.


f_query_by_rowid

FUNCTION f_query_by_rowid(p_rowid VARCHAR2) RETURN pii_tables_ref

Selects one record using the ROWID.

Parameters
p_rowid   Database ROWID of the record to be selected. VARCHAR(18) Required.

Returns
A cursor variable that will fetch exactly one record.


f_query_one_lock

FUNCTION f_query_one_lock(p_table_name  gorfdpi.gorfdpi_table_name%TYPE,
                          p_column_name gorfdpi.gorfdpi_column_name%TYPE,
                          p_rowid       VARCHAR2 DEFAULT NULL)
  RETURN pii_tables_ref

Selects one record and locks it.

Parameters
p_table_name   Table name that the policy covers. VARCHAR2(30) Required Key.
p_column_name   Column name that the policy covers. VARCHAR2(30) Required Key.
p_rowid   Database ROWID of the record to be selected. VARCHAR(18).

Returns
A cursor variable for one record, locking the record.


p_create

PROCEDURE p_create(p_table_name  gorfdpi.gorfdpi_table_name%TYPE,
                   p_column_name gorfdpi.gorfdpi_column_name%TYPE,
                   p_sys_req_ind gorfdpi.gorfdpi_sys_req_ind%TYPE DEFAULT 'N',
                   p_active_ind  gorfdpi.gorfdpi_active_ind%TYPE DEFAULT 'N',
                   p_user_id     gorfdpi.gorfdpi_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_driver_sql  gorfdpi.gorfdpi_driver_sql%TYPE DEFAULT NULL,
                   p_rowid_out   OUT VARCHAR2)

Creates a record.
Defines the policy for a PII domain and activates it.

Parameters
p_table_name   Table name that the policy covers. VARCHAR2(30) Required Key.
p_column_name   Column name that the policy covers. VARCHAR2(30) Required Key.
p_sys_req_ind   Indicates whether or not this domain is system required. VARCHAR2(1) Required.
p_active_ind   Indicates if the policy is active ('Y') or inactive ('N'). VARCHAR2(1) Required.
p_user_id   Oracle ID of the user who created or last updated the record. VARCHAR2(30) Required.
p_driver_sql   SQL statement that contains the SQL statement to execute the PII procedure. VARCHAR2(2000).
p_rowid_out   Database ROWID of the record being created. VARCHAR(18) Required.


p_delete

PROCEDURE p_delete(p_table_name  gorfdpi.gorfdpi_table_name%TYPE,
                   p_column_name gorfdpi.gorfdpi_column_name%TYPE,
                   p_rowid       VARCHAR2 DEFAULT NULL)

Deletes a record.
System required records are delivered by Sungard SCT and cannot be deleted.

Parameters
p_table_name   Table name that the policy covers. VARCHAR2(30) Required Key.
p_column_name   Column name that the policy covers. VARCHAR2(30) Required Key.
p_rowid   Database ROWID of the record being deleted. VARCHAR(18).


p_lock

PROCEDURE p_lock(p_table_name  gorfdpi.gorfdpi_table_name%TYPE,
                 p_column_name gorfdpi.gorfdpi_column_name%TYPE,
                 p_rowid_inout IN OUT VARCHAR2)

Locks a record.
If the ROWID is not passed in, the record is located using the key values and the ROWID of the locked row is passed out as p_rowid_inout.

Parameters
p_table_name   Table name that the policy covers. VARCHAR2(30) Required Key.
p_column_name   Column name that the policy covers. VARCHAR2(30) Required Key.
p_rowid_inout   Database ROWID of the record to be locked. VARCHAR(18) Required.


p_update

PROCEDURE p_update(p_table_name  gorfdpi.gorfdpi_table_name%TYPE,
                   p_column_name gorfdpi.gorfdpi_column_name%TYPE,
                   p_sys_req_ind gorfdpi.gorfdpi_sys_req_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_active_ind  gorfdpi.gorfdpi_active_ind%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_user_id     gorfdpi.gorfdpi_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_driver_sql  gorfdpi.gorfdpi_driver_sql%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_rowid       VARCHAR2 DEFAULT NULL)

Updates a record.
System Required records are delivered by Sungard SCT and cannot be updated except for the Active indicator.

Parameters
p_table_name   Table name that the policy covers. VARCHAR2(30) Required Key.
p_column_name   Column name that the policy covers. VARCHAR2(30) Required Key.
p_sys_req_ind   Indicates whether or not this domain is system required. VARCHAR2(1) Required.
p_active_ind   Indicates if the policy is active ('Y') or inactive ('N'). VARCHAR2(1) Required.
p_user_id   Oracle ID of the user who created or last updated the record. VARCHAR2(30) Required.
p_driver_sql   SQL statement that contains the SQL statement to execute the PII procedure. VARCHAR2(2000).
p_rowid   Database ROWID of the record to be updated. VARCHAR(18).