index

Package ab_project_history

This package provides the Common Business interface for the Project History API (ab_project_history).

Each time a change is made to a Prospects Project Repeating table (amrprop) record, the previous values will be stored in a Prospects Proposal History Repeating Table (amrprph) record.

All data values from the record before the changes were made will be stored in these history records.
Each field in the amrprph table has an associated 'change indicator'.  This field will contain a 'Y' if the value was changed on the current record and an 'N' if the field was not changed.


Program units
f_api_version   Returns the API version number.
f_exists   Checks if a record exists.
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.

Types
project_history_rec   Business Entity record type
project_history_ref   Entity cursor variable type
project_history_tab   Entity table type

Constants
M_ENTITY_NAME   Business Entity name
M_BASE_TABLE_NAME   Base table name


M_ENTITY_NAME

M_ENTITY_NAME        CONSTANT VARCHAR2(15) := 'PROJECT_HISTORY';

Business Entity name


M_BASE_TABLE_NAME

M_BASE_TABLE_NAME    CONSTANT VARCHAR2(7) := 'AMRPRPH';

Base table name


project_history_rec

TYPE project_history_rec IS RECORD (
  r_pidm                    amrprph.amrprph_pidm%TYPE,
  r_prop_code               amrprph.amrprph_prop_code%TYPE,
  r_prop_seq_no             amrprph.amrprph_prop_seq_no%TYPE,
  r_proj_code               amrprph.amrprph_proj_code%TYPE,
  r_seq_no                  amrprph.amrprph_seq_no%TYPE,
  r_user_id                 amrprph.amrprph_user_id%TYPE,
  r_data_origin             amrprph.amrprph_data_origin%TYPE,
  r_givh_code_chg_ind       amrprph.amrprph_givh_code_chg_ind%TYPE,
  r_givh_code               amrprph.amrprph_givh_code%TYPE,
  r_target_ask_amt_chg_ind  amrprph.amrprph_target_ask_amt_chg_ind%TYPE,
  r_target_ask_amount       amrprph.amrprph_target_ask_amount%TYPE,
  r_target_ask_dte_chg_ind  amrprph.amrprph_target_ask_dte_chg_ind%TYPE,
  r_target_ask_date         amrprph.amrprph_target_ask_date%TYPE,
  r_prst_code_chg_ind       amrprph.amrprph_prst_code_chg_ind%TYPE,
  r_prst_code               amrprph.amrprph_prst_code%TYPE,
  r_prst_date_chg_ind       amrprph.amrprph_prst_date_chg_ind%TYPE,
  r_prst_date               amrprph.amrprph_prst_date%TYPE,
  r_proj_from_date_chg_ind  amrprph.amrprph_proj_from_date_chg_ind%TYPE,
  r_proj_eff_from_date      amrprph.amrprph_proj_eff_from_date%TYPE,
  r_proj_to_date_chg_ind    amrprph.amrprph_proj_to_date_chg_ind%TYPE,
  r_proj_eff_to_date        amrprph.amrprph_proj_eff_to_date%TYPE,
  r_proj_text_chg_ind       amrprph.amrprph_proj_text_chg_ind%TYPE,
  r_proj_text               amrprph.amrprph_proj_text%TYPE,
  r_frbprop_code_chg_ind    amrprph.amrprph_frbprop_code_chg_ind%TYPE,
  r_frbprop_code            amrprph.amrprph_frbprop_code%TYPE,
  r_internal_record_id      gb_common.internal_record_id_type);

Business Entity record type


project_history_ref

TYPE project_history_ref IS REF CURSOR RETURN project_history_rec;

Entity cursor variable type


project_history_tab

TYPE project_history_tab IS TABLE OF project_history_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        amrprph.amrprph_pidm%TYPE,
                  p_prop_code   amrprph.amrprph_prop_code%TYPE,
                  p_prop_seq_no amrprph.amrprph_prop_seq_no%TYPE,
                  p_proj_code   amrprph.amrprph_proj_code%TYPE,
                  p_seq_no      amrprph.amrprph_seq_no%TYPE,
                  p_rowid       gb_common.internal_record_id_type DEFAULT NULL)
  RETURN VARCHAR2

