The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT group_reference_id
FROM bom_cto_src_orgs_b
WHERE config_item_id = l_config_item_id
AND group_reference_id is not null;
delete from bom_ato_configurations
where ( p_base_model is null
or ( p_base_model is not null and p_option_item is null and base_model_id = p_base_model)
or ( p_base_model is not null and p_option_item is not null and config_item_id in
( select config_item_id from bom_ato_configurations bac
where bac.base_model_id = p_base_model
and bac.component_item_id = p_option_item )
)
)
and ( p_config_item is null or
( p_config_item is not null and config_item_id = p_config_item))
and ( p_created_days_ago is null or
( p_created_days_ago is not null and TRUNC(creation_date) <= TRUNC(SYSDATE) - p_created_days_ago))
and ( p_last_ref_days_ago is null or
( p_last_ref_days_ago is not null and TRUNC(last_referenced_date) <= TRUNC(SYSDATE)- p_last_ref_days_ago))
--bugfix 3557190
RETURNING config_item_id BULK COLLECT INTO cfg_item_id_tbl;
FND_FILE.PUT_LINE(FND_FILE.LOG,'Deleted from BAC : '||to_char(l_rec_count)||' records.');
DELETE from bom_cto_model_orgs
WHERE group_reference_id = l_grp_ref_id_tbl(k);
FND_FILE.PUT_LINE(FND_FILE.LOG,'Rows deleted from bcmo:'|| sql%rowcount); --end bugfix 3557190
SELECT ato_line_id
BULK COLLECT INTO lbcolline_tbl --Bulk Collecting as a config may be linked to more than one line
FROM bom_cto_order_lines
WHERE config_item_id = l_config_item_id;
SELECT parent_ato_line_id, line_id
INTO lpatolineid, llineid
FROM bom_cto_order_lines
WHERE config_item_id = l_config_item_id
and ato_line_id = lbcolline_tbl(j);
UPDATE bom_cto_order_lines SET config_item_id = NULL WHERE line_id = llineid;
SELECT parent_ato_line_id
INTO lpatolineid
FROM bom_cto_order_lines
WHERE line_id = llineid;
UPDATE bom_cto_order_lines SET config_item_id = NULL WHERE line_id = llineid;