The following lines contain the word 'select', 'insert', 'update' or 'delete':
Select Common_Project_Id
into l_common_proj_id
from pjm_org_parameters
where Organization_Id = X_Org_Id;
select organization_id , common_project_id
from pjm_org_parameters
where organization_id = nvl(X_Org_Id , organization_id)
and common_project_id is not null
order by organization_id,common_project_id ; /*Bug 6972181 (FP of 6900015): Added order by clause*/
update mtl_material_transactions mmt
set mmt.project_id =
nvl(mmt.project_id , crec.common_project_id)
, mmt.source_project_id =
nvl(mmt.source_project_id,
decode(transaction_source_type_id,
5, crec.common_project_id,
null))
where mmt.pm_cost_collected = 'N'
and organization_id = crec.organization_id
and ( mmt.project_id is null
or mmt.source_project_id is null
);
update mtl_material_transactions mmt
set mmt.to_project_id = crec.common_project_id
where mmt.pm_cost_collected = 'N'
and transfer_organization_id = crec.organization_id
and transaction_action_id not in ( 12 , 21 )
and to_project_id is null;
update mtl_material_transactions mmt
set mmt.to_project_id = crec.common_project_id
where mmt.pm_cost_collected = 'N'
and transaction_action_id in ( 12 , 21 )
and to_project_id is null
and ( organization_id , transfer_organization_id ) in (
select from_organization_id , to_organization_id
from mtl_interorg_parameters
where crec.organization_id =
decode( fob_point
, 1 /* Shipment */ , to_organization_id
, 2 /* Receipt */ , from_organization_id )
and mmt.transaction_action_id = 21
union all
select to_organization_id , from_organization_id
from mtl_interorg_parameters
where crec.organization_id =
decode( fob_point
, 1 /* Shipment */ , to_organization_id
, 2 /* Receipt */ , from_organization_id )
and mmt.transaction_action_id = 12
);
update wip_transactions wt
set wt.project_id = crec.common_project_id
where wt.pm_cost_collected = 'N'
and wt.organization_id = crec.organization_id
and wt.project_id is null;