The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT rg_dss_hierarchies_s.nextval
INTO next_hierarchy_id
FROM dual;
SELECT 1
INTO dummy
FROM dual
WHERE NOT EXISTS
(SELECT 1
FROM rg_dss_hierarchies
WHERE hierarchy_id = X_Hierarchy_Id
AND RG_DSS_DIMENSIONS_PKG.used_in_frozen_system(dimension_id) = 1);
SELECT 1
INTO dummy
FROM rg_dss_hierarchies
WHERE name = X_Name
AND ((X_Rowid IS NULL) OR (rowid <> X_Rowid));
SELECT 1
INTO dummy
FROM dual
WHERE NOT EXISTS
(SELECT 1
FROM rg_dss_hierarchy_details
WHERE hierarchy_id = X_Hierarchy_Id);
SELECT COUNT(hierarchy_id)
INTO NumRecords
FROM rg_dss_hierarchy_details
WHERE hierarchy_id = X_Hierarchy_Id;
SELECT COUNT(*)
INTO NumSegments
FROM rg_dss_dim_segments
WHERE dimension_id = X_Dimension_Id;
PROCEDURE Insert_Row(X_Rowid IN OUT NOCOPY VARCHAR2,
X_Hierarchy_Id IN OUT NOCOPY NUMBER,
X_Name VARCHAR2,
X_Id_Flex_Code VARCHAR2,
X_Id_Flex_Num NUMBER,
X_Dimension_Id NUMBER,
X_Description VARCHAR2,
X_Last_Update_Date DATE,
X_Last_Updated_By NUMBER,
X_Last_Update_Login NUMBER,
X_Creation_Date DATE,
X_Created_By NUMBER,
X_Context VARCHAR2,
X_Attribute1 VARCHAR2,
X_Attribute2 VARCHAR2,
X_Attribute3 VARCHAR2,
X_Attribute4 VARCHAR2,
X_Attribute5 VARCHAR2,
X_Attribute6 VARCHAR2,
X_Attribute7 VARCHAR2,
X_Attribute8 VARCHAR2,
X_Attribute9 VARCHAR2,
X_Attribute10 VARCHAR2,
X_Attribute11 VARCHAR2,
X_Attribute12 VARCHAR2,
X_Attribute13 VARCHAR2,
X_Attribute14 VARCHAR2,
X_Attribute15 VARCHAR2) IS
num_segments NUMBER;
SELECT rowid
FROM rg_dss_hierarchies
WHERE hierarchy_id = X_Hierarchy_Id;
INSERT INTO rg_dss_hierarchies(
hierarchy_id,
name,
id_flex_code,
id_flex_num,
dimension_id,
description,
last_update_date,
last_updated_by,
last_update_login,
creation_date,
created_by,
context,
attribute1,
attribute2,
attribute3,
attribute4,
attribute5,
attribute6,
attribute7,
attribute8,
attribute9,
attribute10,
attribute11,
attribute12,
attribute13,
attribute14,
attribute15
) VALUES (
X_Hierarchy_Id,
X_Name,
X_Id_Flex_Code,
X_Id_Flex_Num,
X_Dimension_Id,
X_Description,
X_Last_Update_Date,
X_Last_Updated_By,
X_Last_Update_Login,
X_Creation_Date,
X_Created_By,
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
);
END Insert_Row;
SELECT *
FROM rg_dss_hierarchies
WHERE rowid = X_Rowid
FOR UPDATE of hierarchy_id NOWAIT;
FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
PROCEDURE Update_Row(X_Rowid VARCHAR2,
X_Hierarchy_Id NUMBER,
X_Name VARCHAR2,
X_Id_Flex_Code VARCHAR2,
X_Id_Flex_Num NUMBER,
X_Dimension_Id NUMBER,
X_Description VARCHAR2,
X_Last_Update_Date DATE,
X_Last_Updated_By NUMBER,
X_Last_Update_Login NUMBER,
X_Context VARCHAR2,
X_Attribute1 VARCHAR2,
X_Attribute2 VARCHAR2,
X_Attribute3 VARCHAR2,
X_Attribute4 VARCHAR2,
X_Attribute5 VARCHAR2,
X_Attribute6 VARCHAR2,
X_Attribute7 VARCHAR2,
X_Attribute8 VARCHAR2,
X_Attribute9 VARCHAR2,
X_Attribute10 VARCHAR2,
X_Attribute11 VARCHAR2,
X_Attribute12 VARCHAR2,
X_Attribute13 VARCHAR2,
X_Attribute14 VARCHAR2,
X_Attribute15 VARCHAR2) IS
num_segments NUMBER;
UPDATE rg_dss_hierarchies
SET
hierarchy_id = X_Hierarchy_Id,
name = X_Name,
id_flex_code = X_Id_Flex_Code,
id_flex_num = X_Id_Flex_Num,
dimension_id = X_Dimension_Id,
description = X_Description,
last_update_date = X_Last_Update_Date,
last_updated_by = X_Last_Updated_By,
last_update_login = X_Last_Update_Login,
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 rowid = X_rowid;
END Update_Row;
PROCEDURE Delete_Row(X_Rowid VARCHAR2, X_Hierarchy_Id NUMBER) IS
BEGIN
IF (used_in_frozen_system(X_Hierarchy_Id)) THEN
-- Can't delete the record if the hierarchy is used in a frozen system
FND_MESSAGE.set_name('RG', 'RG_DSS_FROZEN_SYSTEM');
DELETE FROM rg_dss_hierarchies
WHERE rowid = X_Rowid;
END Delete_Row;