index

Package gb_emergency_contact

Common business interface for the EMERGENCY CONTACT API(GB_EMERGENCY_CONTACT).
This API stores and updates Emergency Contact address and phone information for a person.


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_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 an Emergency Contact record.

Types
emergency_contact_rec   Business Entity record type
emergency_contact_ref   Entity cursor variable type
emergency_contact_tab   Entity table type

Constants
m_entity_name   Business Entity Name


m_entity_name

m_entity_name CONSTANT VARCHAR2(17) := 'EMERGENCY_CONTACT';

Business Entity Name


emergency_contact_rec

TYPE emergency_contact_rec IS RECORD(
  r_pidm               spremrg.spremrg_pidm%TYPE,
  r_priority           spremrg.spremrg_priority%TYPE,
  r_last_name          spremrg.spremrg_last_name%TYPE,
  r_first_name         spremrg.spremrg_first_name%TYPE,
  r_mi                 spremrg.spremrg_mi%TYPE,
  r_street_line1       spremrg.spremrg_street_line1%TYPE,
  r_street_line2       spremrg.spremrg_street_line2%TYPE,
  r_street_line3       spremrg.spremrg_street_line3%TYPE,
  r_city               spremrg.spremrg_city%TYPE,
  r_stat_code          spremrg.spremrg_stat_code%TYPE,
  r_natn_code          spremrg.spremrg_natn_code%TYPE,
  r_zip                spremrg.spremrg_zip%TYPE,
  r_phone_area         spremrg.spremrg_phone_area%TYPE,
  r_phone_number       spremrg.spremrg_phone_number%TYPE,
  r_phone_ext          spremrg.spremrg_phone_ext%TYPE,
  r_relt_code          spremrg.spremrg_relt_code%TYPE,
  r_atyp_code          spremrg.spremrg_atyp_code%TYPE,
  r_data_origin        spremrg.spremrg_data_origin%TYPE,
  r_user_id            spremrg.spremrg_user_id%TYPE,
  r_surname_prefix     spremrg.spremrg_surname_prefix%TYPE,
  r_ctry_code_phone    spremrg.spremrg_ctry_code_phone%TYPE,
  r_house_number       spremrg.spremrg_house_number%TYPE,
  r_street_line4       spremrg.spremrg_street_line4%TYPE,
  r_internal_record_id gb_common.internal_record_id_type);

Business Entity record type


emergency_contact_ref

TYPE emergency_contact_ref IS REF CURSOR RETURN emergency_contact_rec;

Entity cursor variable type


emergency_contact_tab

TYPE emergency_contact_tab IS TABLE OF emergency_contact_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     spremrg.spremrg_pidm%TYPE,
                  p_priority spremrg.spremrg_priority%TYPE,
                  p_rowid    gb_common.internal_record_id_type DEFAULT NULL)
  RETURN VARCHAR2

Checks to see if a record exists.

Parameters
p_pidm   Internal identification number of the person. NUMBER(8) Required Key
p_priority   Priority indicator associated with the emergency address. VARCHAR2(1) 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 emergency_contact_rec,
                   rec_two emergency_contact_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 emergency_contact_rec Required
rec_two   The second record to compare. Type emergency_contact_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     spremrg.spremrg_pidm%TYPE,
                     p_priority spremrg.spremrg_priority%TYPE)
  RETURN emergency_contact_ref

Selects all records for the entity.

Parameters
p_pidm   Internal identification number of the person. NUMBER(8) Required Key
p_priority   Priority indicator associated with the emergency address. VARCHAR2(1) Required Key

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


f_query_one

FUNCTION f_query_one(p_pidm     spremrg.spremrg_pidm%TYPE,
                     p_priority spremrg.spremrg_priority%TYPE)
  RETURN emergency_contact_ref

Selects one record using the key.

Parameters
p_pidm   Internal identification number of the person. NUMBER(8) Required Key
p_priority   Indicates the order of importance of this emergency contact. VARCHAR2(1) 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 emergency_contact_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     spremrg.spremrg_pidm%TYPE,
                          p_priority spremrg.spremrg_priority%TYPE,
                          p_rowid    gb_common.internal_record_id_type DEFAULT NULL)
  RETURN emergency_contact_ref

Selects one record and locks it.

