The following lines contain the word 'select', 'insert', 'update' or 'delete':
select 'I'
into l_hr_installed
from sys.dual
where exists (select 'I'
from fnd_product_installations
where application_id between 800 and 899
and status = 'I');
select psp.view_all_positions_flag
, psp.security_profile_id
into p_view_all_poss
, p_security_profile_id
from per_security_profiles psp
-- where psp.security_profile_id = hr_security.get_security_profile
where psp.security_profile_id = fnd_profile.value('PER_SECURITY_PROFILE_ID')
and (psp.business_group_id + 0 = p_Business_group_id
or psp.business_group_id is null);
select 'Duplicate exists'
into l_duplicate_name
from sys.dual
where exists (
select 1
from per_position_structures psp
where (psp.rowid <> X_Rowid
or X_Rowid is null)
and upper(psp.name) = upper(X_Name)
and psp.business_group_id + 0 = X_Business_group_id);
select 'Primary Exists'
into l_primary_exists
from sys.dual
where exists (
select 1
from per_position_structures psp
where (psp.rowid <> X_Rowid
or X_Rowid is null)
and psp.primary_position_flag = 'Y'
and psp.business_group_id + 0 = X_Business_group_id);
PROCEDURE pre_delete_checks(X_Position_Structure_Id NUMBER,
X_Business_Group_Id NUMBER,
X_Po_Installed VARCHAR2,
X_Hr_Installed VARCHAR2) IS
--
--
-- Local variable
--
l_exists VARCHAR2(20);
select 'Versions Exist'
into l_exists
from sys.dual
where exists(
select 1
from per_pos_structure_versions psv
where psv.position_structure_id = X_Position_Structure_Id);
select 'Security exists'
into l_exists
from sys.dual
where exists (
select null
from per_security_profiles sec
where sec.business_group_id + 0 = X_Business_Group_Id
and sec.position_structure_id = X_Position_Structure_Id);
l_sql_text := 'select null '
||'from sys.dual '
||'where exists( select null '
||' from po_system_parameters '
||' where security_position_structure_id = '
||to_char(X_Position_Structure_Id)
||' ) '
||'or exists( select null '
||' from po_employee_hierarchies '
||' where position_structure_id = '||to_char(X_Position_Structure_Id)
||' ) '
||'or exists( select null '
||' from po_action_history '
||' where approval_path_id = '||to_char(X_Position_Structure_Id)
||' ) '
||'or exists( select null '
||' from po_document_types '
||' where default_approval_path_id = '
||to_char(X_Position_Structure_Id)
||' ) ';
PROCEDURE Insert_Row(X_Rowid IN OUT NOCOPY VARCHAR2,
X_Position_Structure_Id IN OUT NOCOPY NUMBER,
X_Business_Group_Id NUMBER,
X_Name VARCHAR2,
X_Comments VARCHAR2 ,
X_Primary_Position_Flag VARCHAR2 ,
X_Attribute_Category 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 ,
X_Attribute16 VARCHAR2 ,
X_Attribute17 VARCHAR2 ,
X_Attribute18 VARCHAR2 ,
X_Attribute19 VARCHAR2 ,
X_Attribute20 VARCHAR2
) IS
CURSOR C IS SELECT rowid FROM PER_POSITION_STRUCTURES
WHERE position_structure_id = X_Position_Structure_Id;
CURSOR C2 IS SELECT per_position_structures_s.nextval FROM sys.dual;
INSERT INTO PER_POSITION_STRUCTURES(
position_structure_id,
business_group_id,
name,
comments,
primary_position_flag,
attribute_category,
attribute1,
attribute2,
attribute3,
attribute4,
attribute5,
attribute6,
attribute7,
attribute8,
attribute9,
attribute10,
attribute11,
attribute12,
attribute13,
attribute14,
attribute15,
attribute16,
attribute17,
attribute18,
attribute19,
attribute20
) VALUES (
X_Position_Structure_Id,
X_Business_Group_Id,
X_Name,
X_Comments,
X_Primary_Position_Flag,
X_Attribute_Category,
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,
X_Attribute16,
X_Attribute17,
X_Attribute18,
X_Attribute19,
X_Attribute20
);
END Insert_Row;
SELECT *
FROM PER_POSITION_STRUCTURES
WHERE rowid = X_Rowid
FOR UPDATE of Position_Structure_Id NOWAIT;
PROCEDURE Update_Row(X_Rowid VARCHAR2,
X_Position_Structure_Id NUMBER,
X_Business_Group_Id NUMBER,
X_Name VARCHAR2,
X_Comments VARCHAR2 ,
X_Primary_Position_Flag VARCHAR2 ,
X_Attribute_Category 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 ,
X_Attribute16 VARCHAR2 ,
X_Attribute17 VARCHAR2 ,
X_Attribute18 VARCHAR2 ,
X_Attribute19 VARCHAR2 ,
X_Attribute20 VARCHAR2
) IS
BEGIN
check_name_unique(X_Rowid => X_Rowid,
X_Name => X_Name,
X_Business_Group_id => X_Business_Group_id);
UPDATE PER_POSITION_STRUCTURES
SET
position_structure_id = X_Position_Structure_Id,
business_group_id = X_Business_Group_Id,
name = X_Name,
comments = X_Comments,
primary_position_flag = X_Primary_Position_Flag,
attribute_category = X_Attribute_Category,
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,
attribute16 = X_Attribute16,
attribute17 = X_Attribute17,
attribute18 = X_Attribute18,
attribute19 = X_Attribute19,
attribute20 = X_Attribute20
WHERE rowid = X_rowid;
END Update_Row;
PROCEDURE Delete_Row(X_Rowid VARCHAR2,
X_Position_Structure_Id NUMBER,
X_Business_Group_Id NUMBER,
X_Po_Installed VARCHAR2,
X_Hr_Installed VARCHAR2) IS
BEGIN
--
pre_delete_checks(X_Position_Structure_Id => X_Position_Structure_Id,
X_Business_Group_Id => X_Business_Group_Id,
X_Po_Installed => X_Po_Installed,
X_Hr_Installed => X_Hr_Installed);
DELETE FROM PER_POSITION_STRUCTURES
WHERE rowid = X_Rowid;
END Delete_Row;
select null
into l_dummy
from sys.dual
where exists( select 1
from per_security_profiles sp
where sp.position_id is not null
and sp.business_group_id + 0 = p_business_group_id
and exists (select null
from per_pos_structure_versions psv
where psv.business_group_id = p_business_group_id
and not exists
( select null
from per_pos_Structure_elements pse
where pse.pos_structure_version_id =
psv.pos_Structure_version_id
and ( sp.position_id =
pse.subordinate_position_id)
or (sp.position_id =
pse.parent_position_id)
)
)
);