The following lines contain the word 'select', 'insert', 'update' or 'delete':
x_last_update_date IN DATE DEFAULT NULL,
x_last_updated_by IN NUMBER DEFAULT NULL,
x_last_update_login IN NUMBER DEFAULT NULL,
x_uoo_id IN NUMBER DEFAULT NULL,
x_sua_ass_item_group_id IN NUMBER DEFAULT NULL,
x_midterm_mandatory_type_code IN VARCHAR2 DEFAULT NULL,
x_midterm_weight_qty IN NUMBER DEFAULT NULL,
x_final_mandatory_type_code IN VARCHAR2 DEFAULT NULL,
x_final_weight_qty IN NUMBER DEFAULT NULL,
x_submitted_date IN DATE DEFAULT NULL,
x_waived_flag IN VARCHAR2 DEFAULT NULL,
x_penalty_applied_flag IN VARCHAR2 DEFAULT NULL
) AS
/*
|| Created By : [email protected]
|| Created On : 28-DEC-2001
|| Purpose : Initialises the Old and New references for the columns of the table.
|| Known limitations, enhancements or remarks :
|| Change History :
|| Who When What
|| svanukur 29-APR-03 Set the value of uoo_id as part of MUS build
|| (reverse chronological order - newest change first)
*/
CURSOR cur_old_ref_values IS
SELECT *
FROM igs_as_suaai_ouhist
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_as_suaai_ouhist
WHERE ass_id = x_ass_id
AND course_cd = x_course_cd
AND creation_dt = x_creation_dt
AND hist_start_dt = x_hist_start_dt
AND person_id = x_person_id
AND uoo_id = x_uoo_id
FOR UPDATE NOWAIT;
SELECT rowid
FROM igs_as_suaai_ouhist
WHERE ((ass_id = x_ass_id) AND
(course_cd = x_course_cd) AND
(creation_dt = x_creation_dt) AND
(person_id = x_person_id) AND
(uoo_id = x_uoo_id));
SELECT rowid
FROM igs_as_suaai_ouhist
WHERE ((sua_ass_item_group_id = x_sua_ass_item_group_id));
x_last_update_date IN DATE DEFAULT NULL,
x_last_updated_by IN NUMBER DEFAULT NULL,
x_last_update_login IN NUMBER DEFAULT NULL,
x_uoo_id IN NUMBER DEFAULT NULL,
x_sua_ass_item_group_id IN NUMBER DEFAULT NULL,
x_midterm_mandatory_type_code IN VARCHAR2 DEFAULT NULL,
x_midterm_weight_qty IN NUMBER DEFAULT NULL,
x_final_mandatory_type_code IN VARCHAR2 DEFAULT NULL,
x_final_weight_qty IN NUMBER DEFAULT NULL,
x_submitted_date IN DATE DEFAULT NULL,
x_waived_flag IN VARCHAR2 DEFAULT NULL,
x_penalty_applied_flag IN VARCHAR2 DEFAULT NULL
) AS
/*
|| Created By : [email protected]
|| Created On : 28-DEC-2001
|| 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
||svanukur 29-APR-03 Added uoo_id as part of MUS build, # 2829262
|| (reverse chronological order - newest change first)
*/
BEGIN
set_column_values (
p_action,
x_rowid,
x_person_id,
x_course_cd,
x_unit_cd,
x_cal_type,
x_ci_sequence_number,
x_ass_id,
x_creation_dt,
x_grading_schema_cd,
x_gs_version_number,
x_grade,
x_outcome_dt,
x_mark,
x_outcome_comment_code,
x_hist_start_dt,
x_hist_end_dt,
x_hist_who,
x_creation_date,
x_created_by,
x_last_update_date,
x_last_updated_by,
x_last_update_login,
x_uoo_id,
x_sua_ass_item_group_id,
x_midterm_mandatory_type_code,
x_midterm_weight_qty,
x_final_mandatory_type_code,
x_final_weight_qty,
x_submitted_date,
x_waived_flag,
x_penalty_applied_flag
);
IF (p_action = 'INSERT') THEN
-- Call all the procedures related to Before Insert.
IF ( get_pk_for_validation(
new_references.ass_id,
new_references.course_cd,
new_references.creation_dt,
new_references.hist_start_dt,
new_references.person_id,
new_references.uoo_id
)
) 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.ass_id,
new_references.course_cd,
new_references.creation_dt,
new_references.hist_start_dt,
new_references.person_id,
new_references.uoo_id
)
) THEN
fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
PROCEDURE insert_row (
x_rowid IN OUT NOCOPY VARCHAR2,
x_person_id IN NUMBER,
x_course_cd IN VARCHAR2,
x_unit_cd IN VARCHAR2,
x_cal_type IN VARCHAR2,
x_ci_sequence_number IN NUMBER,
x_ass_id IN NUMBER,
x_creation_dt IN DATE,
x_grading_schema_cd IN VARCHAR2,
x_gs_version_number IN NUMBER,
x_grade IN VARCHAR2,
x_outcome_dt IN DATE,
x_mark IN NUMBER,
x_outcome_comment_code IN VARCHAR2,
x_hist_start_dt IN DATE,
x_hist_end_dt IN DATE,
x_hist_who IN NUMBER,
x_mode IN VARCHAR2 DEFAULT 'R' ,
x_uoo_id IN NUMBER,
x_sua_ass_item_group_id IN NUMBER DEFAULT NULL,
x_midterm_mandatory_type_code IN VARCHAR2 DEFAULT NULL,
x_midterm_weight_qty IN NUMBER DEFAULT NULL,
x_final_mandatory_type_code IN VARCHAR2 DEFAULT NULL,
x_final_weight_qty IN NUMBER DEFAULT NULL,
x_submitted_date IN DATE DEFAULT NULL,
x_waived_flag IN VARCHAR2 DEFAULT NULL,
x_penalty_applied_flag IN VARCHAR2 DEFAULT NULL
) AS
/*
|| Created By : [email protected]
|| Created On : 28-DEC-2001
|| Purpose : Handles the INSERT DML logic for the table.
|| Known limitations, enhancements or remarks :
|| Change History :
|| Who When What
||svanukur 29-APR-03 Added uoo_id as part of MUS build, # 2829262
|| (reverse chronological order - newest change first)
*/
CURSOR c IS
SELECT rowid
FROM igs_as_suaai_ouhist
WHERE ass_id = x_ass_id
AND course_cd = x_course_cd
AND creation_dt = x_creation_dt
AND hist_start_dt = x_hist_start_dt
AND person_id = x_person_id
AND uoo_id = x_uoo_id;
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_id => x_person_id,
x_course_cd => x_course_cd,
x_unit_cd => x_unit_cd,
x_cal_type => x_cal_type,
x_ci_sequence_number => x_ci_sequence_number,
x_ass_id => x_ass_id,
x_creation_dt => x_creation_dt,
x_grading_schema_cd => x_grading_schema_cd,
x_gs_version_number => x_gs_version_number,
x_grade => x_grade,
x_outcome_dt => x_outcome_dt,
x_mark => x_mark,
x_outcome_comment_code => x_outcome_comment_code,
x_hist_start_dt => x_hist_start_dt,
x_hist_end_dt => x_hist_end_dt,
x_hist_who => x_hist_who,
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_uoo_id => x_uoo_id,
x_sua_ass_item_group_id => x_sua_ass_item_group_id,
x_midterm_mandatory_type_code => x_midterm_mandatory_type_code,
x_midterm_weight_qty => x_midterm_weight_qty,
x_final_mandatory_type_code => x_final_mandatory_type_code,
x_final_weight_qty => x_final_weight_qty,
x_submitted_date => x_submitted_date,
x_waived_flag => x_waived_flag,
x_penalty_applied_flag => x_penalty_applied_flag
);
INSERT INTO igs_as_suaai_ouhist (
person_id,
course_cd,
unit_cd,
cal_type,
ci_sequence_number,
ass_id,
creation_dt,
grading_schema_cd,
gs_version_number,
grade,
outcome_dt,
mark,
outcome_comment_code,
hist_start_dt,
hist_end_dt,
hist_who,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login,
uoo_id,
sua_ass_item_group_id,
midterm_mandatory_type_code,
midterm_weight_qty,
final_mandatory_type_code,
final_weight_qty,
submitted_date,
waived_flag,
penalty_applied_flag
) VALUES (
new_references.person_id,
new_references.course_cd,
new_references.unit_cd,
new_references.cal_type,
new_references.ci_sequence_number,
new_references.ass_id,
new_references.creation_dt,
new_references.grading_schema_cd,
new_references.gs_version_number,
new_references.grade,
new_references.outcome_dt,
new_references.mark,
new_references.outcome_comment_code,
new_references.hist_start_dt,
new_references.hist_end_dt,
new_references.hist_who,
x_last_update_date,
x_last_updated_by,
x_last_update_date,
x_last_updated_by,
x_last_update_login,
new_references.uoo_id,
new_references.sua_ass_item_group_id,
new_references.midterm_mandatory_type_code,
new_references.midterm_weight_qty,
new_references.final_mandatory_type_code,
new_references.final_weight_qty,
new_references.submitted_date,
new_references.waived_flag,
new_references.penalty_applied_flag
);
END insert_row;
SELECT
grading_schema_cd,
gs_version_number,
grade,
outcome_dt,
mark,
outcome_comment_code,
hist_end_dt,
hist_who,
sua_ass_item_group_id,
midterm_mandatory_type_code,
midterm_weight_qty,
final_mandatory_type_code,
final_weight_qty,
submitted_date,
waived_flag,
penalty_applied_flag
FROM igs_as_suaai_ouhist
WHERE rowid = x_rowid
FOR UPDATE NOWAIT;
fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
PROCEDURE update_row (
x_rowid IN VARCHAR2,
x_person_id IN NUMBER,
x_course_cd IN VARCHAR2,
x_unit_cd IN VARCHAR2,
x_cal_type IN VARCHAR2,
x_ci_sequence_number IN NUMBER,
x_ass_id IN NUMBER,
x_creation_dt IN DATE,
x_grading_schema_cd IN VARCHAR2,
x_gs_version_number IN NUMBER,
x_grade IN VARCHAR2,
x_outcome_dt IN DATE,
x_mark IN NUMBER,
x_outcome_comment_code IN VARCHAR2,
x_hist_start_dt IN DATE,
x_hist_end_dt IN DATE,
x_hist_who IN NUMBER,
x_mode IN VARCHAR2 DEFAULT 'R' ,
x_uoo_id IN NUMBER,
x_sua_ass_item_group_id IN NUMBER DEFAULT NULL,
x_midterm_mandatory_type_code IN VARCHAR2 DEFAULT NULL,
x_midterm_weight_qty IN NUMBER DEFAULT NULL,
x_final_mandatory_type_code IN VARCHAR2 DEFAULT NULL,
x_final_weight_qty IN NUMBER DEFAULT NULL,
x_submitted_date IN DATE DEFAULT NULL,
x_waived_flag IN VARCHAR2 DEFAULT NULL,
x_penalty_applied_flag IN VARCHAR2 DEFAULT NULL
) AS
/*
|| Created By : [email protected]
|| Created On : 28-DEC-2001
|| 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)
||svanukur 29-APR-03 Added uoo_id as part of MUS build, # 2829262
*/
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_id => x_person_id,
x_course_cd => x_course_cd,
x_unit_cd => x_unit_cd,
x_cal_type => x_cal_type,
x_ci_sequence_number => x_ci_sequence_number,
x_ass_id => x_ass_id,
x_creation_dt => x_creation_dt,
x_grading_schema_cd => x_grading_schema_cd,
x_gs_version_number => x_gs_version_number,
x_grade => x_grade,
x_outcome_dt => x_outcome_dt,
x_mark => x_mark,
x_outcome_comment_code => x_outcome_comment_code,
x_hist_start_dt => x_hist_start_dt,
x_hist_end_dt => x_hist_end_dt,
x_hist_who => x_hist_who,
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_uoo_id => x_uoo_id,
x_sua_ass_item_group_id => x_sua_ass_item_group_id,
x_midterm_mandatory_type_code => x_midterm_mandatory_type_code,
x_midterm_weight_qty => x_midterm_weight_qty,
x_final_mandatory_type_code => x_final_mandatory_type_code,
x_final_weight_qty => x_final_weight_qty,
x_submitted_date => x_submitted_date,
x_waived_flag => x_waived_flag,
x_penalty_applied_flag => x_penalty_applied_flag
);
UPDATE igs_as_suaai_ouhist
SET
grading_schema_cd = new_references.grading_schema_cd,
gs_version_number = new_references.gs_version_number,
grade = new_references.grade,
outcome_dt = new_references.outcome_dt,
mark = new_references.mark,
outcome_comment_code = new_references.outcome_comment_code,
hist_end_dt = new_references.hist_end_dt,
hist_who = new_references.hist_who,
last_update_date = x_last_update_date,
last_updated_by = x_last_updated_by,
last_update_login = x_last_update_login,
sua_ass_item_group_id = x_sua_ass_item_group_id,
midterm_mandatory_type_code = x_midterm_mandatory_type_code,
midterm_weight_qty = x_midterm_weight_qty,
final_mandatory_type_code = x_final_mandatory_type_code,
final_weight_qty = x_final_weight_qty,
submitted_date = x_submitted_date,
waived_flag = x_waived_flag,
penalty_applied_flag = x_penalty_applied_flag
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)
||svanukur 29-APR-03 Added uoo_id as part of MUS build, # 2829262
*/
CURSOR c1 IS
SELECT rowid
FROM igs_as_suaai_ouhist
WHERE ass_id = x_ass_id
AND course_cd = x_course_cd
AND creation_dt = x_creation_dt
AND hist_start_dt = x_hist_start_dt
AND person_id = x_person_id
AND uoo_id = x_uoo_id;
insert_row (
x_rowid,
x_person_id,
x_course_cd,
x_unit_cd,
x_cal_type,
x_ci_sequence_number,
x_ass_id,
x_creation_dt,
x_grading_schema_cd,
x_gs_version_number,
x_grade,
x_outcome_dt,
x_mark,
x_outcome_comment_code,
x_hist_start_dt,
x_hist_end_dt,
x_hist_who,
x_mode,
x_uoo_id,
x_sua_ass_item_group_id,
x_midterm_mandatory_type_code,
x_midterm_weight_qty,
x_final_mandatory_type_code,
x_final_weight_qty,
x_submitted_date,
x_waived_flag,
x_penalty_applied_flag
);
update_row (
x_rowid,
x_person_id,
x_course_cd,
x_unit_cd,
x_cal_type,
x_ci_sequence_number,
x_ass_id,
x_creation_dt,
x_grading_schema_cd,
x_gs_version_number,
x_grade,
x_outcome_dt,
x_mark,
x_outcome_comment_code,
x_hist_start_dt,
x_hist_end_dt,
x_hist_who,
x_mode,
x_uoo_id,
x_sua_ass_item_group_id,
x_midterm_mandatory_type_code,
x_midterm_weight_qty,
x_final_mandatory_type_code,
x_final_weight_qty,
x_submitted_date,
x_waived_flag,
x_penalty_applied_flag
);
PROCEDURE delete_row (
x_rowid IN VARCHAR2
) AS
/*
|| Created By : [email protected]
|| Created On : 28-DEC-2001
|| 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)
||svanukur 29-APR-03 Added uoo_id as part of MUS build, # 2829262
*/
BEGIN
before_dml (
p_action => 'DELETE',
x_rowid => x_rowid
);
DELETE FROM igs_as_suaai_ouhist
WHERE rowid = x_rowid;
END delete_row;