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
) AS
/*
|| Created By : prchandr
|| Created On : 13-JUL-2001
|| 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)
|| veramach 06-NOV-2003 FA 125 Multiple distr methods
|| Added new column adplans_id
*/
CURSOR cur_old_ref_values IS
SELECT *
FROM IGF_AW_TARGET_GRP_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_aw_target_grp_all
WHERE tgrp_id = x_tgrp_id
FOR UPDATE NOWAIT;
SELECT rowid
FROM igf_aw_target_grp
WHERE group_cd = x_group_cd
AND cal_type = x_cal_type
AND sequence_number = x_sequence_number
AND ((l_rowid IS NULL) OR (rowid <> l_rowid))
FOR UPDATE NOWAIT;
x_last_update_date IN DATE ,
x_last_updated_by IN NUMBER ,
x_last_update_login IN NUMBER
) AS
/*
|| Created By : prchandr
|| Created On : 13-JUL-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
|| (reverse chronological order - newest change first)
|| veramach 06-NOV-2003 FA 125 Multiple distr methods
|| Added new column adplans_id
|| kpadiyar 11-SEP-2001 Removed the call to check_uk_child_existance
|| from the Check for the UPDATE and VALIDATE_UPDATE
|| call which is not required.
|| Bug No # 1978576 - WRONG ERROR IS PROMPTING OUT NOCOPY
*/
BEGIN
set_column_values (
p_action,
x_rowid,
x_group_cd,
x_description,
x_max_grant_amt,
x_max_grant_perct,
x_max_grant_perct_fact,
x_max_loan_amt,
x_max_loan_perct,
x_max_loan_perct_fact,
x_max_work_amt,
x_max_work_perct,
x_max_work_perct_fact,
x_max_shelp_amt,
x_max_shelp_perct,
x_max_shelp_perct_fact,
x_max_gap_amt,
x_max_gap_perct,
x_max_gap_perct_fact,
x_use_fixed_costs,
x_max_aid_pkg,
x_max_gift_amt,
x_max_gift_perct ,
x_max_gift_perct_fact,
x_max_schlrshp_amt,
x_max_schlrshp_perct ,
x_max_schlrshp_perct_fact,
x_cal_type,
x_sequence_number,
x_rule_order,
x_s_rule_call_cd,
x_rul_sequence_number,
x_active,
x_tgrp_id,
x_adplans_id,
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.tgrp_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_uniqueness;
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.tgrp_id
)
) THEN
fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
ELSIF (p_action = 'VALIDATE_UPDATE') THEN
check_uniqueness;
ELSIF (p_action = 'VALIDATE_DELETE') THEN
check_child_existance;
SELECT rowid
FROM igf_aw_awd_frml_det_all
WHERE ((adplans_id = x_adplans_id));
PROCEDURE insert_row (
x_rowid IN OUT NOCOPY VARCHAR2,
x_group_cd IN VARCHAR2,
x_description IN VARCHAR2,
x_max_grant_amt IN NUMBER,
x_max_grant_perct IN NUMBER,
x_max_grant_perct_fact IN VARCHAR2,
x_max_loan_amt IN NUMBER,
x_max_loan_perct IN NUMBER,
x_max_loan_perct_fact IN VARCHAR2,
x_max_work_amt IN NUMBER,
x_max_work_perct IN NUMBER,
x_max_work_perct_fact IN VARCHAR2,
x_max_shelp_amt IN NUMBER,
x_max_shelp_perct IN NUMBER,
x_max_shelp_perct_fact IN VARCHAR2,
x_max_gap_amt IN NUMBER,
x_max_gap_perct IN NUMBER,
x_max_gap_perct_fact IN VARCHAR2,
x_use_fixed_costs IN VARCHAR2,
x_max_aid_pkg IN NUMBER,
x_max_gift_amt IN NUMBER,
x_max_gift_perct IN NUMBER,
x_max_gift_perct_fact IN VARCHAR2,
x_max_schlrshp_amt IN NUMBER,
x_max_schlrshp_perct IN NUMBER,
x_max_schlrshp_perct_fact IN VARCHAR2,
x_cal_type IN VARCHAR2 ,
x_sequence_number IN NUMBER ,
x_rule_order IN NUMBER,
x_s_rule_call_cd IN VARCHAR2,
x_rul_sequence_number IN NUMBER,
x_active IN VARCHAR2,
x_tgrp_id IN OUT NOCOPY NUMBER,
x_mode IN VARCHAR2,
x_adplans_id IN NUMBER
) AS
/*
|| Created By : prchandr
|| Created On : 13-JUL-2001
|| 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)
|| veramach 06-NOV-2003 FA 125 Multiple distr methods
|| Added new column adplans_id
*/
CURSOR c IS
SELECT rowid
FROM igf_aw_target_grp_all
WHERE tgrp_id = x_tgrp_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;
SELECT igf_aw_target_grp_all_s.NEXTVAL
INTO x_tgrp_id
FROM dual;
p_action => 'INSERT',
x_rowid => x_rowid,
x_group_cd => x_group_cd,
x_description => x_description,
x_max_grant_amt => x_max_grant_amt,
x_max_grant_perct => x_max_grant_perct,
x_max_grant_perct_fact => x_max_grant_perct_fact,
x_max_loan_amt => x_max_loan_amt,
x_max_loan_perct => x_max_loan_perct,
x_max_loan_perct_fact => x_max_loan_perct_fact,
x_max_work_amt => x_max_work_amt,
x_max_work_perct => x_max_work_perct,
x_max_work_perct_fact => x_max_work_perct_fact,
x_max_shelp_amt => x_max_shelp_amt,
x_max_shelp_perct => x_max_shelp_perct,
x_max_shelp_perct_fact => x_max_shelp_perct_fact,
x_max_gap_amt => x_max_gap_amt,
x_max_gap_perct => x_max_gap_perct,
x_max_gap_perct_fact => x_max_gap_perct_fact,
x_use_fixed_costs => x_use_fixed_costs,
x_max_aid_pkg => x_max_aid_pkg,
x_max_gift_amt => x_max_gift_amt,
x_max_gift_perct => x_max_gift_perct,
x_max_gift_perct_fact => x_max_gift_perct_fact,
x_max_schlrshp_amt => x_max_schlrshp_amt,
x_max_schlrshp_perct => x_max_schlrshp_perct,
x_max_schlrshp_perct_fact => x_max_schlrshp_perct_fact,
x_cal_type => x_cal_type,
x_sequence_number => x_sequence_number,
x_rule_order => x_rule_order,
x_s_rule_call_cd => x_s_rule_call_cd,
x_rul_sequence_number => x_rul_sequence_number,
x_active => x_active,
x_tgrp_id => x_tgrp_id,
x_adplans_id => x_adplans_id,
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_aw_target_grp_all (
group_cd,
description,
max_grant_amt,
max_grant_perct,
max_grant_perct_fact,
max_loan_amt,
max_loan_perct,
max_loan_perct_fact,
max_work_amt,
max_work_perct,
max_work_perct_fact,
max_shelp_amt,
max_shelp_perct,
max_shelp_perct_fact,
max_gap_amt,
max_gap_perct,
max_gap_perct_fact,
use_fixed_costs,
max_aid_pkg,
max_gift_amt,
max_gift_perct,
max_gift_perct_fact,
max_schlrshp_amt,
max_schlrshp_perct,
max_schlrshp_perct_fact,
cal_type,
sequence_number,
rule_order,
s_rule_call_cd,
rul_sequence_number,
active,
org_id,
tgrp_id,
adplans_id,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login
) VALUES (
new_references.group_cd,
new_references.description,
new_references.max_grant_amt,
new_references.max_grant_perct,
new_references.max_grant_perct_fact,
new_references.max_loan_amt,
new_references.max_loan_perct,
new_references.max_loan_perct_fact,
new_references.max_work_amt,
new_references.max_work_perct,
new_references.max_work_perct_fact,
new_references.max_shelp_amt,
new_references.max_shelp_perct,
new_references.max_shelp_perct_fact,
new_references.max_gap_amt,
new_references.max_gap_perct,
new_references.max_gap_perct_fact,
new_references.use_fixed_costs,
new_references.max_aid_pkg,
new_references.max_gift_amt,
new_references.max_gift_perct,
new_references.max_gift_perct_fact,
new_references.max_schlrshp_amt,
new_references.max_schlrshp_perct,
new_references.max_schlrshp_perct_fact,
new_references.cal_type,
new_references.sequence_number,
new_references.rule_order,
new_references.s_rule_call_cd,
new_references.rul_sequence_number,
new_references.active,
new_references.org_id,
new_references.tgrp_id,
new_references.adplans_id,
x_last_update_date,
x_last_updated_by,
x_last_update_date,
x_last_updated_by,
x_last_update_login
);
END insert_row;
SELECT
group_cd,
description,
max_grant_amt,
max_grant_perct,
max_grant_perct_fact,
max_loan_amt,
max_loan_perct,
max_loan_perct_fact,
max_work_amt,
max_work_perct,
max_work_perct_fact,
max_shelp_amt,
max_shelp_perct,
max_shelp_perct_fact,
max_gap_amt,
max_gap_perct,
max_gap_perct_fact,
use_fixed_costs,
max_aid_pkg,
max_gift_amt,
max_gift_perct ,
max_gift_perct_fact,
max_schlrshp_amt,
max_schlrshp_perct ,
max_schlrshp_perct_fact,
cal_type,
sequence_number,
rule_order,
s_rule_call_cd,
rul_sequence_number,
active,
adplans_id
FROM igf_aw_target_grp_all
WHERE rowid = x_rowid
FOR UPDATE NOWAIT;
fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
PROCEDURE update_row (
x_rowid IN VARCHAR2,
x_group_cd IN VARCHAR2,
x_description IN VARCHAR2,
x_max_grant_amt IN NUMBER,
x_max_grant_perct IN NUMBER,
x_max_grant_perct_fact IN VARCHAR2,
x_max_loan_amt IN NUMBER,
x_max_loan_perct IN NUMBER,
x_max_loan_perct_fact IN VARCHAR2,
x_max_work_amt IN NUMBER,
x_max_work_perct IN NUMBER,
x_max_work_perct_fact IN VARCHAR2,
x_max_shelp_amt IN NUMBER,
x_max_shelp_perct IN NUMBER,
x_max_shelp_perct_fact IN VARCHAR2,
x_max_gap_amt IN NUMBER,
x_max_gap_perct IN NUMBER,
x_max_gap_perct_fact IN VARCHAR2,
x_use_fixed_costs IN VARCHAR2,
x_max_aid_pkg IN NUMBER,
x_max_gift_amt IN NUMBER,
x_max_gift_perct IN NUMBER,
x_max_gift_perct_fact IN VARCHAR2,
x_max_schlrshp_amt IN NUMBER,
x_max_schlrshp_perct IN NUMBER,
x_max_schlrshp_perct_fact IN VARCHAR2,
x_cal_type IN VARCHAR2 ,
x_sequence_number IN NUMBER ,
x_rule_order IN NUMBER,
x_s_rule_call_cd IN VARCHAR2,
x_rul_sequence_number IN NUMBER,
x_active IN VARCHAR2,
x_tgrp_id IN NUMBER,
x_mode IN VARCHAR2,
x_adplans_id IN NUMBER
) AS
/*
|| Created By : prchandr
|| Created On : 13-JUL-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)
|| veramach 06-NOV-2003 FA 125 Multiple distr methods
|| Added new column adplans_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 => 'UPDATE',
x_rowid => x_rowid,
x_group_cd => x_group_cd,
x_description => x_description,
x_max_grant_amt => x_max_grant_amt,
x_max_grant_perct => x_max_grant_perct,
x_max_grant_perct_fact => x_max_grant_perct_fact,
x_max_loan_amt => x_max_loan_amt,
x_max_loan_perct => x_max_loan_perct,
x_max_loan_perct_fact => x_max_loan_perct_fact,
x_max_work_amt => x_max_work_amt,
x_max_work_perct => x_max_work_perct,
x_max_work_perct_fact => x_max_work_perct_fact,
x_max_shelp_amt => x_max_shelp_amt,
x_max_shelp_perct => x_max_shelp_perct,
x_max_shelp_perct_fact => x_max_shelp_perct_fact,
x_max_gap_amt => x_max_gap_amt,
x_max_gap_perct => x_max_gap_perct,
x_max_gap_perct_fact => x_max_gap_perct_fact,
x_use_fixed_costs => x_use_fixed_costs,
x_max_aid_pkg => x_max_aid_pkg,
x_max_gift_amt => x_max_gift_amt,
x_max_gift_perct => x_max_gift_perct,
x_max_gift_perct_fact => x_max_gift_perct_fact,
x_max_schlrshp_amt => x_max_schlrshp_amt,
x_max_schlrshp_perct => x_max_schlrshp_perct,
x_max_schlrshp_perct_fact => x_max_schlrshp_perct_fact,
x_cal_type => x_cal_type,
x_sequence_number => x_sequence_number,
x_rule_order => x_rule_order,
x_s_rule_call_cd => x_s_rule_call_cd,
x_rul_sequence_number => x_rul_sequence_number,
x_active => x_active,
x_tgrp_id => x_tgrp_id,
x_adplans_id => x_adplans_id,
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_aw_target_grp_all
SET
group_cd = new_references.group_cd,
description = new_references.description,
max_grant_amt = new_references.max_grant_amt,
max_grant_perct = new_references.max_grant_perct,
max_grant_perct_fact = new_references.max_grant_perct_fact,
max_loan_amt = new_references.max_loan_amt,
max_loan_perct = new_references.max_loan_perct,
max_loan_perct_fact = new_references.max_loan_perct_fact,
max_work_amt = new_references.max_work_amt,
max_work_perct = new_references.max_work_perct,
max_work_perct_fact = new_references.max_work_perct_fact,
max_shelp_amt = new_references.max_shelp_amt,
max_shelp_perct = new_references.max_shelp_perct,
max_shelp_perct_fact = new_references.max_shelp_perct_fact,
max_gap_amt = new_references.max_gap_amt,
max_gap_perct = new_references.max_gap_perct,
max_gap_perct_fact = new_references.max_gap_perct_fact,
use_fixed_costs = new_references.use_fixed_costs,
max_aid_pkg = new_references.max_aid_pkg,
max_gift_amt = new_references.max_gift_amt,
max_gift_perct = new_references.max_gift_perct,
max_gift_perct_fact = new_references.max_gift_perct_fact,
max_schlrshp_amt = new_references.max_schlrshp_amt,
max_schlrshp_perct = new_references.max_schlrshp_perct,
max_schlrshp_perct_fact = new_references.max_schlrshp_perct_fact,
cal_type = new_references.cal_type,
sequence_number = new_references.sequence_number,
rule_order = new_references.rule_order,
s_rule_call_cd = new_references.s_rule_call_cd,
rul_sequence_number = new_references.rul_sequence_number,
active = new_references.active,
adplans_id = new_references.adplans_id,
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;
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)
|| veramach 06-NOV-2003 FA 125 Multiple distr methods
|| Added new column adplans_id
*/
CURSOR c1 IS
SELECT rowid
FROM igf_aw_target_grp_all
WHERE tgrp_id = x_tgrp_id;
insert_row (
x_rowid,
x_group_cd,
x_description,
x_max_grant_amt,
x_max_grant_perct,
x_max_grant_perct_fact,
x_max_loan_amt,
x_max_loan_perct,
x_max_loan_perct_fact,
x_max_work_amt,
x_max_work_perct,
x_max_work_perct_fact,
x_max_shelp_amt,
x_max_shelp_perct,
x_max_shelp_perct_fact,
x_max_gap_amt,
x_max_gap_perct,
x_max_gap_perct_fact,
x_use_fixed_costs,
x_max_aid_pkg,
x_max_gift_amt,
x_max_gift_perct ,
x_max_gift_perct_fact,
x_max_schlrshp_amt,
x_max_schlrshp_perct ,
x_max_schlrshp_perct_fact,
x_cal_type,
x_sequence_number,
x_rule_order,
x_s_rule_call_cd,
x_rul_sequence_number,
x_active,
x_tgrp_id,
x_mode,
x_adplans_id
);
update_row (
x_rowid,
x_group_cd,
x_description,
x_max_grant_amt,
x_max_grant_perct,
x_max_grant_perct_fact,
x_max_loan_amt,
x_max_loan_perct,
x_max_loan_perct_fact,
x_max_work_amt,
x_max_work_perct,
x_max_work_perct_fact,
x_max_shelp_amt,
x_max_shelp_perct,
x_max_shelp_perct_fact,
x_max_gap_amt,
x_max_gap_perct,
x_max_gap_perct_fact,
x_use_fixed_costs,
x_max_aid_pkg,
x_max_gift_amt,
x_max_gift_perct ,
x_max_gift_perct_fact,
x_max_schlrshp_amt,
x_max_schlrshp_perct ,
x_max_schlrshp_perct_fact,
x_cal_type,
x_sequence_number,
x_rule_order,
x_s_rule_call_cd,
x_rul_sequence_number,
x_active,
x_tgrp_id,
x_mode,
x_adplans_id
);
PROCEDURE delete_row (
x_rowid IN VARCHAR2
) AS
/*
|| Created By : prchandr
|| Created On : 13-JUL-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)
*/
BEGIN
before_dml (
p_action => 'DELETE',
x_rowid => x_rowid
);
DELETE FROM igf_aw_target_grp_all
WHERE rowid = x_rowid;
END delete_row;