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_notification_date IN DATE,
x_interest_rebate_amt IN NUMBER,
x_ld_cal_type IN VARCHAR2,
x_ld_sequence_number IN NUMBER
) AS
/*
|| Created By : prchandr
|| Created On : 14-DEC-2000
|| 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_awd_disb_dtl_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;
fnd_message.set_name ('FND', 'FORM_RECORD_DELETED');
SELECT rowid
FROM igf_db_awd_disb_dtl_all
WHERE award_id = x_award_id
AND disb_num = x_disb_num
AND disb_seq_num = x_disb_seq_num
FOR UPDATE NOWAIT;
SELECT rowid
FROM igf_db_awd_disb_dtl_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,
x_notification_date IN DATE,
x_interest_rebate_amt IN NUMBER,
x_ld_cal_type IN VARCHAR2,
x_ld_sequence_number IN NUMBER
) AS
/*
|| Created By : prchandr
|| Created On : 14-DEC-2000
|| 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
|| veramach 23-SEP-2003 1.Added rowid check in cursors c_sf_credit_id,
|| c_spnsr_credit_id,c_spnsr_charge_id,c_sf_invoice_num
|| (reverse chronological order - newest change first)
*/
CURSOR c_sf_credit_id(cp_sf_credit_id NUMBER)
IS
SELECT 'X'
FROM igf_db_awd_disb_dtl
WHERE sf_credit_id = cp_sf_credit_id
AND ((l_rowid IS NULL) OR (x_rowid <> l_rowid));
SELECT 'X'
FROM igf_db_awd_disb_dtl
WHERE spnsr_credit_id = cp_spnsr_credit_id
AND ((l_rowid IS NULL) OR (x_rowid <> l_rowid));
SELECT 'X'
FROM igf_db_awd_disb_dtl
WHERE spnsr_charge_id = cp_spnsr_charge_id
AND ((l_rowid IS NULL) OR (x_rowid <> l_rowid));
SELECT 'X'
FROM igf_db_awd_disb_dtl
WHERE sf_invoice_num = cp_sf_invoice_num
AND ((l_rowid IS NULL) OR (x_rowid <> l_rowid));
x_last_update_date,
x_last_updated_by,
x_last_update_login ,
x_notification_date,
x_interest_rebate_amt,
x_ld_cal_type,
x_ld_sequence_number
);
IF (p_action = 'INSERT') THEN
-- Check for uniqueness of Credit Number
IF new_references.sf_credit_id IS NOT NULL THEN
OPEN c_sf_credit_id(new_references.sf_credit_id);
ELSIF (p_action = 'UPDATE') THEN
-- Check for uniqueness of Credit Number
IF new_references.sf_credit_id IS NOT NULL THEN
OPEN c_sf_credit_id(new_references.sf_credit_id);
ELSIF (p_action = 'DELETE') THEN
-- Call all the procedures related to Before Delete.
null;
ELSIF (p_action = 'VALIDATE_INSERT') THEN
-- Call all the procedures related to Before Insert.
IF ( get_pk_for_validation (
new_references.award_id,
new_references.disb_num,
new_references.disb_seq_num
)
) THEN
fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
ELSIF (p_action = 'VALIDATE_DELETE') THEN
null;
PROCEDURE insert_row (
x_rowid IN OUT NOCOPY VARCHAR2,
x_award_id IN NUMBER,
x_disb_num IN NUMBER,
x_disb_seq_num IN NUMBER,
x_disb_gross_amt IN NUMBER,
x_fee_1 IN NUMBER,
x_fee_2 IN NUMBER,
x_disb_net_amt IN NUMBER,
x_disb_adj_amt IN NUMBER,
x_disb_date IN DATE,
x_fee_paid_1 IN NUMBER,
x_fee_paid_2 IN NUMBER,
x_disb_activity IN VARCHAR2,
x_disb_batch_id IN VARCHAR2,
x_disb_ack_date IN DATE,
x_booking_batch_id IN VARCHAR2,
x_booked_date IN DATE,
x_disb_status IN VARCHAR2,
x_disb_status_date IN DATE,
x_sf_status IN VARCHAR2,
x_sf_status_date IN DATE,
x_sf_invoice_num IN NUMBER,
x_spnsr_credit_id IN NUMBER,
x_spnsr_charge_id IN NUMBER,
x_sf_credit_id IN NUMBER,
x_error_desc IN VARCHAR2,
x_mode IN VARCHAR2,
x_notification_date IN DATE,
x_interest_rebate_amt IN NUMBER,
x_ld_cal_type IN VARCHAR2,
x_ld_sequence_number IN NUMBER
) AS
/*
|| Created By : prchandr
|| Created On : 14-DEC-2000
|| 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_awd_disb_dtl_all
WHERE award_id = x_award_id
AND disb_num = x_disb_num
AND disb_seq_num = x_disb_seq_num;
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;
p_action => 'INSERT',
x_rowid => x_rowid,
x_award_id => x_award_id,
x_disb_num => x_disb_num,
x_disb_seq_num => x_disb_seq_num,
x_disb_gross_amt => x_disb_gross_amt,
x_fee_1 => x_fee_1,
x_fee_2 => x_fee_2,
x_disb_net_amt => x_disb_net_amt,
x_disb_adj_amt => x_disb_adj_amt,
x_disb_date => x_disb_date,
x_fee_paid_1 => x_fee_paid_1,
x_fee_paid_2 => x_fee_paid_2,
x_disb_activity => x_disb_activity,
x_disb_batch_id => x_disb_batch_id,
x_disb_ack_date => x_disb_ack_date,
x_booking_batch_id => x_booking_batch_id,
x_booked_date => x_booked_date,
x_disb_status => x_disb_status,
x_disb_status_date => x_disb_status_date,
x_sf_status => x_sf_status,
x_sf_status_date => x_sf_status_date,
x_sf_invoice_num => x_sf_invoice_num,
x_spnsr_credit_id => x_spnsr_credit_id,
x_spnsr_charge_id => x_spnsr_charge_id,
x_sf_credit_id => x_sf_credit_id,
x_error_desc => x_error_desc,
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_notification_date => x_notification_date,
x_interest_rebate_amt => x_interest_rebate_amt,
x_ld_cal_type => x_ld_cal_type,
x_ld_sequence_number => x_ld_sequence_number
);
INSERT INTO igf_db_awd_disb_dtl_all (
award_id,
disb_num,
disb_seq_num,
disb_gross_amt,
fee_1,
fee_2,
disb_net_amt,
disb_adj_amt,
disb_date,
fee_paid_1,
fee_paid_2,
disb_activity,
disb_batch_id,
disb_ack_date,
booking_batch_id,
booked_date,
disb_status,
disb_status_date,
sf_status,
sf_status_date,
sf_invoice_num,
spnsr_credit_id,
spnsr_charge_id,
sf_credit_id,
error_desc,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login,
request_id,
program_id,
program_application_id,
program_update_date,
org_id,
notification_date,
interest_rebate_amt,
ld_cal_type,
ld_sequence_number
) VALUES (
new_references.award_id,
new_references.disb_num,
new_references.disb_seq_num,
new_references.disb_gross_amt,
new_references.fee_1,
new_references.fee_2,
new_references.disb_net_amt,
new_references.disb_adj_amt,
new_references.disb_date,
new_references.fee_paid_1,
new_references.fee_paid_2,
new_references.disb_activity,
new_references.disb_batch_id,
new_references.disb_ack_date,
new_references.booking_batch_id,
new_references.booked_date,
new_references.disb_status,
new_references.disb_status_date,
new_references.sf_status,
new_references.sf_status_date,
new_references.sf_invoice_num,
new_references.spnsr_credit_id,
new_references.spnsr_charge_id,
new_references.sf_credit_id,
new_references.error_desc,
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,
l_org_id,
new_references.notification_date,
new_references.interest_rebate_amt,
new_references.ld_cal_type,
new_references.ld_sequence_number
);
END insert_row;
SELECT
disb_gross_amt,
fee_1,
fee_2,
disb_net_amt,
disb_adj_amt,
disb_date,
fee_paid_1,
fee_paid_2,
disb_activity,
disb_batch_id,
disb_ack_date,
booking_batch_id,
booked_date,
disb_status,
disb_status_date,
sf_status,
sf_status_date,
sf_invoice_num,
spnsr_credit_id,
spnsr_charge_id,
sf_credit_id,
error_desc,
org_id,
notification_date,
interest_rebate_amt,
ld_cal_type,
ld_sequence_number
FROM igf_db_awd_disb_dtl_all
WHERE rowid = x_rowid
FOR UPDATE NOWAIT;
fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
PROCEDURE update_row (
x_rowid IN VARCHAR2,
x_award_id IN NUMBER,
x_disb_num IN NUMBER,
x_disb_seq_num IN NUMBER,
x_disb_gross_amt IN NUMBER,
x_fee_1 IN NUMBER,
x_fee_2 IN NUMBER,
x_disb_net_amt IN NUMBER,
x_disb_adj_amt IN NUMBER,
x_disb_date IN DATE,
x_fee_paid_1 IN NUMBER,
x_fee_paid_2 IN NUMBER,
x_disb_activity IN VARCHAR2,
x_disb_batch_id IN VARCHAR2,
x_disb_ack_date IN DATE,
x_booking_batch_id IN VARCHAR2,
x_booked_date IN DATE,
x_disb_status IN VARCHAR2,
x_disb_status_date IN DATE,
x_sf_status IN VARCHAR2,
x_sf_status_date IN DATE,
x_sf_invoice_num IN NUMBER,
x_spnsr_credit_id IN NUMBER,
x_spnsr_charge_id IN NUMBER,
x_sf_credit_id IN NUMBER,
x_error_desc IN VARCHAR2,
x_mode IN VARCHAR2,
x_notification_date IN DATE,
x_interest_rebate_amt IN NUMBER,
x_ld_cal_type IN VARCHAR2,
x_ld_sequence_number IN NUMBER
) AS
/*
|| Created By : prchandr
|| Created On : 14-DEC-2000
|| 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;
p_action => 'UPDATE',
x_rowid => x_rowid,
x_award_id => x_award_id,
x_disb_num => x_disb_num,
x_disb_seq_num => x_disb_seq_num,
x_disb_gross_amt => x_disb_gross_amt,
x_fee_1 => x_fee_1,
x_fee_2 => x_fee_2,
x_disb_net_amt => x_disb_net_amt,
x_disb_adj_amt => x_disb_adj_amt,
x_disb_date => x_disb_date,
x_fee_paid_1 => x_fee_paid_1,
x_fee_paid_2 => x_fee_paid_2,
x_disb_activity => x_disb_activity,
x_disb_batch_id => x_disb_batch_id,
x_disb_ack_date => x_disb_ack_date,
x_booking_batch_id => x_booking_batch_id,
x_booked_date => x_booked_date,
x_disb_status => x_disb_status,
x_disb_status_date => x_disb_status_date,
x_sf_status => x_sf_status,
x_sf_status_date => x_sf_status_date,
x_sf_invoice_num => x_sf_invoice_num,
x_spnsr_credit_id => x_spnsr_credit_id,
x_spnsr_charge_id => x_spnsr_charge_id,
x_sf_credit_id => x_sf_credit_id,
x_error_desc => x_error_desc,
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_notification_date => x_notification_date,
x_interest_rebate_amt => x_interest_rebate_amt,
x_ld_cal_type => x_ld_cal_type,
x_ld_sequence_number => x_ld_sequence_number
);
x_program_update_date := old_references.program_update_date;
x_program_update_date := SYSDATE;
UPDATE igf_db_awd_disb_dtl_all
SET
disb_gross_amt = new_references.disb_gross_amt,
fee_1 = new_references.fee_1,
fee_2 = new_references.fee_2,
disb_net_amt = new_references.disb_net_amt,
disb_adj_amt = new_references.disb_adj_amt,
disb_date = new_references.disb_date,
fee_paid_1 = new_references.fee_paid_1,
fee_paid_2 = new_references.fee_paid_2,
disb_activity = new_references.disb_activity,
disb_batch_id = new_references.disb_batch_id,
disb_ack_date = new_references.disb_ack_date,
booking_batch_id = new_references.booking_batch_id,
booked_date = new_references.booked_date,
disb_status = new_references.disb_status,
disb_status_date = new_references.disb_status_date,
sf_status = new_references.sf_status,
sf_status_date = new_references.sf_status_date,
sf_invoice_num = new_references.sf_invoice_num,
spnsr_credit_id = new_references.spnsr_credit_id,
spnsr_charge_id = new_references.spnsr_charge_id,
sf_credit_id = new_references.sf_credit_id,
error_desc = new_references.error_desc,
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 ,
notification_date = new_references.notification_date,
interest_rebate_amt = new_references.interest_rebate_amt,
ld_cal_type = new_references.ld_cal_type,
ld_sequence_number = new_references.ld_sequence_number
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 igf_db_awd_disb_dtl_all
WHERE award_id = x_award_id
AND disb_num = x_disb_num
AND disb_seq_num = x_disb_seq_num;
insert_row (
x_rowid,
x_award_id,
x_disb_num,
x_disb_seq_num,
x_disb_gross_amt,
x_fee_1,
x_fee_2,
x_disb_net_amt,
x_disb_adj_amt,
x_disb_date,
x_fee_paid_1,
x_fee_paid_2,
x_disb_activity,
x_disb_batch_id,
x_disb_ack_date,
x_booking_batch_id,
x_booked_date,
x_disb_status,
x_disb_status_date,
x_sf_status,
x_sf_status_date,
x_sf_invoice_num,
x_spnsr_credit_id,
x_spnsr_charge_id,
x_sf_credit_id,
x_error_desc,
x_mode ,
x_notification_date,
x_interest_rebate_amt,
x_ld_cal_type,
x_ld_sequence_number
);
update_row (
x_rowid,
x_award_id,
x_disb_num,
x_disb_seq_num,
x_disb_gross_amt,
x_fee_1,
x_fee_2,
x_disb_net_amt,
x_disb_adj_amt,
x_disb_date,
x_fee_paid_1,
x_fee_paid_2,
x_disb_activity,
x_disb_batch_id,
x_disb_ack_date,
x_booking_batch_id,
x_booked_date,
x_disb_status,
x_disb_status_date,
x_sf_status,
x_sf_status_date,
x_sf_invoice_num,
x_spnsr_credit_id,
x_spnsr_charge_id,
x_sf_credit_id,
x_error_desc,
x_mode,
x_notification_date,
x_interest_rebate_amt,
x_ld_cal_type,
x_ld_sequence_number
);
PROCEDURE delete_row (
x_rowid IN VARCHAR2
) AS
/*
|| Created By : prchandr
|| Created On : 14-DEC-2000
|| 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_awd_disb_dtl_all
WHERE rowid = x_rowid;
END delete_row;