The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE Insert_Row(X_Rowid IN OUT NOCOPY VARCHAR2,
X_Segment_Map_Id IN OUT NOCOPY NUMBER,
X_Coa_Mapping_Id NUMBER,
X_Last_Update_Date DATE,
X_Last_Updated_By NUMBER,
X_To_Value_Set_Id NUMBER,
X_To_Application_Column_Name VARCHAR2,
X_Segment_Map_Type VARCHAR2,
X_Creation_Date DATE,
X_Created_By NUMBER,
X_Last_Update_Login NUMBER,
X_From_Value_Set_Id NUMBER,
X_From_Application_Column_Name VARCHAR2,
X_Single_Value VARCHAR2,
X_Attribute1 VARCHAR2,
X_Attribute2 VARCHAR2,
X_Attribute3 VARCHAR2,
X_Attribute4 VARCHAR2,
X_Attribute5 VARCHAR2,
X_Context VARCHAR2,
X_Parent_Rollup_Value VARCHAR2
) IS
CURSOR C IS SELECT rowid FROM gl_cons_segment_map
WHERE segment_map_id = X_Segment_Map_Id;
CURSOR C2 IS SELECT gl_cons_segment_map_s.nextval FROM dual;
INSERT INTO gl_cons_segment_map(
segment_map_id,
coa_mapping_id,
last_update_date,
last_updated_by,
to_value_set_id,
to_application_column_name,
segment_map_type,
creation_date,
created_by,
last_update_login,
from_value_set_id,
from_application_column_name,
single_value,
attribute1,
attribute2,
attribute3,
attribute4,
attribute5,
context,
parent_rollup_value
) VALUES (
X_Segment_Map_Id,
X_Coa_Mapping_Id,
X_Last_Update_Date,
X_Last_Updated_By,
X_To_Value_Set_Id,
X_To_Application_Column_Name,
X_Segment_Map_Type,
X_Creation_Date,
X_Created_By,
X_Last_Update_Login,
X_From_Value_Set_Id,
X_From_Application_Column_Name,
X_Single_Value,
X_Attribute1,
X_Attribute2,
X_Attribute3,
X_Attribute4,
X_Attribute5,
X_Context,
X_Parent_Rollup_Value
);
END Insert_Row;
SELECT *
FROM gl_cons_segment_map
WHERE rowid = X_Rowid
FOR UPDATE of Segment_Map_Id NOWAIT;
PROCEDURE Update_Row(X_Rowid VARCHAR2,
X_Segment_Map_Id NUMBER,
X_Coa_Mapping_Id NUMBER,
X_Last_Update_Date DATE,
X_Last_Updated_By NUMBER,
X_To_Value_Set_Id NUMBER,
X_To_Application_Column_Name VARCHAR2,
X_Segment_Map_Type VARCHAR2,
X_Last_Update_Login NUMBER,
X_From_Value_Set_Id NUMBER,
X_From_Application_Column_Name VARCHAR2,
X_Single_Value VARCHAR2,
X_Attribute1 VARCHAR2,
X_Attribute2 VARCHAR2,
X_Attribute3 VARCHAR2,
X_Attribute4 VARCHAR2,
X_Attribute5 VARCHAR2,
X_Context VARCHAR2,
X_Parent_Rollup_Value VARCHAR2
) IS
BEGIN
-- Issue check_duplicate_rules call from server instead of in client.
--Check_Duplicate_Rules(X_Rowid,
-- X_Single_Value,
-- X_Parent_Rollup_Value,
-- X_Coa_Mapping_Id,
-- X_To_Application_Column_Name,
-- X_From_Application_Column_Name,
-- X_To_Value_Set_Id,
-- X_From_Value_Set_Id,
-- X_Segment_Map_Type );
UPDATE gl_cons_segment_map
SET
segment_map_id = X_Segment_Map_Id,
coa_mapping_id = X_Coa_Mapping_Id,
last_update_date = X_Last_Update_Date,
last_updated_by = X_Last_Updated_By,
to_value_set_id = X_To_Value_Set_Id,
to_application_column_name = X_To_Application_Column_Name,
segment_map_type = X_Segment_Map_Type,
last_update_login = X_Last_Update_Login,
from_value_set_id = X_From_Value_Set_Id,
from_application_column_name = X_From_Application_Column_Name,
single_value = X_Single_Value,
attribute1 = X_Attribute1,
attribute2 = X_Attribute2,
attribute3 = X_Attribute3,
attribute4 = X_Attribute4,
attribute5 = X_Attribute5,
context = X_Context,
parent_rollup_value = X_Parent_Rollup_Value
WHERE rowid = X_rowid;
END Update_Row;
PROCEDURE Delete_Row(X_Rowid VARCHAR2, X_Segment_Map_Id NUMBER ) IS
BEGIN
--Previously from Pre-Delete
DELETE FROM GL_CONS_FLEX_HIERARCHIES
WHERE SEGMENT_MAP_ID = X_Segment_Map_Id;
DELETE FROM gl_cons_segment_map
WHERE rowid = X_Rowid;
END Delete_Row;
select 'x' from gl_cons_segment_map
where coa_mapping_id = X_Coa_Mapping_Id
and to_application_column_name = X_To_Application_Column_Name
and to_value_set_id = X_To_Value_Set_Id
and segment_map_type in ('S', 'C')
and (rowid <> X_Rowid OR X_Rowid is NULL);
select 'x' from gl_cons_segment_map
where coa_mapping_id = X_Coa_Mapping_id
and to_application_column_name = X_To_Application_Column_Name
and to_value_set_id = X_To_Value_Set_Id
and segment_map_type NOT IN ('S', 'C')
and (rowid <> X_Rowid OR X_Rowid is NULL);
select 'x'
from gl_cons_segment_map csm,
fnd_flex_value_hierarchies fvh_curr,
fnd_flex_value_hierarchies fvh_new
where coa_mapping_id = X_Coa_Mapping_id
and csm.to_application_column_name = X_To_Application_Column_Name
and csm.to_value_set_id = X_To_Value_Set_Id
and single_value = X_Single_Value
and csm.from_application_column_name = X_from_Application_Column_Name
and csm.from_value_set_id = X_From_Value_Set_Id
and csm.segment_map_type = 'P'
and fvh_curr.flex_value_set_id = X_From_Value_Set_Id
and fvh_new.flex_value_set_id = X_From_Value_Set_Id
and fvh_curr.parent_flex_value = csm.parent_rollup_value
and fvh_new.parent_flex_value = X_Parent_Rollup_Value
and ((fvh_new.child_flex_value_low between
fvh_curr.child_flex_value_low and fvh_curr.child_flex_value_high)
OR
(fvh_new.child_flex_value_high between
fvh_curr.child_flex_value_low and fvh_curr.child_flex_value_high)
OR
(fvh_curr.child_flex_value_low between
fvh_new.child_flex_value_low and fvh_new.child_flex_value_high)
OR
(fvh_curr.child_flex_value_high between
fvh_new.child_flex_value_low and fvh_new.child_flex_value_high))
and (csm.rowid <> X_Rowid OR X_Rowid is NULL)
UNION
select 'x'
from gl_cons_flex_hierarchies cfh,
gl_cons_segment_map csm,
fnd_flex_value_hierarchies fvh
where csm.segment_map_id = cfh.segment_map_id
and csm.coa_mapping_id = X_Coa_Mapping_id
and single_value = X_Single_Value
and csm.to_application_column_name = X_To_Application_Column_Name
and csm.from_application_column_name = X_From_Application_Column_Name
and csm.to_value_set_id = X_To_Value_Set_Id
and csm.from_value_set_id = X_From_Value_Set_Id
and csm.segment_map_type = 'R'
and fvh.flex_value_set_id = X_From_Value_Set_Id
and fvh.parent_flex_value = X_Parent_Rollup_Value
and ((cfh.child_flex_value_low between
fvh.child_flex_value_low and fvh.child_flex_value_high)
OR
(cfh.child_flex_value_high between
fvh.child_flex_value_low and fvh.child_flex_value_high)
OR
(fvh.child_flex_value_low between
cfh.child_flex_value_low and cfh.child_flex_value_high)
OR
(fvh.child_flex_value_high between
cfh.child_flex_value_low and cfh.child_flex_value_high))
;
select 'x'
from gl_cons_segment_map csm,
fnd_flex_value_hierarchies fvh_curr,
fnd_flex_value_hierarchies fvh_new
where coa_mapping_id = X_Coa_Mapping_id
and csm.to_application_column_name = X_To_Application_Column_Name
and csm.to_value_set_id = X_To_Value_Set_Id
and csm.from_application_column_name = X_from_Application_Column_Name
and csm.from_value_set_id = X_From_Value_Set_Id
and csm.segment_map_type = 'P'
and fvh_curr.flex_value_set_id = X_From_Value_Set_Id
and fvh_new.flex_value_set_id = X_From_Value_Set_Id
and fvh_curr.parent_flex_value = csm.parent_rollup_value
and fvh_new.parent_flex_value = X_Parent_Rollup_Value
and ((fvh_new.child_flex_value_low between
fvh_curr.child_flex_value_low and fvh_curr.child_flex_value_high)
OR
(fvh_new.child_flex_value_high between
fvh_curr.child_flex_value_low and fvh_curr.child_flex_value_high)
OR
(fvh_curr.child_flex_value_low between
fvh_new.child_flex_value_low and fvh_new.child_flex_value_high)
OR
(fvh_curr.child_flex_value_high between
fvh_new.child_flex_value_low and fvh_new.child_flex_value_high))
and (csm.rowid <> X_Rowid OR X_Rowid is NULL)
UNION
select 'x'
from gl_cons_flex_hierarchies cfh,
gl_cons_segment_map csm,
fnd_flex_value_hierarchies fvh
where csm.segment_map_id = cfh.segment_map_id
and csm.coa_mapping_id = X_Coa_Mapping_id
and csm.to_application_column_name = X_To_Application_Column_Name
and csm.from_application_column_name = X_From_Application_Column_Name
and csm.to_value_set_id = X_To_Value_Set_Id
and csm.from_value_set_id = X_From_Value_Set_Id
and csm.segment_map_type = 'R'
and fvh.flex_value_set_id = X_From_Value_Set_Id
and fvh.parent_flex_value = X_Parent_Rollup_Value
and ((cfh.child_flex_value_low between
fvh.child_flex_value_low and fvh.child_flex_value_high)
OR
(cfh.child_flex_value_high between
fvh.child_flex_value_low and fvh.child_flex_value_high)
OR
(fvh.child_flex_value_low between
cfh.child_flex_value_low and cfh.child_flex_value_high)
OR
(fvh.child_flex_value_high between
cfh.child_flex_value_low and cfh.child_flex_value_high))
;
SELECT validation_type
FROM fnd_flex_value_sets
WHERE flex_value_set_id = X_To_Value_Set_Id;
SELECT 'Y'
FROM GL_CONS_SEGMENT_MAP
WHERE coa_mapping_id = X_Coa_Mapping_Id
AND segment_map_type IN ( 'U', 'V' );