The following lines contain the word 'select', 'insert', 'update' or 'delete':
Select entity_set_id
from psb_entity_set
where data_extract_id = p_data_extract_id;
Select entity_id
from psb_entity
where data_extract_id = p_data_extract_id;
Select position_id
from psb_positions
where data_extract_id = p_data_extract_id;
Select default_rule_id,
entity_id
from psb_defaults
where data_extract_id = p_data_extract_id;
Select pay_element_id
from psb_pay_elements
where data_extract_id = p_data_extract_id;
Select position_set_group_id
from psb_element_pos_set_groups
where pay_element_id = l_pay_element_id;
Select attribute_id,attribute_value_id
from psb_attribute_values
where data_extract_id = p_data_extract_id;
Select account_position_set_id
from psb_account_position_sets
where data_extract_id = p_data_extract_id;
Select line_sequence_id
from psb_account_position_set_lines
where account_position_set_id = l_account_position_set_id;
Select budget_workflow_rule_id
from psb_budget_workflow_rules
where data_extract_id = p_data_extract_id;
delete psb_positions_i
where data_extract_id = p_data_extract_id;
delete psb_salary_i
where data_extract_id = p_data_extract_id;
delete psb_employees_i
where data_extract_id = p_data_extract_id;
delete psb_cost_distributions_i
where data_extract_id = p_data_extract_id;
delete psb_attribute_values_i
where data_extract_id = p_data_extract_id;
delete psb_employee_assignments_i
where data_extract_id = p_data_extract_id;
delete psb_reentrant_process_status
where process_uid = p_data_extract_id
and process_type = 'HR DATA EXTRACT';
Select count(*)
into l_worksheet_cnt
from psb_worksheets
where data_extract_id = p_data_extract_id;
FND_MESSAGE.SET_NAME('PSB', 'PSB_DE_CANNOT_BE_DELETED');
Delete psb_entity_assignment
where entity_set_id = C_Entity_Set_Rec.entity_set_id;
Delete psb_entity_set
where data_extract_id = p_data_extract_id;
Delete psb_entity_assignment
where entity_id = C_Entity_Rec.entity_id;
Delete psb_entity
where data_extract_id = p_data_extract_id;
Delete psb_position_assignments
where position_id = C_Positions_Rec.position_id;
Delete psb_budget_positions
where position_id = C_Positions_Rec.position_id;
Delete psb_position_pay_distributions
where position_id = C_Positions_Rec.position_id;
Delete psb_positions
where data_extract_id = p_data_extract_id;
Delete psb_employees
where data_extract_id = p_data_extract_id;
Delete Psb_Set_Relations
where default_rule_id = C_Default_Rec.default_rule_id;
Delete Psb_Default_Account_Distrs
where default_rule_id = C_Default_Rec.default_rule_id;
Delete Psb_Default_Assignments
where default_rule_id = C_Default_Rec.default_rule_id;
Delete Psb_Entity
where entity_id = C_Default_Rec.entity_id;
Delete Psb_allocrule_percents
where allocation_rule_id = C_Default_Rec.entity_id;
Delete Psb_Defaults
where data_extract_id = p_data_extract_id;
Delete Psb_pay_element_options
where pay_element_id = C_Element_Rec.pay_element_id;
Delete Psb_pay_element_rates
where pay_element_id = C_Element_Rec.pay_element_id;
Delete Psb_Pay_Element_Distributions
where position_set_group_id = C_Set_Group_Rec.position_set_group_id;
Delete Psb_Set_Relations
where position_set_group_id = C_Set_Group_Rec.position_set_group_id;
Delete Psb_Element_Pos_Set_Groups
where pay_element_id = l_pay_element_id;
Delete Psb_Pay_Elements
where data_extract_id = p_data_extract_id;
Delete Psb_Set_Relations
where account_position_set_id = C_Account_Position_Set_Rec.account_position_set_id;
Delete Psb_Position_Set_Line_values
where line_sequence_id = C_Lines_Rec.line_sequence_id;
Delete Psb_Account_Position_Set_Lines
where account_position_set_id = C_Account_Position_Set_Rec.account_position_set_id;
Delete Psb_Budget_Positions
where account_position_set_id = C_Account_Position_Set_Rec.account_position_set_id;
Delete Psb_Account_Position_Sets
where data_extract_id = p_data_extract_id;
Delete Psb_Position_Set_Line_Values
where attribute_value_id = C_Attribute_Value_Rec.attribute_value_id;
Delete Psb_Attribute_Values
where data_extract_id = p_data_extract_id;
Delete Psb_Set_Relations
where budget_workflow_rule_id = C_Review_Group_Rule_Rec.budget_workflow_rule_id;
Delete Psb_Budget_Workflow_Rules
where data_extract_id = p_data_extract_id;
Delete Psb_Data_Extracts
where data_extract_id = p_data_extract_id;
Select data_extract_name
into l_data_extract_name
from psb_data_extracts
where data_extract_id = p_data_extract_id;
message_token('PROCESS', 'Delete Data Extract');