Parameters
p_pidm   Internal identification number of the person. NUMBER(8) Required Key
p_priority   Indicates the order of importance of this emergency contact. VARCHAR2(1) 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            spremrg.spremrg_pidm%TYPE,
                   p_priority        spremrg.spremrg_priority%TYPE,
                   p_last_name       spremrg.spremrg_last_name%TYPE,
                   p_first_name      spremrg.spremrg_first_name%TYPE,
                   p_mi              spremrg.spremrg_mi%TYPE DEFAULT NULL,
                   p_street_line1    spremrg.spremrg_street_line1%TYPE DEFAULT NULL,
                   p_street_line2    spremrg.spremrg_street_line2%TYPE DEFAULT NULL,
                   p_street_line3    spremrg.spremrg_street_line3%TYPE DEFAULT NULL,
                   p_city            spremrg.spremrg_city%TYPE DEFAULT NULL,
                   p_stat_code       spremrg.spremrg_stat_code%TYPE DEFAULT NULL,
                   p_natn_code       spremrg.spremrg_natn_code%TYPE DEFAULT NULL,
                   p_zip             spremrg.spremrg_zip%TYPE DEFAULT NULL,
                   p_phone_area      spremrg.spremrg_phone_area%TYPE DEFAULT NULL,
                   p_phone_number    spremrg.spremrg_phone_number%TYPE DEFAULT NULL,
                   p_phone_ext       spremrg.spremrg_phone_ext%TYPE DEFAULT NULL,
                   p_relt_code       spremrg.spremrg_relt_code%TYPE DEFAULT NULL,
                   p_atyp_code       spremrg.spremrg_atyp_code%TYPE DEFAULT NULL,
                   p_data_origin     spremrg.spremrg_data_origin%TYPE DEFAULT NULL,
                   p_user_id         spremrg.spremrg_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_surname_prefix  spremrg.spremrg_surname_prefix%TYPE DEFAULT NULL,
                   p_ctry_code_phone spremrg.spremrg_ctry_code_phone%TYPE DEFAULT NULL,
                   p_house_number    spremrg.spremrg_house_number%TYPE DEFAULT NULL,
                   p_street_line4    spremrg.spremrg_street_line4%TYPE DEFAULT NULL,
                   p_rowid_out       OUT gb_common.internal_record_id_type)

Creates a record.

Parameters
p_pidm   Internal identification number of the person. NUMBER(8) Required Key
p_priority   Indicates the order of importance of this emergency contact. VARCHAR2(1) Required Key
p_last_name   Last name of the person associated with the emergency address information. VARCHAR2(60) Required
p_first_name   First name of the person associated with the emergency address information. VARCHAR2(60) Required
p_mi   Middle name of the person associated with the emergency address information. VARCHAR2(60)
p_street_line1   Line one of the emergency adddress. VARCHAR2(75)
p_street_line2   Line two of the emergency address. VARCHAR2(75)
p_street_line3   Line three of the emergency address. VARCHAR2(75)
p_city   City associated with the emergency address. VARCHAR2(50)
p_stat_code   State associated with the emergency address. VARCHAR2(3)
p_natn_code   Nation/Country associated with the emergency address. VARCHAR2(5)
p_zip   Zip code associated with the emergency address. VARCHAR2(30)
p_phone_area   Area code of phone number associated with the emergency address. VARCHAR2(6)
p_phone_number   Phone number associated with the emergency address. VARCHAR2(12)
p_phone_ext   Extension of phone number associated with the emergency address. VARCHAR2(10)
p_relt_code   Relationship between emergency contact person and the person. VARCHAR2(1)
p_atyp_code   The address type associated with the emergency address. VARCHAR2(2)
p_data_origin   Source system that created or updated the row. VARCHAR2(30)
p_user_id   Oracle User who inserted or last updated the record. VARCHAR2(30)
p_surname_prefix   Name tag preceding the last name or surname.  (Van, Von, Mac, etc.) VARCHAR2(60)
p_ctry_code_phone   Telephone code that designates the region and country. VARCHAR2(40)
p_house_number   Building or lot number on a street or in an area. VARCHAR2(10)
p_street_line4   Line four of emergency address. VARCHAR2(75)
p_rowid_out   Database ROWID of record that was created. VARCHAR2(18) Required


p_delete

PROCEDURE p_delete(p_pidm     spremrg.spremrg_pidm%TYPE,
                   p_priority spremrg.spremrg_priority%TYPE,
                   p_rowid    gb_common.internal_record_id_type DEFAULT NULL)

