index

Package ab_donor_category

This package provides the Common Business interface for DONOR CATEGORY.
 
Each Advancement Constituent, either an Advancement Individual or an Advancement Organization, must have at least one Donor Category record.  There can be multiple Donor Category records per Individual or Organization.

Each Advancement Individual must have an Advancement Individual Information Base record.
Each Advancement Organization must have an Advancement Organization Information Base record.
Each Advancement Constituent must have Donor Category and Base Information records. 

Since there is no way to enforce these relationships through the database, this API will only allow the creation of Donor Category records in addition to the first record.  This API will not allow the removal of the last remaining Donor Category record.

The first Donor Category record must be created by calling AB_ADV_INDIVIDUAL.P_CREATE or AB_ADV_ORGANIZATION.P_CREATE.

The last Donor Category record can only be deleted by calling AB_ADV_INDIVIDUAL.P_DELETE or AB_ADV_ORGANIZATION.P_DELETE.


Program units
f_api_version   Returns the API version number.
f_exists   Checks to see if a record exists.
f_isequal   Compares two records for equality.
f_only_record   Checks to see if only one record exists.
f_query_all   Selects all records for the entity.
f_query_one   Selects one record using key.
f_query_by_rowid   Selects one record using 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.

Types
donor_category_rec  
donor_category_ref   Entity cursor variable type
donor_category_tab   Entity table type

Constants
M_ENTITY_NAME   Business Entity name


M_ENTITY_NAME

M_ENTITY_NAME    CONSTANT VARCHAR2(14) := 'DONOR_CATEGORY';

Business Entity name


donor_category_rec

TYPE donor_category_rec IS RECORD (
   r_pidm                    aprcatg.aprcatg_pidm%TYPE,
   r_donr_code               aprcatg.aprcatg_donr_code%TYPE,
   r_data_origin             aprcatg.aprcatg_data_origin%TYPE,
   r_user_id                 aprcatg.aprcatg_user_id%TYPE,
   r_internal_record_id      gb_common.internal_record_id_type);

donor_category_ref

TYPE donor_category_ref IS REF CURSOR RETURN donor_category_rec;

Entity cursor variable type


donor_category_tab

TYPE donor_category_tab IS TABLE OF donor_category_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_pidm      aprcatg.aprcatg_pidm%TYPE,
                  p_donr_code aprcatg.aprcatg_donr_code%TYPE,
                  p_rowid     VARCHAR2 DEFAULT NULL) RETURN VARCHAR2

Checks to see if a record exists.

Parameters
p_pidm   Internal system-generated identification number. NUMBER(8) Required Key
p_donr_code   Constituent donor classification(s).  Allows the institution to classify a constituent in multiple categories. VARCHAR2(4) Required Key
p_rowid   Database ROWID of record to select. VARCHAR(18)

Returns
Y if found, otherwise N.


f_isequal

