The following lines contain the word 'select', 'insert', 'update' or 'delete':
select 1 into dummy
from rg_report_calculations
where axis_set_id = X_axis_set_id
and axis_seq = X_axis_seq
and rownum < 2;
PROCEDURE delete_rows(X_axis_set_id NUMBER,
X_axis_seq NUMBER) IS
BEGIN
IF (X_axis_seq = -1) THEN
delete from rg_report_calculations
where axis_set_id = X_axis_set_id;
delete from rg_report_calculations
where axis_set_id = X_axis_set_id
and axis_seq = X_axis_seq;
END delete_rows;
SELECT 1 INTO Dummy FROM dual WHERE NOT EXISTS
(SELECT 1 FROM rg_report_calculations
WHERE axis_set_id = X_axis_set_id
AND axis_seq = X_axis_seq
AND calculation_seq = X_calculation_seq
AND ((X_rowid IS NULL) OR (rowid <> X_rowid))
);
v_last_updated_by NUMBER;
SELECT creation_date, last_updated_by
INTO v_creation_date, v_last_updated_by
FROM RG_REPORT_CALCULATIONS
WHERE axis_set_id = X_axis_set_id
AND axis_seq = X_axis_seq
AND calculation_seq = X_calculation_seq;
IF (v_last_updated_by <> 1) THEN
RETURN;
* Update only if force_edits is 'Y' or owner = 'SEED'
*/
IF (v_user_id = 1 or X_force_edits = 'Y') THEN
UPDATE RG_REPORT_CALCULATIONS
SET application_id = X_application_id,
last_update_date = sysdate,
last_updated_by = v_user_id,
last_update_login = 0,
operator = X_operator,
axis_seq_low = X_axis_seq_low,
axis_seq_high = X_axis_seq_high,
axis_name_low = X_axis_name_low,
axis_name_high = X_axis_name_high,
constant = X_constant,
context = X_context,
attribute1 = X_attribute1,
attribute2 = X_attribute2,
attribute3 = X_attribute3,
attribute4 = X_attribute4,
attribute5 = X_attribute5,
attribute6 = X_attribute6,
attribute7 = X_attribute7,
attribute8 = X_attribute8,
attribute9 = X_attribute9,
attribute10 = X_attribute10,
attribute11 = X_attribute11,
attribute12 = X_attribute12,
attribute13 = X_attribute13,
attribute14 = X_attribute14,
attribute15 = X_attribute15
WHERE axis_set_id = X_axis_set_id
AND axis_seq = X_axis_seq
AND calculation_seq = X_calculation_seq;
* If the row doesn't exist yet, insert.
*/
INSERT INTO RG_REPORT_CALCULATIONS
(application_id,
axis_set_id,
axis_seq,
calculation_seq,
last_update_date,
last_updated_by,
last_update_login,
creation_date,
created_by,
operator,
axis_seq_low,
axis_seq_high,
axis_name_low,
axis_name_high,
constant,
context,
attribute1,
attribute2,
attribute3,
attribute4,
attribute5,
attribute6,
attribute7,
attribute8,
attribute9,
attribute10,
attribute11,
attribute12,
attribute13,
attribute14,
attribute15)
VALUES
(X_application_id,
X_axis_set_id,
X_axis_seq,
X_calculation_seq,
sysdate,
v_user_id,
0,
sysdate,
v_user_id,
X_operator,
X_axis_seq_low,
X_axis_seq_high,
X_axis_name_low,
X_axis_name_high,
X_constant,
X_context,
X_attribute1,
X_attribute2,
X_attribute3,
X_attribute4,
X_attribute5,
X_attribute6,
X_attribute7,
X_attribute8,
X_attribute9,
X_attribute10,
X_attribute11,
X_attribute12,
X_attribute13,
X_attribute14,
X_attribute15);
* Update only if force_edits is 'Y' or owner = 'SEED'
*/
IF (v_user_id = 1 or X_force_edits = 'Y') THEN
UPDATE RG_REPORT_CALCULATIONS
SET axis_name_low = X_axis_name_low,
axis_name_high = X_axis_name_high
WHERE axis_set_id = X_axis_set_id
AND axis_seq = X_axis_seq
AND calculation_seq = X_calculation_seq
AND userenv('LANG') = (SELECT language_code
FROM FND_LANGUAGES
WHERE installed_flag = 'B');