The following lines contain the word 'select', 'insert', 'update' or 'delete':
UPDATE gmd_specifications_b
SET spec_status = p_to_status
WHERE spec_id = p_spec_id;
UPDATE gmd_specifications_b
SET spec_status = l_pending_status
WHERE spec_id = p_spec_id;
UPDATE gmd_specifications_b
SET spec_status = l_rework_status
WHERE spec_id = p_spec_id;
update_vr_status(p_entity_type,
p_spec_vr_id,
p_to_status);
update_vr_status(p_entity_type,
p_spec_vr_id,
l_pending_status);
update_vr_status(p_entity_type,
p_spec_vr_id,
l_rework_status);
PROCEDURE update_vr_status(pentity_type IN VARCHAR2,
pspec_vr_id IN NUMBER,
p_to_status IN NUMBER) IS
BEGIN
IF (pentity_type = 'I') THEN
UPDATE gmd_inventory_spec_vrs
SET spec_vr_status = p_to_status
WHERE spec_vr_id = pspec_vr_id;
UPDATE gmd_wip_spec_vrs
SET spec_vr_status = p_to_status
WHERE spec_vr_id = pspec_vr_id;
UPDATE gmd_customer_spec_vrs
SET spec_vr_status = p_to_status
WHERE spec_vr_id = pspec_vr_id;
UPDATE gmd_supplier_spec_vrs
SET spec_vr_status = p_to_status
WHERE spec_vr_id = pspec_vr_id;
UPDATE gmd_monitoring_spec_vrs
SET spec_vr_status = p_to_status
WHERE spec_vr_id = pspec_vr_id;
END update_vr_status ;
/* SELECT spec_vr_id,spec_type
FROM gmd_all_spec_vrs
WHERE spec_id = p_spec_id
AND spec_vr_status < p_to_status; */
select spec_vr_id, 'I' spec_type
from GMD_INVENTORY_SPEC_VRS
where spec_id = p_spec_id
and spec_vr_status < p_to_status
UNION
select spec_vr_id,'W' spec_type
from GMD_WIP_SPEC_VRS
where spec_id = p_spec_id
and spec_vr_status < p_to_status
UNION
select spec_vr_id,'C' spec_type
from GMD_CUSTOMER_SPEC_VRS
where spec_id = p_spec_id
and spec_vr_status < p_to_status
UNION
select spec_vr_id,'S' spec_type
from GMD_SUPPLIER_SPEC_VRS
where spec_id = p_spec_id
and spec_vr_status < p_to_status
UNION
select spec_vr_id, rule_type spec_type -- R or L
from GMD_MONITORING_SPEC_VRS
where spec_id = p_spec_id
and spec_vr_status < p_to_status
UNION
select spec_vr_id, 'T' spec_type
from GMD_STABILITY_SPEC_VRS
where spec_id = p_spec_id
and spec_vr_status < p_to_status;
update_vr_status(pentity_type => l_spec_type,
pspec_vr_id => l_spec_validity_rule_id,
p_to_status => p_to_status);
SELECT DECODE(l_spec_type,'I','oracle.apps.gmd.qm.spec.vr.inv',
'W','oracle.apps.gmd.qm.spec.vr.wip',
'C','oracle.apps.gmd.qm.spec.vr.cus',
'S','oracle.apps.gmd.qm.spec.vr.sup',
'R','oracle.apps.gmd.qm.spec.vr.mon',
'L','oracle.apps.gmd.qm.spec.vr.mon')
INTO l_event_name
FROM sys.dual;
/* Lets first update the status of the entity to to status */
IF p_event = 'oracle.apps.gmd.qm.spec.vr.inv' THEN
UPDATE gmd_inventory_spec_vrs
SET spec_vr_status = p_to_status
WHERE spec_vr_id = p_event_key
AND spec_vr_status <> p_to_status;
UPDATE gmd_wip_spec_vrs
SET spec_vr_status = p_to_status
WHERE spec_vr_id = p_event_key
AND spec_vr_status <> p_to_status;
UPDATE gmd_customer_spec_vrs
SET spec_vr_status = p_to_status
WHERE spec_vr_id = p_event_key
AND spec_vr_status <> p_to_status;
UPDATE gmd_supplier_spec_vrs
SET spec_vr_status = p_to_status
WHERE spec_vr_id = p_event_key
AND spec_vr_status <> p_to_status;
UPDATE gmd_specifications_b
SET spec_status = p_to_status
WHERE spec_id = p_event_key
AND spec_status <> p_to_status;