Deletes a record.

Parameters
p_pidm   Internal identification number of the person. NUMBER(8) Required Key
p_priority   Indicates the order of importance of this emergency contact. VARCHAR2(1) Required Key
p_rowid   Database ROWID of the record to be deleted. VARCHAR2(18)


p_lock

PROCEDURE p_lock(p_pidm        spremrg.spremrg_pidm%TYPE,
                 p_priority    spremrg.spremrg_priority%TYPE,
                 p_rowid_inout IN OUT 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   Internal identification number of the person. NUMBER(8) Required Key
p_priority   Indicates the order of importance of this emergency contact. VARCHAR2(1) Required Key
p_rowid_inout   Database ROWID of record to be locked. VARCHAR2(18) Required


p_update

PROCEDURE p_update(p_pidm            spremrg.spremrg_pidm%TYPE,
                   p_priority        spremrg.spremrg_priority%TYPE,
                   p_last_name       spremrg.spremrg_last_name%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_first_name      spremrg.spremrg_first_name%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_mi              spremrg.spremrg_mi%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_street_line1    spremrg.spremrg_street_line1%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_street_line2    spremrg.spremrg_street_line2%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_street_line3    spremrg.spremrg_street_line3%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_city            spremrg.spremrg_city%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_stat_code       spremrg.spremrg_stat_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_natn_code       spremrg.spremrg_natn_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_zip             spremrg.spremrg_zip%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_phone_area      spremrg.spremrg_phone_area%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_phone_number    spremrg.spremrg_phone_number%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_phone_ext       spremrg.spremrg_phone_ext%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_relt_code       spremrg.spremrg_relt_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_atyp_code       spremrg.spremrg_atyp_code%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_data_origin     spremrg.spremrg_data_origin%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_user_id         spremrg.spremrg_user_id%TYPE DEFAULT gb_common.f_sct_user,
                   p_surname_prefix  spremrg.spremrg_surname_prefix%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_ctry_code_phone spremrg.spremrg_ctry_code_phone%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_house_number    spremrg.spremrg_house_number%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_street_line4    spremrg.spremrg_street_line4%TYPE DEFAULT dml_common.f_unspecified_string,
                   p_rowid           gb_common.internal_record_id_type DEFAULT NULL)

Updates an Emergency Contact record.
Priority is part of the key, but is updateable. If ROWID is passed use it to locate the row to update, and set priority to the value passed.

Parameters
p_pidm   Internal identification number of the person. NUMBER(8) Required Key
p_priority   Indicates the order of importance of this emergency contact. VARCHAR2(1) Required Key
p_last_name   Last name of the person associated with the emergency address information. VARCHAR2(60) Required
p_first_name   First name of the person associated with the emergency address information. VARCHAR2(60) Required
p_mi   Middle name of the person associated with the emergency address information. VARCHAR2(60)
p_street_line1   Line one of the emergency adddress. VARCHAR2(75)
p_street_line2   Line two of the emergency address. . VARCHAR2(75)
p_street_line3   Line three of the emergency address. VARCHAR2(75)
p_city   City associated with the emergency address. VARCHAR2(50)
p_stat_code   State associated with the emergency address. VARCHAR2(3)
p_natn_code   Nation/Country associated with the emergency address. VARCHAR2(5)
p_zip   Zip code associated with the emergency address. VARCHAR2(30)
p_phone_area   Area code of phone number associated with the emergency address. VARCHAR2(6)
p_phone_number   Phone number associated with the emergency address. VARCHAR2(12)
p_phone_ext   Extension of phone number associated with the emergency address. VARCHAR2(10)
p_relt_code   Relationship between emergency contact person and the person. VARCHAR2(1)
p_atyp_code   The address type associated with the emergency address. VARCHAR2(2)
p_data_origin   Source system that created or updated the data. VARCHAR2(30)
p_user_id   Oracle User who inserted or last updated the record. VARCHAR2(30)
p_surname_prefix   Name tag preceding the last name or surname.  (Van, Von, Mac, etc.) VARCHAR2(60)
p_ctry_code_phone   Telephone code that designates the region and country. VARCHAR2(40)
p_house_number   Building or lot number on a street or in an area. VARCHAR2(10)
p_street_line4   Line four of emergency address. VARCHAR2(75)
p_rowid   Database ROWID of the record to be updated. VARCHAR2(18)