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,
x_plan_sht_status IN VARCHAR2
) AS
/*
|| Created By : ckasu
|| Created On : 18-NOV-2003
|| 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_en_spa_terms
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;
Fnd_Message.Set_Name ('FND', 'FORM_RECORD_DELETED');
Fnd_Message.Set_Name ('FND','FORM_RECORD_DELETED');
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_EN_SPA_TERMS
WHERE TERM_CAL_TYPE = X_CAL_TYPE AND
TERM_SEQUENCE_NUMBER = X_SEQUENCE_NUMBER ;
SELECT ROWID
FROM IGS_EN_SPA_TERMS
WHERE person_id = x_person_id
AND program_cd = x_course_cd ;
SELECT ROWID
FROM IGS_EN_SPA_TERMS
WHERE CLASS_STANDING_ID = X_IGS_PR_CLASS_STD_ID;
SELECT ROWID
FROM IGS_EN_SPA_TERMS
WHERE fee_cat = x_fee_cat ;
SELECT ROWID
FROM IGS_EN_SPA_TERMS
WHERE coo_id = x_coo_id;
SELECT rowid
FROM igs_en_spa_terms
WHERE term_record_id = x_term_record_id
FOR UPDATE NOWAIT;
SELECT rowid
FROM igs_en_spa_terms
WHERE x_person_id = person_id AND
x_program_cd = program_cd AND
x_term_cal_type = term_cal_type AND
x_term_sequence_number = term_sequence_number
FOR UPDATE NOWAIT;
PROCEDURE BeforeRowInsertUpdate(
p_inserting IN BOOLEAN,
p_updating IN BOOLEAN
) AS
/*
|| Created By : ckasu
|| Created On : 26-MAY-2004
|| Change History :
|| (reverse chronological order - newest change first)
|| Who When What
||ckasu 26-May-2004 Procedure Created inorder to encapsulate logic
|| to create TODO record in master and detail table
|| as a part of bug#3631488
*/
v_sequence_number NUMBER;
IF p_inserting OR p_updating THEN
v_sequence_number := IGS_GE_GEN_003.GENP_INS_STDNT_TODO(
new_references.person_id,
'FEE_RECALC',
SYSDATE,
'Y');
END BeforeRowInsertUpdate;
x_last_update_date IN DATE,
x_last_updated_by IN NUMBER,
x_last_update_login IN NUMBER,
x_plan_sht_status IN VARCHAR2
) AS
/*
|| Created By : ckasu
|| Created On : 18-NOV-2003
|| Purpose : Initialises the columns, Checks Constraints, Calls the
|| Trigger Handlers for the table, before any DML operation.
|| Known limitations, enhancements or remarks :
|| Change History :
|| (reverse chronological order - newest change first)
|| Who When What
||
|| ckasu 26-May-2004 Modified before_dml Procedure by adding call to
|| beforeinsertupdate Procedure ,inorder to create
|| TODO record in master and detail table as a part
|| of bug#3631488
||
*/
Cursor cur_rowid(p_coo_id NUMBER,p_term_cal_type VARCHAR2,p_term_sequence_number VARCHAR2) is
SELECT 'x'
FROM igs_ps_ofr_opt cop,
igs_ca_inst_rel cr
WHERE cop.cal_type = cr.sup_cal_type AND
cop.coo_id = p_coo_id AND
cr.sub_cal_type = p_term_cal_type AND
cr.sub_ci_sequence_number = p_term_sequence_number;
x_last_update_date,
x_last_updated_by,
x_last_update_login,
x_plan_sht_status
);
IF (p_action = 'INSERT') THEN
-- Call all the procedures related to Before Insert.
IF ( get_pk_for_validation(
new_references.term_record_id
)
) THEN
fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
BeforeRowInsertUpdate ( p_inserting => TRUE,
p_updating => FALSE
);
ELSIF (p_action = 'VALIDATE_INSERT') THEN
-- Call all the procedures related to Before Insert.
IF ( get_pk_for_validation (
new_references.term_record_id
)
) THEN
fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
ELSIF (p_action = 'DELETE') THEN
check_child_existence(new_references.person_id,new_references.program_cd);
ELSIF (p_action = 'VALIDATE_DELETE') THEN
check_child_existence(new_references.person_id,new_references.program_cd);
ELSIF (p_action = 'UPDATE') THEN
-- Call all the procedures related to Before Insert.
-- Code added by ckasu as a part of
-- bug no #3631488 inorder to create TODO record in both Parent
-- and child table when Term Record is Updated
BeforeRowInsertUpdate ( p_inserting => FALSE,
p_updating => TRUE
);
PROCEDURE insert_row (
x_rowid IN OUT NOCOPY VARCHAR2,
x_term_record_id IN OUT NOCOPY NUMBER,
x_person_id IN NUMBER,
x_program_cd IN VARCHAR2,
x_program_version IN NUMBER,
x_acad_cal_type IN VARCHAR2,
x_term_cal_type IN VARCHAR2,
x_term_sequence_number IN NUMBER,
x_key_program_flag IN VARCHAR2,
x_location_cd IN VARCHAR2,
x_attendance_mode IN VARCHAR2,
x_attendance_type IN VARCHAR2,
x_fee_cat IN VARCHAR2,
x_coo_id IN NUMBER,
x_class_standing_id IN NUMBER,
x_attribute_category IN VARCHAR2,
x_attribute1 IN VARCHAR2,
x_attribute2 IN VARCHAR2,
x_attribute3 IN VARCHAR2,
x_attribute4 IN VARCHAR2,
x_attribute5 IN VARCHAR2,
x_attribute6 IN VARCHAR2,
x_attribute7 IN VARCHAR2,
x_attribute8 IN VARCHAR2,
x_attribute9 IN VARCHAR2,
x_attribute10 IN VARCHAR2,
x_attribute11 IN VARCHAR2,
x_attribute12 IN VARCHAR2,
x_attribute13 IN VARCHAR2,
x_attribute14 IN VARCHAR2,
x_attribute15 IN VARCHAR2,
x_attribute16 IN VARCHAR2,
x_attribute17 IN VARCHAR2,
x_attribute18 IN VARCHAR2,
x_attribute19 IN VARCHAR2,
x_attribute20 IN VARCHAR2,
x_plan_sht_status IN VARCHAR2,
x_mode IN VARCHAR2
) AS
/*
|| Created By : ckasu
|| Created On : 18-NOV-2003
|| 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_program_update_date DATE;
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;
x_program_update_date := NULL;
x_program_update_date := sysdate;
fnd_message.set_token ('ROUTINE', 'IGS_EN_SPA_TERMS_PKG.INSERT_ROW');
p_action => 'INSERT',
x_rowid => x_rowid,
x_term_record_id => x_term_record_id,
x_person_id => x_person_id,
x_program_cd => x_program_cd,
x_program_version => x_program_version,
x_acad_cal_type => x_acad_cal_type,
x_term_cal_type => x_term_cal_type,
x_term_sequence_number => x_term_sequence_number,
x_key_program_flag => x_key_program_flag,
x_location_cd => x_location_cd,
x_attendance_mode => x_attendance_mode,
x_attendance_type => x_attendance_type,
x_fee_cat => x_fee_cat,
x_coo_id => x_coo_id,
x_class_standing_id => x_class_standing_id,
x_attribute_category => x_attribute_category,
x_attribute1 => x_attribute1,
x_attribute2 => x_attribute2,
x_attribute3 => x_attribute3,
x_attribute4 => x_attribute4,
x_attribute5 => x_attribute5,
x_attribute6 => x_attribute6,
x_attribute7 => x_attribute7,
x_attribute8 => x_attribute8,
x_attribute9 => x_attribute9,
x_attribute10 => x_attribute10,
x_attribute11 => x_attribute11,
x_attribute12 => x_attribute12,
x_attribute13 => x_attribute13,
x_attribute14 => x_attribute14,
x_attribute15 => x_attribute15,
x_attribute16 => x_attribute16,
x_attribute17 => x_attribute17,
x_attribute18 => x_attribute18,
x_attribute19 => x_attribute19,
x_attribute20 => x_attribute20,
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,
x_plan_sht_status => x_plan_sht_status
);
INSERT INTO igs_en_spa_terms (
term_record_id,
person_id,
program_cd,
program_version,
acad_cal_type,
term_cal_type,
term_sequence_number,
key_program_flag,
location_cd,
attendance_mode,
attendance_type,
fee_cat,
coo_id,
class_standing_id,
attribute_category,
attribute1,
attribute2,
attribute3,
attribute4,
attribute5,
attribute6,
attribute7,
attribute8,
attribute9,
attribute10,
attribute11,
attribute12,
attribute13,
attribute14,
attribute15,
attribute16,
attribute17,
attribute18,
attribute19,
attribute20,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login,
request_id,
program_id,
program_application_id,
program_update_date,
plan_sht_status
) VALUES (
igs_en_spa_terms_s.NEXTVAL,
new_references.person_id,
new_references.program_cd,
new_references.program_version,
new_references.acad_cal_type,
new_references.term_cal_type,
new_references.term_sequence_number,
new_references.key_program_flag,
new_references.location_cd,
new_references.attendance_mode,
new_references.attendance_type,
new_references.fee_cat,
new_references.coo_id,
new_references.class_standing_id,
new_references.attribute_category,
new_references.attribute1,
new_references.attribute2,
new_references.attribute3,
new_references.attribute4,
new_references.attribute5,
new_references.attribute6,
new_references.attribute7,
new_references.attribute8,
new_references.attribute9,
new_references.attribute10,
new_references.attribute11,
new_references.attribute12,
new_references.attribute13,
new_references.attribute14,
new_references.attribute15,
new_references.attribute16,
new_references.attribute17,
new_references.attribute18,
new_references.attribute19,
new_references.attribute20,
x_last_update_date,
x_last_updated_by,
x_last_update_date,
x_last_updated_by,
x_last_update_login ,
x_request_id,
x_program_id,
x_program_application_id,
x_program_update_date,
new_references.plan_sht_status
) RETURNING ROWID, term_record_id INTO x_rowid, x_term_record_id;
END insert_row;
SELECT
person_id,
program_cd,
program_version,
acad_cal_type,
term_cal_type,
term_sequence_number,
key_program_flag,
location_cd,
attendance_mode,
attendance_type,
fee_cat,
coo_id,
class_standing_id,
attribute_category,
attribute1,
attribute2,
attribute3,
attribute4,
attribute5,
attribute6,
attribute7,
attribute8,
attribute9,
attribute10,
attribute11,
attribute12,
attribute13,
attribute14,
attribute15,
attribute16,
attribute17,
attribute18,
attribute19,
attribute20,
plan_sht_status
FROM igs_en_spa_terms
WHERE rowid = x_rowid
FOR UPDATE NOWAIT;
fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
PROCEDURE update_row (
x_rowid IN VARCHAR2,
x_term_record_id IN NUMBER,
x_person_id IN NUMBER,
x_program_cd IN VARCHAR2,
x_program_version IN NUMBER,
x_acad_cal_type IN VARCHAR2,
x_term_cal_type IN VARCHAR2,
x_term_sequence_number IN NUMBER,
x_key_program_flag IN VARCHAR2,
x_location_cd IN VARCHAR2,
x_attendance_mode IN VARCHAR2,
x_attendance_type IN VARCHAR2,
x_fee_cat IN VARCHAR2,
x_coo_id IN NUMBER,
x_class_standing_id IN NUMBER,
x_attribute_category IN VARCHAR2,
x_attribute1 IN VARCHAR2,
x_attribute2 IN VARCHAR2,
x_attribute3 IN VARCHAR2,
x_attribute4 IN VARCHAR2,
x_attribute5 IN VARCHAR2,
x_attribute6 IN VARCHAR2,
x_attribute7 IN VARCHAR2,
x_attribute8 IN VARCHAR2,
x_attribute9 IN VARCHAR2,
x_attribute10 IN VARCHAR2,
x_attribute11 IN VARCHAR2,
x_attribute12 IN VARCHAR2,
x_attribute13 IN VARCHAR2,
x_attribute14 IN VARCHAR2,
x_attribute15 IN VARCHAR2,
x_attribute16 IN VARCHAR2,
x_attribute17 IN VARCHAR2,
x_attribute18 IN VARCHAR2,
x_attribute19 IN VARCHAR2,
x_attribute20 IN VARCHAR2,
x_plan_sht_status IN VARCHAR2,
x_mode IN VARCHAR2
) AS
/*
|| Created By : ckasu
|| Created On : 18-NOV-2003
|| 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_program_update_date DATE;
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;
fnd_message.set_token ('ROUTINE', 'IGS_EN_SPA_TERMS_PKG.UPDATE_ROW');
p_action => 'UPDATE',
x_rowid => x_rowid,
x_term_record_id => x_term_record_id,
x_person_id => x_person_id,
x_program_cd => x_program_cd,
x_program_version => x_program_version,
x_acad_cal_type => x_acad_cal_type,
x_term_cal_type => x_term_cal_type,
x_term_sequence_number => x_term_sequence_number,
x_key_program_flag => x_key_program_flag,
x_location_cd => x_location_cd,
x_attendance_mode => x_attendance_mode,
x_attendance_type => x_attendance_type,
x_fee_cat => x_fee_cat,
x_coo_id => x_coo_id,
x_class_standing_id => x_class_standing_id,
x_attribute_category => x_attribute_category,
x_attribute1 => x_attribute1,
x_attribute2 => x_attribute2,
x_attribute3 => x_attribute3,
x_attribute4 => x_attribute4,
x_attribute5 => x_attribute5,
x_attribute6 => x_attribute6,
x_attribute7 => x_attribute7,
x_attribute8 => x_attribute8,
x_attribute9 => x_attribute9,
x_attribute10 => x_attribute10,
x_attribute11 => x_attribute11,
x_attribute12 => x_attribute12,
x_attribute13 => x_attribute13,
x_attribute14 => x_attribute14,
x_attribute15 => x_attribute15,
x_attribute16 => x_attribute16,
x_attribute17 => x_attribute17,
x_attribute18 => x_attribute18,
x_attribute19 => x_attribute19,
x_attribute20 => x_attribute20,
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,
x_plan_sht_status => x_plan_sht_status
);
x_program_update_date := old_references.program_update_date;
x_program_update_date := sysdate;
UPDATE igs_en_spa_terms
SET
person_id = new_references.person_id,
program_cd = new_references.program_cd,
program_version = new_references.program_version,
acad_cal_type = new_references.acad_cal_type,
term_cal_type = new_references.term_cal_type,
term_sequence_number = new_references.term_sequence_number,
key_program_flag = new_references.key_program_flag,
location_cd = new_references.location_cd,
attendance_mode = new_references.attendance_mode,
attendance_type = new_references.attendance_type,
fee_cat = new_references.fee_cat,
coo_id = new_references.coo_id,
class_standing_id = new_references.class_standing_id,
attribute_category = new_references.attribute_category,
attribute1 = new_references.attribute1,
attribute2 = new_references.attribute2,
attribute3 = new_references.attribute3,
attribute4 = new_references.attribute4,
attribute5 = new_references.attribute5,
attribute6 = new_references.attribute6,
attribute7 = new_references.attribute7,
attribute8 = new_references.attribute8,
attribute9 = new_references.attribute9,
attribute10 = new_references.attribute10,
attribute11 = new_references.attribute11,
attribute12 = new_references.attribute12,
attribute13 = new_references.attribute13,
attribute14 = new_references.attribute14,
attribute15 = new_references.attribute15,
attribute16 = new_references.attribute16,
attribute17 = new_references.attribute17,
attribute18 = new_references.attribute18,
attribute19 = new_references.attribute19,
attribute20 = new_references.attribute20,
last_update_date = x_last_update_date,
last_updated_by = x_last_updated_by,
last_update_login = x_last_update_login ,
request_id = x_request_id,
program_id = x_program_id,
program_application_id = x_program_application_id,
program_update_date = x_program_update_date,
plan_sht_status = new_references.plan_sht_status
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_en_spa_terms
WHERE term_record_id = x_term_record_id;
insert_row (
x_rowid,
x_term_record_id,
x_person_id,
x_program_cd,
x_program_version,
x_acad_cal_type,
x_term_cal_type,
x_term_sequence_number,
x_key_program_flag,
x_location_cd,
x_attendance_mode,
x_attendance_type,
x_fee_cat,
x_coo_id,
x_class_standing_id,
x_attribute_category,
x_attribute1,
x_attribute2,
x_attribute3,
x_attribute4,
x_attribute5,
x_attribute6,
x_attribute7,
x_attribute8,
x_attribute9,
x_attribute10,
x_attribute11,
x_attribute12,
x_attribute13,
x_attribute14,
x_attribute15,
x_attribute16,
x_attribute17,
x_attribute18,
x_attribute19,
x_attribute20,
x_plan_sht_status,
x_mode
);
update_row (
x_rowid,
x_term_record_id,
x_person_id,
x_program_cd,
x_program_version,
x_acad_cal_type,
x_term_cal_type,
x_term_sequence_number,
x_key_program_flag,
x_location_cd,
x_attendance_mode,
x_attendance_type,
x_fee_cat,
x_coo_id,
x_class_standing_id,
x_attribute_category,
x_attribute1,
x_attribute2,
x_attribute3,
x_attribute4,
x_attribute5,
x_attribute6,
x_attribute7,
x_attribute8,
x_attribute9,
x_attribute10,
x_attribute11,
x_attribute12,
x_attribute13,
x_attribute14,
x_attribute15,
x_attribute16,
x_attribute17,
x_attribute18,
x_attribute19,
x_attribute20,
x_plan_sht_status,
x_mode
);
PROCEDURE delete_row (
x_rowid IN VARCHAR2,
x_mode IN VARCHAR2
) AS
/*
|| Created By : ckasu
|| Created On : 18-NOV-2003
|| 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_en_spa_terms
WHERE rowid = x_rowid;
END delete_row;