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 : [email protected]
|| Created On : 30-MAY-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 igi_iac_proj_details
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 igi_iac_proj_details
WHERE projection_id = x_projection_id
AND asset_id = x_asset_id
AND period_counter = x_period_counter
FOR UPDATE NOWAIT;
SELECT rowid
FROM igi_iac_proj_details
WHERE ((projection_id = x_projection_id));
fnd_message.set_name ('FND', 'FND-CANNOT DELETE MASTER');
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 : 30-MAY-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)
*/
l_path varchar2(150) := g_path||'before_dml';
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.projection_id,
new_references.asset_id,
new_references.period_counter
)
) THEN
fnd_message.set_name('FND','FORM_DUPLICATE_KEY_IN_INDEX');
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.projection_id,
new_references.asset_id,
new_references.period_counter
)
) THEN
fnd_message.set_name('FND','FORM_DUPLICATE_KEY_IN_INDEX');
PROCEDURE insert_row (
x_rowid IN OUT NOCOPY VARCHAR2,
x_projection_id IN NUMBER,
x_period_counter IN NUMBER,
x_fiscal_year IN NUMBER,
x_company IN VARCHAR2,
x_cost_center IN VARCHAR2,
x_account IN VARCHAR2,
x_asset_id IN NUMBER,
x_latest_reval_cost IN NUMBER,
x_deprn_period IN NUMBER,
x_deprn_ytd IN NUMBER,
x_deprn_reserve IN NUMBER,
x_asset_exception IN VARCHAR2,
x_revaluation_flag IN VARCHAR2,
x_mode IN VARCHAR2
) AS
/*
|| Created By : [email protected]
|| Created On : 30-MAY-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 igi_iac_proj_details
WHERE projection_id = x_projection_id
AND asset_id = x_asset_id
AND period_counter = x_period_counter;
x_last_update_date DATE;
x_last_updated_by NUMBER;
x_last_update_login NUMBER;
l_path varchar2(150) := g_path||'insert_row';
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_projection_id => x_projection_id,
x_period_counter => x_period_counter,
x_fiscal_year => x_fiscal_year,
x_company => x_company,
x_cost_center => x_cost_center,
x_account => x_account,
x_asset_id => x_asset_id,
x_latest_reval_cost => x_latest_reval_cost,
x_deprn_period => x_deprn_period,
x_deprn_ytd => x_deprn_ytd,
x_deprn_reserve => x_deprn_reserve,
x_asset_exception => x_asset_exception,
x_revaluation_flag => x_revaluation_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 igi_iac_proj_details (
projection_id,
period_counter,
fiscal_year,
company,
cost_center,
account,
asset_id,
latest_reval_cost,
deprn_period,
deprn_ytd,
deprn_reserve,
asset_exception,
revaluation_flag,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login
) VALUES (
new_references.projection_id,
new_references.period_counter,
new_references.fiscal_year,
new_references.company,
new_references.cost_center,
new_references.account,
new_references.asset_id,
new_references.latest_reval_cost,
new_references.deprn_period,
new_references.deprn_ytd,
new_references.deprn_reserve,
new_references.asset_exception,
new_references.revaluation_flag,
x_last_update_date,
x_last_updated_by,
x_last_update_date,
x_last_updated_by,
x_last_update_login
);
END insert_row;
SELECT
fiscal_year,
company,
cost_center,
account,
latest_reval_cost,
deprn_period,
deprn_ytd,
deprn_reserve,
asset_exception,
revaluation_flag
FROM igi_iac_proj_details
WHERE rowid = x_rowid
FOR UPDATE NOWAIT;
fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
PROCEDURE update_row (
x_rowid IN VARCHAR2,
x_projection_id IN NUMBER,
x_period_counter IN NUMBER,
x_fiscal_year IN NUMBER,
x_company IN VARCHAR2,
x_cost_center IN VARCHAR2,
x_account IN VARCHAR2,
x_asset_id IN NUMBER,
x_latest_reval_cost IN NUMBER,
x_deprn_period IN NUMBER,
x_deprn_ytd IN NUMBER,
x_deprn_reserve IN NUMBER,
x_asset_exception IN VARCHAR2,
x_revaluation_flag IN VARCHAR2,
x_mode IN VARCHAR2
) AS
/*
|| Created By : [email protected]
|| Created On : 30-MAY-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;
l_path varchar2(150) := g_path||'update_row';
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_projection_id => x_projection_id,
x_period_counter => x_period_counter,
x_fiscal_year => x_fiscal_year,
x_company => x_company,
x_cost_center => x_cost_center,
x_account => x_account,
x_asset_id => x_asset_id,
x_latest_reval_cost => x_latest_reval_cost,
x_deprn_period => x_deprn_period,
x_deprn_ytd => x_deprn_ytd,
x_deprn_reserve => x_deprn_reserve,
x_asset_exception => x_asset_exception,
x_revaluation_flag => x_revaluation_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 igi_iac_proj_details
SET
fiscal_year = new_references.fiscal_year,
company = new_references.company,
cost_center = new_references.cost_center,
account = new_references.account,
latest_reval_cost = new_references.latest_reval_cost,
deprn_period = new_references.deprn_period,
deprn_ytd = new_references.deprn_ytd,
deprn_reserve = new_references.deprn_reserve,
asset_exception = new_references.asset_exception,
revaluation_flag = new_references.revaluation_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;
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 igi_iac_proj_details
WHERE projection_id = x_projection_id
AND asset_id = x_asset_id
AND period_counter = x_period_counter;
insert_row (
x_rowid,
x_projection_id,
x_period_counter,
x_fiscal_year,
x_company,
x_cost_center,
x_account,
x_asset_id,
x_latest_reval_cost,
x_deprn_period,
x_deprn_ytd,
x_deprn_reserve,
x_asset_exception,
x_revaluation_flag,
x_mode
);
update_row (
x_rowid,
x_projection_id,
x_period_counter,
x_fiscal_year,
x_company,
x_cost_center,
x_account,
x_asset_id,
x_latest_reval_cost,
x_deprn_period,
x_deprn_ytd,
x_deprn_reserve,
x_asset_exception,
x_revaluation_flag,
x_mode
);
PROCEDURE delete_row (
x_rowid IN VARCHAR2
) AS
/*
|| Created By : [email protected]
|| Created On : 30-MAY-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 igi_iac_proj_details
WHERE rowid = x_rowid;
END delete_row;