The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT unit_of_measure, default_basis_type, default_activity_id,
autocharge_type, standard_rate_flag
INTO x_uom_code, x_basis_type, x_activity_id,
x_autocharge_type, x_standard_rate_flag
FROM BOM_RESOURCES
WHERE resource_id = p_resource_id_new;
SELECT first_unit_start_date, last_unit_completion_date
INTO x_start_date, x_completion_date
FROM WIP_OPERATIONS
WHERE wip_entity_id = p_wip_entity_id
AND organization_id = p_organization_id
AND operation_seq_num = p_operation_seq_num;
/*Bug 13829499: Add select...into to get the values of SF and AU from WOR. If the operation is being newly added
then no data will be found and hence the default values of (No and 1) will be defaulted*/
begin
select
SCHEDULED_FLAG, ASSIGNED_UNITS
into l_scheduled_flag, l_assigned_units
from WIP_OPERATION_RESOURCES
where WIP_ENTITY_ID = p_wip_entity_id
and OPERATION_SEQ_NUM = p_operation_seq_num
and RESOURCE_SEQ_NUM = p_resource_seq_num
and ORGANIZATION_ID = p_organization_id;
UPDATE WIP_JOB_DTLS_INTERFACE
SET scheduled_flag = nvl(scheduled_flag,l_scheduled_flag),
assigned_units = nvl(assigned_units,l_assigned_units),
applied_resource_units = decode(p_substitution_type,WIP_JOB_DETAILS.WIP_ADD,0,applied_resource_units), /*Bug 3499921*/
applied_resource_value = decode(p_substitution_type,WIP_JOB_DETAILS.WIP_ADD,0,applied_resource_value), /*Bug 3499921*/
usage_rate_or_amount = decode(usage_rate_or_amount,NULL,NULL,
inv_convert.inv_um_convert(0,WIP_CONSTANTS.MAX_DISPLAYED_PRECISION,usage_rate_or_amount,
nvl(uom_code,x_uom_code), x_uom_code,
null,null)), /* fix for bug#2367650 +APS*/
uom_code = x_uom_code,
basis_type = nvl(basis_type,x_basis_type),/*Fix for bug 2119945*/
activity_id = decode(p_substitution_type,
WIP_JOB_DETAILS.WIP_ADD,
nvl(activity_id,x_activity_id),
activity_id), /*Bug 2683271*/
autocharge_type = nvl(autocharge_type,x_autocharge_type), /*Fix for bug 6767640*/
standard_rate_flag = nvl(standard_rate_flag,x_standard_rate_flag), /*Fix for bug 6767640*/
start_date = nvl(start_date,x_start_date),
completion_date = nvl(completion_date,x_completion_date)
WHERE group_id = p_group_id
AND wip_entity_id = p_wip_entity_id
AND organization_id = p_organization_id
AND load_type in (WIP_JOB_DETAILS.WIP_RESOURCE,
WIP_JOB_DETAILS.WIP_SUB_RES)
AND substitution_type = p_substitution_type
AND operation_seq_num = p_operation_seq_num
AND resource_seq_num = p_resource_seq_num
AND resource_id_new = p_resource_id_new
-- jy: no need to default if doing res substitution
AND not ( load_type = wip_job_details.wip_resource
and substitution_type = wip_job_details.wip_change
and substitute_group_num is not null
and substitute_group_num is not null
);