Checks if a record exists.

Parameters
p_pidm   The internal system generated ID number of a Prospect. NUMBER(8) Required Key
p_prop_code   The Proposal code which is associated to the Prospect. VARCHAR2(24) Required Key
p_prop_seq_no   The sequence number of the Proposal code which is associated to the Prospect. VARCHAR2(24) Required Key
p_proj_code   The Project code which is being associated to the Proposal. VARCHAR2(24) Required Key
p_seq_no   The sequence number of the history for the Project. NUMBER(3) Required Key
p_rowid   Database ROWID of the record to be selected. VARCHAR2(18)

Returns
Y if found, otherwise N.


f_isequal

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

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


f_query_all

Function f_query_all(p_pidm        amrprph.amrprph_pidm%TYPE,
                     p_prop_code   amrprph.amrprph_prop_code%TYPE,
                     p_prop_seq_no amrprph.amrprph_prop_seq_no%TYPE,
                     p_proj_code   amrprph.amrprph_proj_code%TYPE)
  RETURN project_history_ref

Selects all records for the entity.

Parameters
p_pidm   The internal system generated ID number of a Prospect. NUMBER(8) Required Key
p_prop_code   The Proposal code which is associated to the Prospect. VARCHAR2(24) Required Key
p_prop_seq_no   The sequence number of the Proposal code which is associated to the Prospect. VARCHAR2(24) Required Key
p_proj_code   The Project code which is being associated to the Proposal. VARCHAR2(24) Required Key
p_seq_no   The sequence number of the history for the Project. NUMBER(3) Required Key

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


f_query_one

Function f_query_one(p_pidm        amrprph.amrprph_pidm%TYPE,
                     p_prop_code   amrprph.amrprph_prop_code%TYPE,
                     p_prop_seq_no amrprph.amrprph_prop_seq_no%TYPE,
                     p_proj_code   amrprph.amrprph_proj_code%TYPE,
                     p_seq_no      amrprph.amrprph_seq_no%TYPE)
  RETURN project_history_ref

Selects one record using the key.

Parameters
p_pidm   The internal system generated ID number of a Prospect. NUMBER(8) Required Key
p_prop_code   The Proposal code which is associated to the Prospect. VARCHAR2(24) Required Key
p_prop_seq_no   The sequence number of the Proposal code which is associated to the Prospect. VARCHAR2(24) Required Key
p_proj_code   The Project code which is being associated to the Proposal. VARCHAR2(24) Required Key
p_seq_no   The sequence number of the history for the Project. NUMBER(3) Required Key

Returns
A cursor variable that will fetch exactly one record.


f_query_by_rowid

Function f_query_by_rowid(p_rowid gb_common.internal_record_id_type)
  RETURN project_history_ref

Selects one record using the ROWID.

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

Returns
A cursor variable that will fetch exactly one record.


f_query_one_lock

Function f_query_one_lock(p_pidm        amrprph.amrprph_pidm%TYPE,
                          p_prop_code   amrprph.amrprph_prop_code%TYPE,
                          p_prop_seq_no amrprph.amrprph_prop_seq_no%TYPE,
                          p_proj_code   amrprph.amrprph_proj_code%TYPE,
                          p_seq_no      amrprph.amrprph_seq_no%TYPE,
                          p_rowid       gb_common.internal_record_id_type DEFAULT NULL)
  RETURN project_history_ref

Selects one record and locks it.

Parameters
p_pidm   The internal system generated ID number of a Prospect. NUMBER(8) Required Key
p_prop_code   The Proposal code which is associated to the Prospect. VARCHAR2(24) Required Key
p_prop_seq_no   The sequence number of the Proposal code which is associated to the Prospect. VARCHAR2(24) Required Key
p_proj_code   The Project code which is being associated to the Proposal. VARCHAR2(24) Required Key
p_seq_no   The sequence number of the history for the Project. NUMBER(3) Required Key
p_rowid   Database ROWID of the record to be selected. VARCHAR2(18)

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


