The following lines contain the word 'select', 'insert', 'update' or 'delete':
| that they were inserted by datamerge. |
| |
| The ADD_ROW routine will see whether a row exists by selecting |
| based on the primary key, and updates the row if it exists, |
| or inserts the row if it doesn't already exist. |
| |
| This module is called by AutoInstall (afplss.drv) on install and |
| upgrade. The WHENEVER SQLERROR and EXIT (at bottom) are required. |
| |
| HISTORY |
| museshad 10-Aug-2006 5337555. Build FA 163.TBH Impact changes|
| veramach July 2004 FA 151 HR integration (bug # 3709292) |
| Impact of obsoleting columns from |
| igf_aw_awd_disb_pkg |
| Bug No :- 2154941 |
| Desc :- Disbursement and Sponsership Build for Jul 2002 FACCR004 |
| WHO WHEN WHAT
--
-- Bug ID 2544864
-- sjadhav Oct.07.2002 Gscc fix of removing the Default Keyword
--
--
-- Bug 2255279
-- sjadhav, set elig_status = 'O' [ OVERAWARD ]
-- and elig_status_date = systdate in case of a overaward hold
--
| mesriniv 31-JAN-2002 Made the call to check uniqueness in
| update only when the new and old values are diff
| mesriniv 8-JAN-2002 Created this Table Handler
| Added a procedure check_uniqueness for Business
| whenever record is inserted or updated
| from form or package |
*=======================================================================*/
l_rowid VARCHAR2(25);
x_last_update_date IN DATE ,
x_last_updated_by IN NUMBER ,
x_last_update_login IN NUMBER
) AS
/*
|| Created By : mesriniv
|| Created On : 08-JAN-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 igf_db_disb_holds_all
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 COUNT(HOLD_ID)
FROM igf_db_disb_holds
WHERE award_id = x_award_id
AND disb_num = x_disb_num
AND hold = x_hold
AND release_flag ='N'
AND ROWNUM <= 1;
fnd_message.set_name ('FND', 'FORM_RECORD_DELETED');
SELECT rowid
FROM igf_db_disb_holds_all
WHERE hold_id = x_hold_id
FOR UPDATE NOWAIT;
SELECT rowid
FROM igf_db_disb_holds_all
WHERE ((award_id = x_award_id) AND
(disb_num = x_disb_num));
x_last_update_date IN DATE ,
x_last_updated_by IN NUMBER ,
x_last_update_login IN NUMBER
) AS
/*
|| Created By : mesriniv
|| Created On : 08-JAN-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_hold_id,
x_award_id,
x_disb_num,
x_hold,
x_hold_date,
x_hold_type,
x_release_date,
x_release_flag,
x_release_reason,
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.hold_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.
--Call this Check Uniqueness only for a release flag of N
IF x_release_flag='N' AND new_references.hold <> old_references.hold THEN
check_uniqueness(x_award_id,x_disb_num,x_hold);
ELSIF (p_action = 'VALIDATE_INSERT') THEN
-- Call all the procedures related to Before Insert.
IF ( get_pk_for_validation (
new_references.hold_id
)
) THEN
fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
ELSIF (p_action = 'VALIDATE_UPDATE') THEN
--Call this Check Uniqueness only for a release flag of N
IF x_release_flag='N' AND new_references.hold <> old_references.hold THEN
check_uniqueness(x_award_id,x_disb_num,x_hold);
PROCEDURE insert_row (
x_rowid IN OUT NOCOPY VARCHAR2,
x_hold_id IN OUT NOCOPY NUMBER,
x_award_id IN NUMBER,
x_disb_num IN NUMBER,
x_hold IN VARCHAR2,
x_hold_date IN VARCHAR2,
x_hold_type IN VARCHAR2,
x_release_date IN DATE,
x_release_flag IN VARCHAR2,
x_release_reason IN VARCHAR2,
x_mode IN VARCHAR2
) AS
/*
|| Created By : mesriniv
|| Created On : 08-JAN-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)
*/
CURSOR c IS
SELECT rowid
FROM igf_db_disb_holds_all
WHERE hold_id = x_hold_id;
SELECT *
FROM igf_aw_awd_disb
WHERE award_id =x_award_id
AND disb_num =x_disb_num
FOR UPDATE OF manual_hold_ind NOWAIT;
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;
SELECT igf_db_disb_holds_s.NEXTVAL
INTO x_hold_id
FROM dual;
p_action => 'INSERT',
x_rowid => x_rowid,
x_hold_id => x_hold_id,
x_award_id => x_award_id,
x_disb_num => x_disb_num,
x_hold => x_hold,
x_hold_date => x_hold_date,
x_hold_type => x_hold_type,
x_release_date => x_release_date,
x_release_flag => x_release_flag,
x_release_reason => x_release_reason,
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 igf_db_disb_holds_all (
hold_id,
award_id,
disb_num,
hold,
hold_date,
hold_type,
release_date,
release_flag,
release_reason,
org_id,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login
) VALUES (
new_references.hold_id,
new_references.award_id,
new_references.disb_num,
new_references.hold,
new_references.hold_date,
new_references.hold_type,
new_references.release_date,
new_references.release_flag,
new_references.release_reason,
new_references.org_id,
x_last_update_date,
x_last_updated_by,
x_last_update_date,
x_last_updated_by,
x_last_update_login
);
igf_aw_awd_disb_pkg.update_row(
x_rowid => l_disb_rec.row_id,
x_award_id => l_disb_rec.award_id,
x_disb_num => l_disb_rec.disb_num,
x_tp_cal_type => l_disb_rec.tp_cal_type,
x_tp_sequence_number => l_disb_rec.tp_sequence_number,
x_disb_gross_amt => l_disb_rec.disb_gross_amt,
x_fee_1 => l_disb_rec.fee_1,
x_fee_2 => l_disb_rec.fee_2,
x_disb_net_amt => l_disb_rec.disb_net_amt,
x_disb_date => l_disb_rec.disb_date,
x_trans_type => l_disb_rec.trans_type,
x_elig_status => l_disb_rec.elig_status,
x_elig_status_date => l_disb_rec.elig_status_date,
x_affirm_flag => l_disb_rec.affirm_flag,
x_hold_rel_ind => l_disb_rec.hold_rel_ind,
x_manual_hold_ind => 'Y',
x_disb_status => l_disb_rec.disb_status,
x_disb_status_date => l_disb_rec.disb_status_date,
x_late_disb_ind => l_disb_rec.late_disb_ind,
x_fund_dist_mthd => l_disb_rec.fund_dist_mthd,
x_prev_reported_ind => l_disb_rec.prev_reported_ind,
x_fund_release_date => l_disb_rec.fund_release_date,
x_fund_status => l_disb_rec.fund_status,
x_fund_status_date => l_disb_rec.fund_status_date,
x_fee_paid_1 => l_disb_rec.fee_paid_1,
x_fee_paid_2 => l_disb_rec. fee_paid_2,
x_cheque_number => l_disb_rec.cheque_number,
x_ld_cal_type => l_disb_rec.ld_cal_type,
x_ld_sequence_number => l_disb_rec.ld_sequence_number,
x_disb_accepted_amt => l_disb_rec.disb_accepted_amt,
x_disb_paid_amt => l_disb_rec.disb_paid_amt,
x_rvsn_id => l_disb_rec.rvsn_id,
x_int_rebate_amt => l_disb_rec.int_rebate_amt,
x_force_disb => l_disb_rec.force_disb,
x_min_credit_pts => l_disb_rec.min_credit_pts,
x_disb_exp_dt => l_disb_rec.disb_exp_dt,
x_verf_enfr_dt => l_disb_rec.verf_enfr_dt,
x_fee_class => l_disb_rec. fee_class,
x_show_on_bill => l_disb_rec.show_on_bill,
x_attendance_type_code => l_disb_rec.attendance_type_code,
x_base_attendance_type_code => l_disb_rec.base_attendance_type_code,
x_payment_prd_st_date => l_disb_rec.payment_prd_st_date,
x_change_type_code => l_disb_rec.change_type_code,
x_fund_return_mthd_code => l_disb_rec.fund_return_mthd_code,
x_direct_to_borr_flag => l_disb_rec.direct_to_borr_flag,
x_mode => 'R');
END insert_row;
SELECT
award_id,
disb_num,
hold,
hold_date,
hold_type,
release_date,
release_flag,
release_reason
FROM igf_db_disb_holds_all
WHERE rowid = x_rowid
FOR UPDATE NOWAIT;
fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
PROCEDURE update_row (
x_rowid IN VARCHAR2,
x_hold_id IN NUMBER,
x_award_id IN NUMBER,
x_disb_num IN NUMBER,
x_hold IN VARCHAR2,
x_hold_date IN VARCHAR2,
x_hold_type IN VARCHAR2,
x_release_date IN DATE,
x_release_flag IN VARCHAR2,
x_release_reason IN VARCHAR2,
x_mode IN VARCHAR2
) AS
/*
|| Created By : mesriniv
|| Created On : 08-JAN-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;
SELECT hold_id
FROM igf_db_disb_holds
WHERE disb_num =x_disb_num
AND award_id = x_award_id
AND release_flag ='N';
SELECT * FROM igf_aw_awd_disb
WHERE award_id=x_award_id
AND disb_num =x_disb_num
FOR UPDATE OF disb_num NOWAIT;
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_hold_id => x_hold_id,
x_award_id => x_award_id,
x_disb_num => x_disb_num,
x_hold => x_hold,
x_hold_date => x_hold_date,
x_hold_type => x_hold_type,
x_release_date => x_release_date,
x_release_flag => x_release_flag,
x_release_reason => x_release_reason,
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 igf_db_disb_holds_all
SET
award_id = new_references.award_id,
disb_num = new_references.disb_num,
hold = new_references.hold,
hold_date = new_references.hold_date,
hold_type = new_references.hold_type,
release_date = new_references.release_date,
release_flag = new_references.release_flag,
release_reason = new_references.release_reason,
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;
igf_aw_awd_disb_pkg.update_row(
x_rowid => l_disb_rec.row_id,
x_award_id => l_disb_rec.award_id,
x_disb_num => l_disb_rec.disb_num,
x_tp_cal_type => l_disb_rec.tp_cal_type,
x_tp_sequence_number => l_disb_rec.tp_sequence_number,
x_disb_gross_amt => l_disb_rec.disb_gross_amt,
x_fee_1 => l_disb_rec.fee_1,
x_fee_2 => l_disb_rec.fee_2,
x_disb_net_amt => l_disb_rec.disb_net_amt,
x_disb_date => l_disb_rec.disb_date,
x_trans_type => l_disb_rec.trans_type,
x_elig_status => l_disb_rec.elig_status,
x_elig_status_date => l_disb_rec.elig_status_date,
x_affirm_flag => l_disb_rec.affirm_flag,
x_hold_rel_ind => l_disb_rec.hold_rel_ind,
x_manual_hold_ind => 'N',
x_disb_status => l_disb_rec.disb_status,
x_disb_status_date => l_disb_rec.disb_status_date,
x_late_disb_ind => l_disb_rec.late_disb_ind,
x_fund_dist_mthd => l_disb_rec.fund_dist_mthd,
x_prev_reported_ind => l_disb_rec.prev_reported_ind,
x_fund_release_date => l_disb_rec.fund_release_date,
x_fund_status => l_disb_rec.fund_status,
x_fund_status_date => l_disb_rec.fund_status_date,
x_fee_paid_1 => l_disb_rec.fee_paid_1,
x_fee_paid_2 => l_disb_rec. fee_paid_2,
x_cheque_number => l_disb_rec.cheque_number,
x_ld_cal_type => l_disb_rec.ld_cal_type,
x_ld_sequence_number => l_disb_rec.ld_sequence_number,
x_disb_accepted_amt => l_disb_rec.disb_accepted_amt,
x_disb_paid_amt => l_disb_rec.disb_paid_amt,
x_rvsn_id => l_disb_rec.rvsn_id,
x_int_rebate_amt => l_disb_rec.int_rebate_amt,
x_force_disb => l_disb_rec.force_disb,
x_min_credit_pts => l_disb_rec.min_credit_pts,
x_disb_exp_dt => l_disb_rec.disb_exp_dt,
x_verf_enfr_dt => l_disb_rec.verf_enfr_dt,
x_fee_class => l_disb_rec. fee_class,
x_show_on_bill => l_disb_rec.show_on_bill,
x_attendance_type_code => l_disb_rec.attendance_type_code,
x_base_attendance_type_code => l_disb_rec.base_attendance_type_code,
x_payment_prd_st_date => l_disb_rec.payment_prd_st_date,
x_change_type_code => l_disb_rec.change_type_code,
x_fund_return_mthd_code => l_disb_rec.fund_return_mthd_code,
x_direct_to_borr_flag => l_disb_rec.direct_to_borr_flag,
x_mode => 'R'
);
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 igf_db_disb_holds_all
WHERE hold_id = x_hold_id;
insert_row (
x_rowid,
x_hold_id,
x_award_id,
x_disb_num,
x_hold,
x_hold_date,
x_hold_type,
x_release_date,
x_release_flag,
x_release_reason,
x_mode
);
update_row (
x_rowid,
x_hold_id,
x_award_id,
x_disb_num,
x_hold,
x_hold_date,
x_hold_type,
x_release_date,
x_release_flag,
x_release_reason,
x_mode
);
PROCEDURE delete_row (
x_rowid IN VARCHAR2
) AS
/*
|| Created By : mesriniv
|| Created On : 08-JAN-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 igf_db_disb_holds_all
WHERE rowid = x_rowid;
END delete_row;