Function f_isequal(rec_one donor_category_rec, rec_two donor_category_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 donor_category_rec Required
rec_two   The second record to compare. Type donor_category_rec Required

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


f_only_record

Function f_only_record(p_pidm aprcatg.aprcatg_pidm%TYPE) RETURN VARCHAR2

Checks to see if only one record exists.

Parameters
p_pidm   Internal system-generated identification number.

Returns
Y if found, otherwise N


f_query_all

Function f_query_all(p_pidm      aprcatg.aprcatg_pidm%TYPE,
                     p_donr_code aprcatg.aprcatg_donr_code%TYPE DEFAULT NULL)
  RETURN donor_category_ref

Selects all records for the entity.

Parameters
p_pidm   Internal system-generated identification number.
p_donr_code   Constituent donor classification(s).  Allows the institution to classify a constituent in multiple categories.

Returns
A cursor variable that will fetch the set of records


f_query_one

Function f_query_one(p_pidm      aprcatg.aprcatg_pidm%TYPE,
                     p_donr_code aprcatg.aprcatg_donr_code%TYPE)
  RETURN donor_category_ref

Selects one record using key.

Parameters
p_pidm   Internal system-generated identification number. NUMBER(8) Required Key
p_donr_code   Constituent donor classification(s).  Allows the institution to classify a constituent in multiple categories. VARCHAR2(4) 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 donor_category_ref

Selects one record using ROWID.

Parameters
p_rowid   Database Rowid of record to select. VARCHAR(18) Required

Returns
A cursor variable that will fetch exactly one record.


f_query_one_lock

Function f_query_one_lock(p_pidm      aprcatg.aprcatg_pidm%TYPE,
                          p_donr_code aprcatg.aprcatg_donr_code%TYPE,
                          p_rowid     VARCHAR2 DEFAULT NULL)
  RETURN donor_category_ref

Selects one record and locks it.

Parameters
p_pidm   Internal system_generated identification number. NUMBER(8) Required Key
p_donr_code   Constituent donor classification(s).  Allows the institution to classify a constituent in multiple categories. VARCHAR2(4) Required Key
p_rowid   Database ROWID of record to select. VARCHAR(18)

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


p_create

Procedure p_create(p_pidm        aprcatg.aprcatg_pidm%TYPE,
                   p_donr_code   aprcatg.aprcatg_donr_code%TYPE,
                   p_data_origin aprcatg.aprcatg_data_origin%TYPE DEFAULT NULL,
                   p_user_id     aprcatg.aprcatg_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_rowid_out   OUT VARCHAR2)

Creates a record.
Each Advancement Individual must have an Advancement Individual Information Base record.
Each Advancement Organization must have an Advancement Organization Information Base record.
Each Advancement Constituent must have Donor Category and Base Information record.

Since there is no way to enforce these relationships through the database, this API will only allow the creation of Donor Category records in addition to the first record.  The first Donor Category record must be created by calling AB_ADV_INDIVIDUAL.P_CREATE or AB_ADV_ORGANIZATION.P_CREATE.

Parameters
p_pidm   Internal system-generated identification number. NUMBER(8) Required Key
p_donr_code   Constituent donor classification(s).  Allows the institution to classify a constituent in multiple categories. VARCHAR2(4) Required Key
p_data_origin   Source system that generated or updated the data. VARCHAR2(30)
p_user_id   User who inserted or last update the data. VARCHAR2(30)
p_rowid_out   Database ROWID of record created. VARCHAR2(18) Required


p_delete

Procedure p_delete(p_pidm      aprcatg.aprcatg_pidm%TYPE,
                   p_donr_code aprcatg.aprcatg_donr_code%TYPE,
                   p_rowid     VARCHAR2 DEFAULT NULL)

Deletes a record.
Each Advancement Individual must have an Advancement Individual Information Base record.
Each Advancement Organization must have an Advancement Organization Information Base record.
Each Advancement Constituent must have Donor Category and Base Information record.

Since there is no way to enforce these relationships through the database, this API will not allow the removal of the last remaining Donor Category record.  The last Donor Category record can only be deleted by calling AB_ADV_INDIVIDUAL.P_DELETE or AB_ADV_ORGANIZATION.P_DELETE.

Parameters
p_pidm   Internal system-generated identification number. NUMBER(8) Required Key
p_donr_code   Constituent donor classification(s).  Allows the institution to classify a constituent in multiple categories. VARCHAR2(4) Required Key
p_rowid   Database ROWID of record to delete. VARCHAR(18)


p_lock

Procedure p_lock(p_pidm        aprcatg.aprcatg_pidm%TYPE,
                 p_donr_code   aprcatg.aprcatg_donr_code%TYPE,
                 p_rowid_inout IN OUT VARCHAR2)

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

Parameters
p_pidm   Internal system-generated identification number. NUMBER(8) Required Key
p_donr_code   Constituent donor classification(s).  Allows the institution to classify a constituent in multiple categories. VARCHAR2(4) Required Key
p_rowid_inout   Database ROWID of record to lock. VARCHAR(18) Required