The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT 'Master budget'
FROM gl_budget_versions bv, gl_budgets b
WHERE bv.control_budget_version_id =
x_budget_version_id
AND b.budget_name = bv.budget_name
AND b.budget_type = bv.budget_type
AND ( (b.first_valid_period_name <>
x_first_valid_period_name)
OR (b.last_valid_period_name <>
x_last_valid_period_name));
SELECT 'Master budget'
FROM gl_budgets b
WHERE b.budget_name =
(SELECT bv.budget_name
FROM gl_budget_versions bv
WHERE bv.budget_version_id =
x_master_budget_version_id)
AND b.budget_type = 'standard'
AND b.first_valid_period_name =
x_first_valid_period_name
AND b.last_valid_period_name =
x_last_valid_period_name
FOR UPDATE OF b.first_valid_period_name,
b.last_valid_period_name;
SELECT 'Duplicate'
FROM GL_BUDGETS bud
WHERE bud.budget_name = name
AND bud.budget_type = 'standard'
AND ( row_id is null
OR bud.rowid <> row_id);
SELECT gl_budget_versions_s.NEXTVAL
FROM dual;
SELECT 'found'
FROM GL_BUDGETS b
WHERE b.ledger_id = x_ledger_id
AND b.require_budget_journals_flag = 'N';
PROCEDURE select_row( recinfo IN OUT NOCOPY gl_budgets%ROWTYPE ) IS
BEGIN
SELECT *
INTO recinfo
FROM gl_budgets
WHERE ledger_id = recinfo.ledger_id
AND budget_name = recinfo.budget_name ;
'gl_budgets.select_row');
END select_row;
PROCEDURE select_columns(
x_budget_name VARCHAR2,
x_ledger_id NUMBER,
x_budget_type IN OUT NOCOPY VARCHAR2,
x_status IN OUT NOCOPY VARCHAR2,
x_required_bj_flag IN OUT NOCOPY VARCHAR2,
x_latest_opened_year IN OUT NOCOPY NUMBER,
x_first_valid_period_name IN OUT NOCOPY VARCHAR2,
x_last_valid_period_name IN OUT NOCOPY VARCHAR2 ) IS
recinfo gl_budgets%ROWTYPE;
select_row( recinfo );
'gl_budgets.select_columns');
END select_columns;
PROCEDURE Insert_Row(X_Rowid IN OUT NOCOPY VARCHAR2,
X_Budget_Type VARCHAR2,
X_Budget_Name VARCHAR2,
X_ledger_id NUMBER,
X_Status VARCHAR2,
X_Date_Created DATE,
X_Require_Budget_Journals_Flag VARCHAR2,
X_Current_Version_Id NUMBER DEFAULT NULL,
X_Latest_Opened_Year NUMBER DEFAULT NULL,
X_First_Valid_Period_Name VARCHAR2 DEFAULT NULL,
X_Last_Valid_Period_Name VARCHAR2 DEFAULT NULL,
X_Description VARCHAR2 DEFAULT NULL,
X_Date_Closed DATE DEFAULT NULL,
X_Attribute1 VARCHAR2 DEFAULT NULL,
X_Attribute2 VARCHAR2 DEFAULT NULL,
X_Attribute3 VARCHAR2 DEFAULT NULL,
X_Attribute4 VARCHAR2 DEFAULT NULL,
X_Attribute5 VARCHAR2 DEFAULT NULL,
X_Attribute6 VARCHAR2 DEFAULT NULL,
X_Attribute7 VARCHAR2 DEFAULT NULL,
X_Attribute8 VARCHAR2 DEFAULT NULL,
X_Context VARCHAR2 DEFAULT NULL,
X_User_Id NUMBER,
X_Login_Id NUMBER,
X_Date DATE,
X_Budget_Version_Id NUMBER,
X_Master_Budget_Version_Id NUMBER DEFAULT NULL
) IS
CURSOR C IS SELECT rowid FROM GL_BUDGETS
WHERE budget_name = X_Budget_Name;
INSERT INTO GL_BUDGETS(
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login,
budget_type,
budget_name,
ledger_id,
status,
date_created,
require_budget_journals_flag,
current_version_id,
latest_opened_year,
first_valid_period_name,
last_valid_period_name,
description,
date_closed,
attribute1,
attribute2,
attribute3,
attribute4,
attribute5,
attribute6,
attribute7,
attribute8,
context
) VALUES (
X_Date,
X_User_Id,
X_Date,
X_User_Id,
X_Login_Id,
X_Budget_Type,
X_Budget_Name,
X_ledger_id,
X_Status,
X_Date_Created,
X_Require_Budget_Journals_Flag,
X_Current_Version_Id,
X_Latest_Opened_Year,
X_First_Valid_Period_Name,
X_Last_Valid_Period_Name,
X_Description,
X_Date_Closed,
X_Attribute1,
X_Attribute2,
X_Attribute3,
X_Attribute4,
X_Attribute5,
X_Attribute6,
X_Attribute7,
X_Attribute8,
X_Context
);
gl_budget_versions_pkg.insert_record( x_budget_version_id,
x_budget_name,
x_status,
x_master_budget_version_id,
x_user_id,
x_login_id);
gl_budget_batches_pkg.insert_budget( x_budget_version_id,
x_ledger_id,
x_user_id);
gl_entity_budgets_pkg.insert_budget( x_budget_version_id,
x_ledger_id,
x_user_id,
x_login_id);
END Insert_Row;
X_Last_Update_Date DATE,
X_Last_Updated_By NUMBER,
X_Status VARCHAR2,
X_Date_Created DATE,
X_Require_Budget_Journals_Flag VARCHAR2,
X_Creation_Date DATE DEFAULT NULL,
X_Created_By NUMBER DEFAULT NULL,
X_Last_Update_Login NUMBER DEFAULT NULL,
X_Current_Version_Id NUMBER DEFAULT NULL,
X_Latest_Opened_Year NUMBER DEFAULT NULL,
X_First_Valid_Period_Name VARCHAR2 DEFAULT NULL,
X_Last_Valid_Period_Name VARCHAR2 DEFAULT NULL,
X_Description VARCHAR2 DEFAULT NULL,
X_Date_Closed DATE DEFAULT NULL,
X_Attribute1 VARCHAR2 DEFAULT NULL,
X_Attribute2 VARCHAR2 DEFAULT NULL,
X_Attribute3 VARCHAR2 DEFAULT NULL,
X_Attribute4 VARCHAR2 DEFAULT NULL,
X_Attribute5 VARCHAR2 DEFAULT NULL,
X_Attribute6 VARCHAR2 DEFAULT NULL,
X_Attribute7 VARCHAR2 DEFAULT NULL,
X_Attribute8 VARCHAR2 DEFAULT NULL,
X_Context VARCHAR2 DEFAULT NULL
) IS
CURSOR C IS
SELECT *
FROM GL_BUDGETS
WHERE rowid = X_Rowid
FOR UPDATE of Budget_Name NOWAIT;
FND_MESSAGE.set_name('FND', 'FORM_RECORD_DELETED');
AND ( (Recinfo.last_update_date = X_Last_Update_Date)
OR ( (Recinfo.last_update_date IS NULL)
AND (X_Last_Update_Date IS NULL)))
AND ( (Recinfo.last_updated_by = X_Last_Updated_By)
OR ( (Recinfo.last_updated_by IS NULL)
AND (X_Last_Updated_By IS NULL)))
AND ( (Recinfo.status = X_Status)
OR ( (Recinfo.status IS NULL)
AND (X_Status IS NULL)))
AND ( (Recinfo.date_created = X_Date_Created)
OR ( (Recinfo.date_created IS NULL)
AND (X_Date_Created IS NULL)))
AND ( (Recinfo.require_budget_journals_flag =
X_Require_Budget_Journals_Flag)
OR ( (Recinfo.require_budget_journals_flag IS NULL)
AND (X_Require_Budget_Journals_Flag IS NULL)))
AND ( (Recinfo.creation_date = X_Creation_Date)
OR ( (Recinfo.creation_date IS NULL)
AND (X_Creation_Date IS NULL)))
AND ( (Recinfo.created_by = X_Created_By)
OR ( (Recinfo.created_by IS NULL)
AND (X_Created_By IS NULL)))
AND ( (Recinfo.last_update_login = X_Last_Update_Login)
OR ( (Recinfo.last_update_login IS NULL)
AND (X_Last_Update_Login IS NULL)))
AND ( (Recinfo.current_version_id = X_Current_Version_Id)
OR ( (Recinfo.current_version_id IS NULL)
AND (X_Current_Version_Id IS NULL)))
AND ( (Recinfo.latest_opened_year = X_Latest_Opened_Year)
OR ( (Recinfo.latest_opened_year IS NULL)
AND (X_Latest_Opened_Year IS NULL)))
AND ( (Recinfo.first_valid_period_name = X_First_Valid_Period_Name)
OR ( (Recinfo.first_valid_period_name IS NULL)
AND (X_First_Valid_Period_Name IS NULL)))
AND ( (Recinfo.last_valid_period_name = X_Last_Valid_Period_Name)
OR ( (Recinfo.last_valid_period_name IS NULL)
AND (X_Last_Valid_Period_Name IS NULL)))
AND ( (Recinfo.description = X_Description)
OR ( (Recinfo.description IS NULL)
AND (X_Description IS NULL)))
AND ( (Recinfo.date_closed = X_Date_Closed)
OR ( (Recinfo.date_closed IS NULL)
AND (X_Date_Closed IS NULL)))
AND ( (Recinfo.attribute1 = X_Attribute1)
OR ( (Recinfo.attribute1 IS NULL)
AND (X_Attribute1 IS NULL)))
AND ( (Recinfo.attribute2 = X_Attribute2)
OR ( (Recinfo.attribute2 IS NULL)
AND (X_Attribute2 IS NULL)))
AND ( (Recinfo.attribute3 = X_Attribute3)
OR ( (Recinfo.attribute3 IS NULL)
AND (X_Attribute3 IS NULL)))
AND ( (Recinfo.attribute4 = X_Attribute4)
OR ( (Recinfo.attribute4 IS NULL)
AND (X_Attribute4 IS NULL)))
AND ( (Recinfo.attribute5 = X_Attribute5)
OR ( (Recinfo.attribute5 IS NULL)
AND (X_Attribute5 IS NULL)))
AND ( (Recinfo.attribute6 = X_Attribute6)
OR ( (Recinfo.attribute6 IS NULL)
AND (X_Attribute6 IS NULL)))
AND ( (Recinfo.attribute7 = X_Attribute7)
OR ( (Recinfo.attribute7 IS NULL)
AND (X_Attribute7 IS NULL)))
AND ( (Recinfo.attribute8 = X_Attribute8)
OR ( (Recinfo.attribute8 IS NULL)
AND (X_Attribute8 IS NULL)))
AND ( (Recinfo.context = X_Context)
OR ( (Recinfo.context IS NULL)
AND (X_Context IS NULL)))
) then
return;
PROCEDURE Update_Row(X_Rowid VARCHAR2,
X_Budget_Type VARCHAR2,
X_Budget_Name VARCHAR2,
X_ledger_id NUMBER,
X_Status VARCHAR2,
X_Date_Created DATE,
X_Require_Budget_Journals_Flag VARCHAR2,
X_Current_Version_Id NUMBER DEFAULT NULL,
X_Latest_Opened_Year NUMBER DEFAULT NULL,
X_First_Valid_Period_Name VARCHAR2 DEFAULT NULL,
X_Last_Valid_Period_Name VARCHAR2 DEFAULT NULL,
X_Description VARCHAR2 DEFAULT NULL,
X_Date_Closed DATE DEFAULT NULL,
X_Attribute1 VARCHAR2 DEFAULT NULL,
X_Attribute2 VARCHAR2 DEFAULT NULL,
X_Attribute3 VARCHAR2 DEFAULT NULL,
X_Attribute4 VARCHAR2 DEFAULT NULL,
X_Attribute5 VARCHAR2 DEFAULT NULL,
X_Attribute6 VARCHAR2 DEFAULT NULL,
X_Attribute7 VARCHAR2 DEFAULT NULL,
X_Attribute8 VARCHAR2 DEFAULT NULL,
X_Context VARCHAR2 DEFAULT NULL,
X_User_Id NUMBER,
X_Login_Id NUMBER,
X_Date DATE,
X_Budget_Version_Id NUMBER,
X_Master_Budget_Version_Id NUMBER DEFAULT NULL
) IS
BEGIN
-- If the budget is the current budget, then make sure there are no
-- other current budgets.
IF (X_Status = 'C') THEN
DECLARE
bvid NUMBER;
UPDATE GL_BUDGETS
SET
last_updated_by = X_User_Id,
last_update_login = X_Login_Id,
last_update_date = X_Date,
budget_type = X_Budget_Type,
budget_name = X_Budget_Name,
ledger_id = X_ledger_id,
status = X_Status,
date_created = X_Date_Created,
require_budget_journals_flag = X_Require_Budget_Journals_Flag,
current_version_id = X_Current_Version_Id,
latest_opened_year = X_Latest_Opened_Year,
first_valid_period_name = X_First_Valid_Period_Name,
last_valid_period_name = X_Last_Valid_Period_Name,
description = X_Description,
date_closed = X_Date_Closed,
attribute1 = X_Attribute1,
attribute2 = X_Attribute2,
attribute3 = X_Attribute3,
attribute4 = X_Attribute4,
attribute5 = X_Attribute5,
attribute6 = X_Attribute6,
attribute7 = X_Attribute7,
attribute8 = X_Attribute8,
context = X_Context
WHERE rowid = X_rowid;
gl_budget_versions_pkg.update_record( x_budget_version_id,
x_budget_name,
x_status,
x_master_budget_version_id,
x_user_id,
x_login_id);
'gl_budgets_pkg.update_row');
END Update_Row;
PROCEDURE Delete_Row(X_Rowid VARCHAR2) IS
BEGIN
DELETE FROM GL_BUDGETS
WHERE rowid = X_Rowid;
END Delete_Row;