The following lines contain the word 'select', 'insert', 'update' or 'delete':
v_delete_permitted varchar2(1);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from MTL_INTERORG_SHIP_METHODS
where FROM_LOCATION_ID = P_LOCATION_ID
or TO_LOCATION_ID = P_LOCATION_ID
);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from MTL_MATERIAL_TRANSACTIONS_TEMP
where SHIP_TO_LOCATION = P_LOCATION_ID
);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from MTL_MOVEMENT_PARAMETERS
where TAX_OFFICE_LOCATION_ID = P_LOCATION_ID
);
-- bug 4730244 : Deleted the check on mtl_movement_statistics
l_msg := 'INV_LOC_REPLENISH_HEADERS';
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from MTL_REPLENISH_HEADERS
where DELIVERY_LOCATION_ID = P_LOCATION_ID
);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from MTL_REPLENISH_HEADERS_INT
where DELIVERY_LOCATION_ID = P_LOCATION_ID
);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from MTL_SUPPLY
where
-- Commented out the below for Bug2828220
-- PO_LINE_LOCATION_ID = P_LOCATION_ID
LOCATION_ID = P_LOCATION_ID
);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from MTL_TRANSACTIONS_INTERFACE
where SHIP_TO_LOCATION_ID = P_LOCATION_ID
);