p_create

Procedure p_create(p_pidm                   amrprph.amrprph_pidm%TYPE,
                   p_prop_code              amrprph.amrprph_prop_code%TYPE,
                   p_prop_seq_no            amrprph.amrprph_prop_seq_no%TYPE,
                   p_proj_code              amrprph.amrprph_proj_code%TYPE,
                   p_seq_no                 amrprph.amrprph_seq_no%TYPE,
                   p_user_id                amrprph.amrprph_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_data_origin            amrprph.amrprph_data_origin%TYPE,
                   p_givh_code_chg_ind      amrprph.amrprph_givh_code_chg_ind%TYPE DEFAULT NULL,
                   p_givh_code              amrprph.amrprph_givh_code%TYPE DEFAULT NULL,
                   p_target_ask_amt_chg_ind amrprph.amrprph_target_ask_amt_chg_ind%TYPE DEFAULT NULL,
                   p_target_ask_amount      amrprph.amrprph_target_ask_amount%TYPE DEFAULT NULL,
                   p_target_ask_dte_chg_ind amrprph.amrprph_target_ask_dte_chg_ind%TYPE DEFAULT NULL,
                   p_target_ask_date        amrprph.amrprph_target_ask_date%TYPE DEFAULT NULL,
                   p_prst_code_chg_ind      amrprph.amrprph_prst_code_chg_ind%TYPE DEFAULT NULL,
                   p_prst_code              amrprph.amrprph_prst_code%TYPE DEFAULT NULL,
                   p_prst_date_chg_ind      amrprph.amrprph_prst_date_chg_ind%TYPE DEFAULT NULL,
                   p_prst_date              amrprph.amrprph_prst_date%TYPE DEFAULT NULL,
                   p_proj_from_date_chg_ind amrprph.amrprph_proj_from_date_chg_ind%TYPE DEFAULT NULL,
                   p_proj_eff_from_date     amrprph.amrprph_proj_eff_from_date%TYPE DEFAULT NULL,
                   p_proj_to_date_chg_ind   amrprph.amrprph_proj_to_date_chg_ind%TYPE DEFAULT NULL,
                   p_proj_eff_to_date       amrprph.amrprph_proj_eff_to_date%TYPE DEFAULT NULL,
                   p_proj_text_chg_ind      amrprph.amrprph_proj_text_chg_ind%TYPE DEFAULT NULL,
                   p_proj_text              amrprph.amrprph_proj_text%TYPE DEFAULT NULL,
                   p_frbprop_code_chg_ind   amrprph.amrprph_frbprop_code_chg_ind%TYPE DEFAULT NULL,
                   p_frbprop_code           amrprph.amrprph_frbprop_code%TYPE DEFAULT NULL,
                   p_rowid_out              OUT gb_common.internal_record_id_type)

Creates a record.

