The following lines contain the word 'select', 'insert', 'update' or 'delete':
x_accept_delete_flag IN VARCHAR2,
x_creation_date IN DATE,
x_created_by IN NUMBER,
x_last_update_date IN DATE,
x_last_updated_by IN NUMBER,
x_last_update_login IN NUMBER
) AS
/*
|| Created By : [email protected]
|| Created On : 15-MAY-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_az_students
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');
new_references.accept_delete_flag := x_accept_delete_flag;
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');
SELECT ROWID
FROM igs_az_students
WHERE group_student_id = x_group_student_id;
SELECT ROWID
FROM igs_az_students
WHERE student_person_id = x_student_person_id
AND group_name = x_group_name
AND ((l_rowid IS NULL) OR (ROWID <> l_rowid));
SELECT ROWID
FROM igs_az_students
WHERE ((group_name = x_group_name));
PROCEDURE update_az_advising_rel
AS
BEGIN
IF ((new_references.end_date IS NULL AND old_references.end_date IS NOT NULL) OR
(new_references.end_date IS NOT NULL AND old_references.end_date IS NULL) OR
( NVL(TRUNC(new_references.end_date),TRUNC(SYSDATE)) <> NVL(TRUNC(old_references.end_date),TRUNC(SYSDATE)) )) THEN
-- call the procedure
igs_az_gen_001.end_date_student(
p_group_name => new_references.group_name,
p_student_person_id => new_references.student_person_id,
p_end_date => new_references.end_date,
p_calling_mod => NULL );
new_references.accept_delete_flag := NULL;
END update_az_advising_rel;
x_accept_delete_flag IN VARCHAR2,
x_creation_date IN DATE,
x_created_by IN NUMBER,
x_last_update_date IN DATE,
x_last_updated_by IN NUMBER,
x_last_update_login IN NUMBER
) AS
/*
|| Created By : [email protected]
|| Created On : 15-MAY-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 :
|| Who When What
|| (reverse chronological order - newest change first)
*/
BEGIN
set_column_values (
p_action,
x_rowid,
x_group_student_id,
x_group_name,
x_student_person_id,
x_start_date,
x_end_date,
x_advising_hold_type,
x_hold_start_date,
x_notified_date,
x_accept_add_flag,
x_accept_delete_flag,
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.group_student_id
)
) THEN
fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
update_az_advising_rel;
ELSIF (p_action = 'UPDATE') THEN
-- Call all the procedures related to Before Update.
check_uniqueness;
update_az_advising_rel;
ELSIF (p_action = 'DELETE') THEN
-- Call all the procedures related to Before Delete.
check_child_existance;
ELSIF (p_action = 'VALIDATE_INSERT') THEN
-- Call all the procedures related to Before Insert.
IF ( get_pk_for_validation (
new_references.group_student_id
)
) THEN
fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
update_az_advising_rel;
ELSIF (p_action = 'VALIDATE_UPDATE') THEN
check_uniqueness;
update_az_advising_rel;
ELSIF (p_action = 'VALIDATE_DELETE') THEN
check_child_existance;
PROCEDURE insert_row (
x_rowid IN OUT NOCOPY VARCHAR2,
x_group_student_id IN OUT NOCOPY NUMBER,
x_group_name IN VARCHAR2,
x_student_person_id IN NUMBER,
x_start_date IN DATE,
x_end_date IN DATE,
x_advising_hold_type IN VARCHAR2,
x_hold_start_date IN DATE,
x_notified_date IN DATE,
x_accept_add_flag IN VARCHAR2,
x_accept_delete_flag IN VARCHAR2,
x_mode IN VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_data OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER
) AS
/*
|| Created By : [email protected]
|| Created On : 15-MAY-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_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_AZ_STUDENTS_PKG.INSERT_ROW');
p_action => 'INSERT',
x_rowid => x_rowid,
x_group_student_id => x_group_student_id,
x_group_name => x_group_name,
x_student_person_id => x_student_person_id,
x_start_date => x_start_date,
x_end_date => x_end_date,
x_advising_hold_type => x_advising_hold_type,
x_hold_start_date => x_hold_start_date,
x_notified_date => x_notified_date,
x_accept_add_flag => x_accept_add_flag,
x_accept_delete_flag => x_accept_delete_flag,
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_az_students (
group_student_id,
group_name,
student_person_id,
start_date,
end_date,
advising_hold_type,
hold_start_date,
notified_date,
accept_add_flag,
accept_delete_flag,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login
) VALUES (
igs_az_students_s.NEXTVAL,
new_references.group_name,
new_references.student_person_id,
new_references.start_date,
new_references.end_date,
new_references.advising_hold_type,
new_references.hold_start_date,
new_references.notified_date,
new_references.accept_add_flag,
new_references.accept_delete_flag,
x_last_update_date,
x_last_updated_by,
x_last_update_date,
x_last_updated_by,
x_last_update_login
) RETURNING ROWID, group_student_id INTO x_rowid, x_group_student_id;
FND_MESSAGE.SET_TOKEN('NAME','Insert_Row : '||SQLERRM);
END insert_row;
x_accept_delete_flag IN VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_data OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER
) AS
/*
|| Created By : [email protected]
|| Created On : 15-MAY-2003
|| Purpose : Handles the LOCK mechanism for the table.
|| Known limitations, enhancements or remarks :
|| Change History :
|| Who When What
|| (reverse chronological order - newest change first)
*/
CURSOR c1 IS
SELECT
group_name,
student_person_id,
start_date,
end_date,
advising_hold_type,
hold_start_date,
notified_date,
accept_add_flag,
accept_delete_flag
FROM igs_az_students
WHERE ROWID = x_rowid
FOR UPDATE NOWAIT;
fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
AND ((tlinfo.accept_delete_flag = x_accept_delete_flag) OR ((tlinfo.accept_delete_flag IS NULL) AND (x_accept_delete_flag IS NULL)))
) THEN
NULL;
FND_MESSAGE.SET_TOKEN('NAME','Insert_Row : '||SQLERRM);
PROCEDURE update_row (
x_rowid IN VARCHAR2,
x_group_student_id IN OUT NOCOPY NUMBER,
x_group_name IN VARCHAR2,
x_student_person_id IN NUMBER,
x_start_date IN DATE,
x_end_date IN DATE,
x_advising_hold_type IN VARCHAR2,
x_hold_start_date IN DATE,
x_notified_date IN DATE,
x_accept_add_flag IN VARCHAR2,
x_accept_delete_flag IN VARCHAR2,
x_mode IN VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_data OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER
) AS
/*
|| Created By : [email protected]
|| Created On : 15-MAY-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_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_AZ_STUDENTS_PKG.UPDATE_ROW');
p_action => 'UPDATE',
x_rowid => x_rowid,
x_group_student_id => x_group_student_id,
x_group_name => x_group_name,
x_student_person_id => x_student_person_id,
x_start_date => x_start_date,
x_end_date => x_end_date,
x_advising_hold_type => x_advising_hold_type,
x_hold_start_date => x_hold_start_date,
x_notified_date => x_notified_date,
x_accept_add_flag => x_accept_add_flag,
x_accept_delete_flag => x_accept_delete_flag,
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_az_students
SET
group_name = new_references.group_name,
student_person_id = new_references.student_person_id,
start_date = new_references.start_date,
end_date = new_references.end_date,
advising_hold_type = new_references.advising_hold_type,
hold_start_date = new_references.hold_start_date,
notified_date = new_references.notified_date,
accept_add_flag = new_references.accept_add_flag,
accept_delete_flag = new_references.accept_delete_flag,
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;
FND_MESSAGE.SET_TOKEN('NAME','Update_Row : '||SQLERRM);
END update_row;
x_accept_delete_flag IN VARCHAR2,
x_mode IN VARCHAR2
) AS
/*
|| Created By : [email protected]
|| Created On : 15-MAY-2003
|| 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_az_students
WHERE group_student_id = x_group_student_id;
insert_row (
x_rowid,
x_group_student_id,
x_group_name,
x_student_person_id,
x_start_date,
x_end_date,
x_advising_hold_type,
x_hold_start_date,
x_notified_date,
x_accept_add_flag,
x_accept_delete_flag,
x_mode,
l_return_status,
l_msg_data,
l_msg_count
);
update_row (
x_rowid,
x_group_student_id,
x_group_name,
x_student_person_id,
x_start_date,
x_end_date,
x_advising_hold_type,
x_hold_start_date,
x_notified_date,
x_accept_add_flag,
x_accept_delete_flag,
x_mode,
l_return_status,
l_msg_data,
l_msg_count
);
PROCEDURE delete_row (
x_rowid IN VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_data OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER
) AS
/*
|| Created By : [email protected]
|| Created On : 15-MAY-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
FND_MSG_PUB.initialize;
p_action => 'DELETE',
x_rowid => x_rowid
);
DELETE FROM igs_az_students
WHERE ROWID = x_rowid;
FND_MESSAGE.SET_TOKEN('NAME','Insert_Row : '||SQLERRM);
END delete_row;