The following lines contain the word 'select', 'insert', 'update' or 'delete':
x_last_update_date IN DATE,
x_last_updated_by IN NUMBER,
x_last_update_login IN NUMBER
) AS
/*
|| Created By : prabhat.patel
|| Created On : 05-NOV-2002
|| Purpose : Initialises the Old and New references for the columns of the table.
|| Known limitations, enhancements or remarks :
|| Change History :
|| Who When What
|| (reverse chronological order - newest change first)
*/
CURSOR cur_old_ref_values IS
SELECT *
FROM igs_pe_per_type_map
WHERE rowid = x_rowid;
IF ((cur_old_ref_values%NOTFOUND) AND (p_action NOT IN ('INSERT', 'VALIDATE_INSERT'))) THEN
CLOSE cur_old_ref_values;
fnd_message.set_name ('FND', 'FORM_RECORD_DELETED');
IF (p_action = 'UPDATE') THEN
new_references.creation_date := old_references.creation_date;
new_references.last_update_date := x_last_update_date;
new_references.last_updated_by := x_last_updated_by;
new_references.last_update_login := x_last_update_login;
SELECT 'X'
FROM per_person_types
WHERE person_type_id = new_references.per_person_type_id;
FND_MESSAGE.SET_NAME ('FND','FORM_RECORD_DELETED');
FND_MESSAGE.SET_NAME ('FND', 'FORM_RECORD_DELETED');
FND_MESSAGE.SET_NAME ('FND', 'FORM_RECORD_DELETED');
SELECT rowid
FROM igs_pe_per_type_map
WHERE person_type_code = x_person_type_code
AND per_person_type_id = x_per_person_type_id
FOR UPDATE NOWAIT;
x_last_update_date IN DATE,
x_last_updated_by IN NUMBER,
x_last_update_login IN NUMBER
) AS
/*
|| Created By : prabhat.patel
|| Created On : 05-NOV-2002
|| Purpose : Initialises the columns, Checks Constraints, Calls the
|| Trigger Handlers for the table, before any DML operation.
|| Known limitations, enhancements or remarks :
|| Change History :
|| Who When What
|| (reverse chronological order - newest change first)
*/
BEGIN
set_column_values (
p_action,
x_rowid,
x_person_type_code,
x_system_type,
x_per_person_type_id,
x_creation_date,
x_created_by,
x_last_update_date,
x_last_updated_by,
x_last_update_login
);
IF (p_action = 'INSERT') THEN
-- Call all the procedures related to Before Insert.
IF ( get_pk_for_validation(
new_references.person_type_code,
new_references.per_person_type_id
)
) THEN
fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
ELSIF (p_action = 'VALIDATE_INSERT') THEN
-- Call all the procedures related to Before Insert.
IF ( get_pk_for_validation (
new_references.person_type_code,
new_references.per_person_type_id
)
) THEN
fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
PROCEDURE afterinsert (
x_system_type IN VARCHAR2 )
AS
/*
|| Created By : ssawhney
|| Created On : 29nov
|| Purpose : Handles the After insert logic, we need to end date person type instances in OSS after the mapping is done.
|| Known limitations, enhancements or remarks :
|| Change History :
|| Who When What
|| (reverse chronological order - newest change first)
*/
CURSOR person_type_cur(cp_system_type igs_pe_person_types.system_type%TYPE) IS
SELECT ti.rowid,ti.*
FROM igs_pe_typ_instances_all ti,
igs_pe_person_types pt,
per_all_people_f ppf
WHERE ppf.party_id = ti.person_id AND
ti.person_type_code = pt.person_type_code AND
pt.system_type = cp_system_type AND
(ti.end_date IS NULL OR (SYSDATE BETWEEN ti.start_date AND ti.end_date))
;
SELECT '1'
FROM igs_pe_typ_instances
WHERE person_id = cp_person_id
AND system_type = 'STAFF'
AND (end_date IS NULL OR (SYSDATE BETWEEN start_date AND end_date));
SELECT ti.rowid,ti.*
FROM igs_pe_typ_instances_all ti,
igs_pe_person_types pt
WHERE ti.person_type_code = pt.person_type_code AND
pt.system_type = 'SS_ENROLL_STAFF' AND
ti.person_id = cp_person_id;
igs_pe_typ_instances_pkg.update_row
(
x_rowid => person_type_rec.rowid,
x_person_id => person_type_rec.person_id,
x_course_cd => person_type_rec.course_cd,
x_type_instance_id => person_type_rec.type_instance_id,
x_person_type_code => person_type_rec.person_type_code,
x_cc_version_number => person_type_rec.cc_version_number,
x_funnel_status => person_type_rec.funnel_status,
x_admission_appl_number=> person_type_rec.admission_appl_number,
x_nominated_course_cd => person_type_rec.nominated_course_cd,
x_ncc_version_number => person_type_rec.ncc_version_number,
x_sequence_number => person_type_rec.sequence_number,
x_start_date => person_type_rec.start_date,
x_end_date => TRUNC(sysdate),
x_create_method => person_type_rec.create_method,
x_ended_by => person_type_rec.ended_by,
x_end_method => 'END_MANUAL',
x_emplmnt_category_code=> person_type_rec.emplmnt_category_code);
igs_pe_typ_instances_pkg.update_row
(
x_rowid => ss_rec.rowid,
x_person_id => ss_rec.person_id,
x_course_cd => ss_rec.course_cd,
x_type_instance_id => ss_rec.type_instance_id,
x_person_type_code => ss_rec.person_type_code,
x_cc_version_number => ss_rec.cc_version_number,
x_funnel_status => ss_rec.funnel_status,
x_admission_appl_number=> ss_rec.admission_appl_number,
x_nominated_course_cd => ss_rec.nominated_course_cd,
x_ncc_version_number => ss_rec.ncc_version_number,
x_sequence_number => ss_rec.sequence_number,
x_start_date => ss_rec.start_date,
x_end_date => TRUNC(sysdate),
x_create_method => ss_rec.create_method,
x_ended_by => ss_rec.ended_by,
x_end_method => 'END_MANUAL',
x_emplmnt_category_code=> ss_rec.emplmnt_category_code);
END afterinsert;
IF (p_action = 'INSERT') THEN
-- Call all the procedures related to After Insert.
afterinsert(new_references.system_type);
ELSIF (p_action = 'UPDATE') THEN
-- Call all the procedures related to After Update.
Null;
ELSIF (p_action = 'DELETE') THEN
-- Call all the procedures related to After Delete.
Null;
PROCEDURE insert_row (
x_rowid IN OUT NOCOPY VARCHAR2,
x_person_type_code IN VARCHAR2,
x_system_type IN VARCHAR2,
x_per_person_type_id IN NUMBER,
x_mode IN VARCHAR2
) AS
/*
|| Created By : prabhat.patel
|| Created On : 05-NOV-2002
|| Purpose : Handles the INSERT DML logic for the table.
|| Known limitations, enhancements or remarks :
|| Change History :
|| Who When What
|| (reverse chronological order - newest change first)
*/
x_last_update_date DATE;
x_last_updated_by NUMBER;
x_last_update_login NUMBER;
x_last_update_date := SYSDATE;
x_last_updated_by := 1;
x_last_update_login := 0;
x_last_updated_by := fnd_global.user_id;
IF (x_last_updated_by IS NULL) THEN
x_last_updated_by := -1;
x_last_update_login := fnd_global.login_id;
IF (x_last_update_login IS NULL) THEN
x_last_update_login := -1;
p_action => 'INSERT',
x_rowid => x_rowid,
x_person_type_code => x_person_type_code,
x_system_type => x_system_type,
x_per_person_type_id => x_per_person_type_id,
x_creation_date => x_last_update_date,
x_created_by => x_last_updated_by,
x_last_update_date => x_last_update_date,
x_last_updated_by => x_last_updated_by,
x_last_update_login => x_last_update_login
);
INSERT INTO igs_pe_per_type_map (
person_type_code,
system_type,
per_person_type_id,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login
) VALUES (
new_references.person_type_code,
new_references.system_type,
new_references.per_person_type_id,
x_last_update_date,
x_last_updated_by,
x_last_update_date,
x_last_updated_by,
x_last_update_login
) RETURNING ROWID INTO x_rowid;
p_action => 'INSERT' ,
x_rowid => X_ROWID );
END insert_row;
SELECT
system_type
FROM igs_pe_per_type_map
WHERE rowid = x_rowid
FOR UPDATE NOWAIT;
fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
PROCEDURE update_row (
x_rowid IN VARCHAR2,
x_person_type_code IN VARCHAR2,
x_system_type IN VARCHAR2,
x_per_person_type_id IN NUMBER,
x_mode IN VARCHAR2
) AS
/*
|| Created By : prabhat.patel
|| Created On : 05-NOV-2002
|| Purpose : Handles the UPDATE DML logic for the table.
|| Known limitations, enhancements or remarks :
|| Change History :
|| Who When What
|| (reverse chronological order - newest change first)
*/
x_last_update_date DATE ;
x_last_updated_by NUMBER;
x_last_update_login NUMBER;
x_last_update_date := SYSDATE;
x_last_updated_by := 1;
x_last_update_login := 0;
x_last_updated_by := fnd_global.user_id;
IF x_last_updated_by IS NULL THEN
x_last_updated_by := -1;
x_last_update_login := fnd_global.login_id;
IF (x_last_update_login IS NULL) THEN
x_last_update_login := -1;
p_action => 'UPDATE',
x_rowid => x_rowid,
x_person_type_code => x_person_type_code,
x_system_type => x_system_type,
x_per_person_type_id => x_per_person_type_id,
x_creation_date => x_last_update_date,
x_created_by => x_last_updated_by,
x_last_update_date => x_last_update_date,
x_last_updated_by => x_last_updated_by,
x_last_update_login => x_last_update_login
);
UPDATE igs_pe_per_type_map
SET
system_type = new_references.system_type,
last_update_date = x_last_update_date,
last_updated_by = x_last_updated_by,
last_update_login = x_last_update_login
WHERE rowid = x_rowid;
END update_row;
|| Purpose : Adds a row if there is no existing row, otherwise updates existing row in the table.
|| Known limitations, enhancements or remarks :
|| Change History :
|| Who When What
|| (reverse chronological order - newest change first)
*/
CURSOR c1 IS
SELECT rowid
FROM igs_pe_per_type_map
WHERE person_type_code = x_person_type_code
AND per_person_type_id = x_per_person_type_id;
insert_row (
x_rowid,
x_person_type_code,
x_system_type,
x_per_person_type_id,
x_mode
);
update_row (
x_rowid,
x_person_type_code,
x_system_type,
x_per_person_type_id,
x_mode
);
PROCEDURE delete_row (
x_rowid IN VARCHAR2
) AS
/*
|| Created By : prabhat.patel
|| Created On : 05-NOV-2002
|| Purpose : Handles the DELETE DML logic for the table.
|| Known limitations, enhancements or remarks :
|| Change History :
|| Who When What
|| (reverse chronological order - newest change first)
*/
BEGIN
before_dml (
p_action => 'DELETE',
x_rowid => x_rowid
);
DELETE FROM igs_pe_per_type_map
WHERE rowid = x_rowid;
END delete_row;