Parameters
p_pidm   The internal system generated ID number of a Prospect. NUMBER(8) Required Key
p_prop_code   The Proposal code which is associated to the Prospect. VARCHAR2(24) Required Key
p_prop_seq_no   The sequence number of the Proposal code which is associated to the Prospect. VARCHAR2(24) Required Key
p_proj_code   The Project code which is being associated to the Proposal. VARCHAR2(24) Required Key
p_seq_no   The sequence number of the history for the Project. NUMBER(3) Required Key
p_user_id   User ID of the person who created/updated the record. VARCHAR2(120) Required
p_data_origin   System maintained field specifying the origin of the data. VARCHAR2(120) Required
p_givh_code_chg_ind   Change indicator for the Giving Vehicle Code, Y = changed, N = unchanged. VARCHAR2(4)
p_givh_code   The Giving Vehicle Code for the Proposal/Project. VARCHAR2(8)
p_target_ask_amt_chg_ind   Change indicator for the Target Ask Amount, Y = changed, N = unchanged. VARCHAR2(4)
p_target_ask_amount   The desired Asking Amount for the Proposal/Project. NUMBER(11,2)
p_target_ask_dte_chg_ind   Change indicator for the Target Ask Date, Y = changed, N = unchanged. VARCHAR2(4)
p_target_ask_date   The Date the desired Amount was asked. DATE
p_prst_code_chg_ind   Change indicator for the Project Status, Y = changed, N = unchanged. VARCHAR2(4)
p_prst_code   The Status of the project for the prospect. VARCHAR2(4)
p_prst_date_chg_ind   Change indicator for the Project Status Date, Y = changed, N = unchanged. VARCHAR2(4)
p_prst_date   The Date of the project status for the prospect. DATE
p_proj_from_date_chg_ind   Change indicator for the Project Effective Begin Date, Y = changed, N = unchanged. VARCHAR2(4)
p_proj_eff_from_date   The Begin date that the project is effective. DATE
p_proj_to_date_chg_ind   Change indicator for the Project Effective End Date, Y = changed, N = unchanged. VARCHAR2(4)
p_proj_eff_to_date   The End date that the project is effective. DATE
p_proj_text_chg_ind   Change indicator for the Project Text, Y = changed, N = unchanged. VARCHAR2(4)
p_proj_text   Free format Text about the project. VARCHAR2(4000)
p_frbprop_code_chg_ind   Change indicator for the Finance Proposal Code, Y = changed, N = unchanged. VARCHAR2(4)
p_frbprop_code   Finance Proposal Code for the Project. VARCHAR2(9)
p_rowid_out   Database ROWID of the record to be created. VARCHAR2(18) Required


p_delete

Procedure p_delete(p_pidm        amrprph.amrprph_pidm%TYPE,
                   p_prop_code   amrprph.amrprph_prop_code%TYPE,
                   p_prop_seq_no amrprph.amrprph_prop_seq_no%TYPE,
                   p_proj_code   amrprph.amrprph_proj_code%TYPE,
                   p_seq_no      amrprph.amrprph_seq_no%TYPE,
                   p_rowid       gb_common.internal_record_id_type DEFAULT NULL)

Deletes a record.

Parameters
p_pidm   The internal system generated ID number of a Prospect. NUMBER(8) Required Key
p_prop_code   The Proposal code which is associated to the Prospect. VARCHAR2(24) Required Key
p_prop_seq_no   The sequence number of the Proposal code which is associated to the Prospect. VARCHAR2(24) Required Key
p_proj_code   The Project code which is being associated to the Proposal. VARCHAR2(24) Required Key
p_seq_no   The sequence number of the history for the Project. NUMBER(3) Required Key
p_rowid   Database ROWID of the record to be deleted. VARCHAR2(18)


p_lock

Procedure p_lock(p_pidm        amrprph.amrprph_pidm%TYPE,
                 p_prop_code   amrprph.amrprph_prop_code%TYPE,
                 p_prop_seq_no amrprph.amrprph_prop_seq_no%TYPE,
                 p_proj_code   amrprph.amrprph_proj_code%TYPE,
                 p_seq_no      amrprph.amrprph_seq_no%TYPE,
                 p_rowid_inout IN OUT NOCOPY gb_common.internal_record_id_type)

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 in p_rowid_inout.

Parameters
p_pidm   The internal system generated ID number of a Prospect. NUMBER(8) Required Key
p_prop_code   The Proposal code which is associated to the Prospect. VARCHAR2(24) Required Key
p_prop_seq_no   The sequence number of the Proposal code which is associated to the Prospect. VARCHAR2(24) Required Key
p_proj_code   The Project code which is being associated to the Proposal. VARCHAR2(24) Required Key
p_seq_no   The sequence number of the history for the Project. NUMBER(3) Required Key
p_rowid_inout   Database ROWID of the record to be locked. VARCHAR2(18) Required