The following lines contain the word 'select', 'insert', 'update' or 'delete':
select 'x'
into v_garbage
from mtl_system_items i
where i.organization_id =
curr_org_id
and not exists (select 'x'
from mtl_system_items i2
where i2.organization_id =
master_org_id
and i2.inventory_item_id =
i.inventory_item_id)
and rownum < 2;
select 'org has children'
into v_garbage
from mtl_parameters
where master_organization_id =
org_id
and organization_id <>
org_id
and rownum < 2;
select 'uniqueness violated'
into v_garbage
from mtl_lot_numbers a, mtl_lot_numbers b
where a.lot_number = b.lot_number
and a.inventory_item_id <> b.inventory_item_id
and rownum < 2;
select 'uniqueness already imposed'
into v_garbage
from mtl_parameters
where lot_number_uniqueness = 1
and organization_id <>
org_id
and rownum < 2;
select serial_number,count(*)
from mtl_serial_numbers
where inventory_item_id in (select inventory_item_id
from mtl_system_items_b
where organization_id = p_org_id
and serial_number_control_code <> 1
and base_item_id is not null
and bom_item_type = 4)
and current_organization_id = p_org_id
group by serial_number
having count(*) > 1;
select 'break constraint'
into v_garbage
from mtl_parameters
where serial_number_type = 3
and organization_id <> org_id
and rownum < 2;
select 'uniqueness violated'
into v_garbage
from mtl_serial_numbers a,
mtl_serial_numbers b
where a.serial_number = b.serial_number
and a.current_organization_id = org_id
and b.current_organization_id = org_id
and a.inventory_item_id <> b.inventory_item_id
and rownum < 2;
select 'break constraint'
into v_garbage
from mtl_parameters
where serial_number_type = 3
and organization_id <> org_id
and rownum < 2;
--select 'uniqueness violated'
--into v_garbage
--from mtl_serial_numbers a,
-- mtl_serial_numbers b
--where a.serial_number = b.serial_number
--and a.current_organization_id <>
-- b.current_organization_id
--and rownum < 2;
select 'uniqueness violated'
into v_garbage
from mtl_serial_numbers a
where exists ( select 1
from mtl_serial_numbers b
where a.serial_number = b.serial_number
and a.current_organization_id <> b.current_organization_id )
and rownum < 2;
select 'uniqueness violated'
into v_garbage
from mtl_serial_numbers a,
mtl_serial_numbers b
where a.serial_number = b.serial_number
and a.current_organization_id = org_id
and b.current_organization_id = org_id
and a.inventory_item_id <> b.inventory_item_id
and rownum < 2;
select 'break constraint'
into v_garbage
from mtl_parameters
where serial_number_type = 3
and organization_id <> org_id
and rownum < 2;