The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE afterinsert1(
x_sevis_auth_id IN NUMBER,
x_cal_type IN VARCHAR2,
x_ci_sequence_number IN NUMBER);
x_last_update_date IN DATE,
x_last_updated_by IN NUMBER,
x_last_update_login IN NUMBER
) AS
/*
|| Created By :
|| Created On : 08-MAR-2006
|| 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_svs_auth_cal
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');
SELECT rowid
FROM igs_en_svs_auth_cal
WHERE sevis_auth_id = x_sevis_auth_id
AND cal_type = x_cal_type
AND ci_sequence_number = x_ci_sequence_number
FOR UPDATE NOWAIT;
SELECT rowid
FROM igs_en_svs_auth_cal
WHERE ((sevis_auth_id = x_sevis_auth_id));
SELECT ROWID
FROM igs_en_svs_auth_cal
WHERE cal_type = x_cal_type
AND ci_sequence_number = x_ci_sequence_number ;
PROCEDURE beforedelete1(
x_sevis_auth_id IN NUMBER,
x_cal_type IN VARCHAR2,
x_ci_sequence_number IN NUMBER
) AS
CURSOR c_auth IS
SELECT eeo.ELGB_OVERRIDE_ID, esa.person_id
FROM IGS_EN_SVS_AUTH esa,
IGS_EN_ELGB_OVR eeo
WHERE esa.SEVIS_AUTH_ID = x_sevis_auth_id
AND esa.person_id = eeo.person_id
AND eeo.cal_type = x_cal_type
AND eeo.ci_sequence_number = x_ci_sequence_number;
SELECT 'X'
FROM IGS_EN_SVS_AUTH_CAL sac, IGS_EN_SVS_AUTH esa
WHERE esa.SEVIS_AUTH_ID <> x_sevis_auth_id
AND esa.person_id = cp_person_id
AND esa.sevis_auth_id = sac.sevis_auth_id
AND sac.cal_type = x_cal_type
AND sac.ci_sequence_number = x_ci_sequence_number ;
SELECT eos.rowid row_id, step_override_type, step_override_limit
FROM IGS_EN_ELGB_OVR_STEP eos
WHERE elgb_override_id = cp_elgb_override_id
AND STEP_OVERRIDE_TYPE IN ('FMIN_CRDT','FATD_TYPE');
IGS_EN_ELGB_OVR_STEP_PKG.DELETE_ROW(c_eos_rec.row_id);
END beforedelete1;
x_last_update_date IN DATE,
x_last_updated_by IN NUMBER,
x_last_update_login IN NUMBER
) AS
/*
|| Created By :
|| Created On : 08-MAR-2006
|| 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_sevis_auth_id,
x_cal_type,
x_ci_sequence_number,
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.sevis_auth_id,
new_references.cal_type,
new_references.ci_sequence_number
)
) THEN
fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
ELSIF (p_action = 'UPDATE') THEN
-- Call all the procedures related to Before Update.
check_parent_existance;
ELSIF (p_action = 'VALIDATE_INSERT') THEN
-- Call all the procedures related to Before Insert.
IF ( get_pk_for_validation (
new_references.sevis_auth_id,
new_references.cal_type,
new_references.ci_sequence_number
)
) THEN
fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
IF (p_action = 'DELETE') THEN
beforedelete1(
old_references.sevis_auth_id,
old_references.cal_type,
old_references.ci_sequence_number);
IF (p_action = 'INSERT') THEN
afterinsert1(
new_references.sevis_auth_id,
new_references.cal_type,
new_references.ci_sequence_number);
PROCEDURE afterinsert1(
x_sevis_auth_id IN NUMBER,
x_cal_type IN VARCHAR2,
x_ci_sequence_number IN NUMBER) IS
CURSOR c_step_exists IS
SELECT 'X'
FROM IGS_EN_ELGB_OVR_STEP eos,
IGS_EN_ELGB_OVR eo,
IGS_EN_SVS_AUTH esa
WHERE esa.sevis_auth_id = x_sevis_auth_id
AND esa.person_id = eo.person_id
AND eo.cal_type = x_cal_type
AND eo.CI_SEQUENCE_NUMBER = x_ci_sequence_number
AND eo.ELGB_OVERRIDE_ID = eos.ELGB_OVERRIDE_ID
AND eos.STEP_OVERRIDE_TYPE IN ('FMIN_CRDT','FATD_TYPE');
SELECT eo.ELGB_OVERRIDE_ID
FROM IGS_EN_SVS_AUTH esa, IGS_EN_ELGB_OVR eo
WHERE esa.sevis_auth_id = x_sevis_auth_id
AND esa.person_id = eo.person_id
AND eo.cal_type = x_cal_type
AND eo.ci_sequence_number = X_ci_sequence_number;
SELECT cal_type, ci_sequence_number
FROM IGS_EN_SVS_AUTH_CAL
WHERE sevis_auth_id = x_sevis_auth_id
ORDER BY CREATION_DATE ASC;
SELECT person_id
FROM igs_en_svs_auth
WHERE sevis_auth_id = x_sevis_auth_id;
SELECT STEP_OVERRIDE_TYPE, STEP_OVERRIDE_LIMIT
FROM IGS_EN_ELGB_OVR_STEP eos, IGS_EN_ELGB_OVR eo
WHERE eo.elgb_override_id = eos.elgb_override_id
AND eo.person_id = cp_person_id
AND eo.cal_type = cp_cal_type
AND eo.ci_sequence_number = cp_ci_sequence_number
AND STEP_OVERRIDE_TYPE IN ('FMIN_CRDT','FATD_TYPE')
ORDER BY eos.CREATION_DATE ASC;
igs_en_elgb_ovr_pkg.insert_row (
x_mode => 'R',
x_rowid => l_rowid,
x_elgb_override_id => l_elgb_override_id,
x_person_id => l_person_id,
x_cal_type => x_cal_type,
x_ci_sequence_number => x_ci_sequence_number
);
igs_en_elgb_ovr_step_pkg.insert_row (
x_mode => 'R',
x_rowid => l_rowid,
x_elgb_ovr_step_id => l_elgb_ovr_step_id,
x_elgb_override_id => l_elgb_override_id,
x_step_override_type => l_step,
x_step_override_dt => trunc(SYSDATE),
x_step_override_limit => l_limit
);
END afterinsert1;
PROCEDURE insert_row (
x_rowid IN OUT NOCOPY VARCHAR2,
x_sevis_auth_id IN NUMBER,
x_cal_type IN VARCHAR2,
x_ci_sequence_number IN NUMBER,
x_mode IN VARCHAR2
) AS
/*
|| Created By :
|| Created On : 08-MAR-2006
|| 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;
fnd_message.set_token ('ROUTINE', 'IGS_EN_SVS_AUTH_CAL_PKG.INSERT_ROW');
p_action => 'INSERT',
x_rowid => x_rowid,
x_sevis_auth_id => x_sevis_auth_id,
x_cal_type => x_cal_type,
x_ci_sequence_number => x_ci_sequence_number,
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_en_svs_auth_cal (
sevis_auth_id,
cal_type,
ci_sequence_number,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login
) VALUES (
new_references.sevis_auth_id,
new_references.cal_type,
new_references.ci_sequence_number,
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
rowid
FROM igs_en_svs_auth_cal
WHERE rowid = x_rowid
FOR UPDATE NOWAIT;
fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
PROCEDURE delete_row (
x_rowid IN VARCHAR2
) AS
/*
|| Created By :
|| Created On : 08-MAR-2006
|| 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_svs_auth_cal
WHERE rowid = x_rowid;
p_action => 'DELETE',
x_rowid => x_rowid
);
END delete_row;