The following lines contain the word 'select', 'insert', 'update' or 'delete':
select count(1)
into l_count
from wf_items
where item_type = OE_GLOBALS.G_WFI_NGO
and item_key = itemkey;
OE_ORDER_WF_UTIL.Update_Quote_Blanket(p_item_type => OE_GLOBALS.G_WFI_BKT,
p_item_key => itemkey,
p_flow_status_code => 'DRAFT_SUBMITTED',
p_draft_submitted_flag => 'Y',
x_return_status => l_return_status);
select count(1)
into l_count
from wf_items
where item_type = OE_GLOBALS.G_WFI_NGO
and item_key = itemkey;
SELECT obhe.Start_Date_Active, obhe.End_Date_Active
INTO l_start_date, l_end_date
FROM oe_blanket_headers_all obha, oe_blanket_headers_ext obhe
WHERE obha.header_id = to_number(itemkey)
AND obha.order_number = obhe.order_number;
oe_order_wf_util.update_flow_status_code(p_header_id => to_number(itemkey),
p_flow_status_code => 'AWAITING_START_DATE',
p_item_type => OE_GLOBALS.G_WFI_BKT,
x_return_status => l_return_status);
oe_order_wf_util.update_flow_status_code(p_header_id => to_number(itemkey),
p_flow_status_code => 'ACTIVE',
p_item_type => OE_GLOBALS.G_WFI_BKT,
x_return_status => l_return_status);
oe_order_wf_util.update_flow_status_code(p_header_id => to_number(itemkey),
p_flow_status_code => 'ACTIVE',
p_item_type => OE_GLOBALS.G_WFI_BKT,
x_return_status => l_return_status);
oe_order_wf_util.update_flow_status_code(p_header_id => to_number(itemkey),
p_flow_status_code => 'ACTIVE',
p_item_type => OE_GLOBALS.G_WFI_BKT,
x_return_status => l_return_status);
oe_order_wf_util.update_flow_status_code(p_header_id => to_number(itemkey),
p_flow_status_code => 'ACTIVE',
p_item_type => OE_GLOBALS.G_WFI_BKT,
x_return_status => l_return_status);
SELECT item_key
INTO l_header_id
FROM wf_item_activity_statuses
where notification_id = to_number(document_id);
SELECT order_number
INTO l_blanket_number
FROM oe_blanket_headers_all
WHERE header_id = l_header_id;
SELECT item_key
INTO l_header_id
FROM wf_item_activity_statuses
where notification_id = to_number(document_id);
SELECT obhe.end_date_active
INTO l_end_date
FROM oe_blanket_headers_all obha, oe_blanket_headers_ext obhe
WHERE obha.header_id = l_header_id
AND obha.order_number = obhe.order_number;
OE_ORDER_WF_UTIL.Update_Quote_Blanket( p_item_type => OE_GLOBALS.G_WFI_BKT,
p_item_key => itemkey,
p_flow_status_code => 'EXPIRED',
x_return_status => l_return_status);
select bh.sold_to_org_id, bhx.end_date_active, bh.salesrep_id
into l_sold_to_org_id, l_end_date, l_salesrep_id
from oe_blanket_headers_all bh, oe_blanket_headers_ext bhx
where bh.header_id = to_number(itemkey)
and bh.order_number = bhx.order_number;
OE_ORDER_WF_UTIL.Update_Quote_Blanket( p_item_type => OE_GLOBALS.G_WFI_BKT,
p_item_key => itemkey,
p_flow_status_code => 'TERMINATED',
x_return_status => l_return_status);
OE_ORDER_WF_UTIL.Update_Quote_Blanket( p_item_type => OE_GLOBALS.G_WFI_BKT,
p_item_key => itemkey,
p_flow_status_code => 'CLOSED',--bug#5589336
p_open_flag => 'N',
x_return_status => l_return_status);
SELECT transaction_phase_code
INTO l_transaction_phase_code
FROM oe_blanket_headers_all
WHERE header_id = p_header_id;
select wpa.activity_name
into l_activity_name
from wf_item_activity_statuses wias, wf_process_activities wpa
where item_type = OE_GLOBALS.G_WFI_BKT
and item_key = to_char(p_header_id)
and activity_status = 'NOTIFIED'
and wpa.activity_name in ('WAIT_FOR_START_DATE', 'BLANKET_NO_END_DATE', 'WAIT_FOR_EXPIRATION', 'WAIT_FOR_FINAL_EXPIRATION', 'BLANKET_SUBMIT_DRAFT_ELIGIBLE')
and wias.process_activity = wpa.instance_id;
select wpa.activity_name
into l_activity_name
from wf_item_activity_statuses wias, wf_process_activities wpa
where item_type = OE_GLOBALS.G_WFI_BKT
and item_key = to_char(p_header_id)
and activity_status = 'NOTIFIED'
and wpa.activity_name = 'BLANKET_SUBMIT_DRAFT_ELIGIBLE'
and wias.process_activity = wpa.instance_id;
select wpa.activity_name
into l_activity_name
from wf_item_activity_statuses wias, wf_process_activities wpa
where item_type = OE_GLOBALS.G_WFI_BKT
and item_key = to_char(p_header_id)
and activity_status = 'NOTIFIED'
and wpa.activity_name = 'CLOSE_BLANKET_ELIGIBLE'
and wias.process_activity = wpa.instance_id;
select wpa.activity_name
into l_activity_name
from wf_item_activity_statuses wias, wf_process_activities wpa
where item_type = OE_GLOBALS.G_WFI_BKT
and item_key = to_char(p_header_id)
and activity_status = 'NOTIFIED'
and wpa.activity_name in ('WAIT_FOR_START_DATE', 'BLANKET_NO_END_DATE', 'WAIT_FOR_EXPIRATION', 'WAIT_FOR_FINAL_EXPIRATION')
and wias.process_activity = wpa.instance_id;
SELECT USER_NAME
INTO l_terminator
FROM FND_USER
WHERE USER_ID = p_terminated_by;
select bh.sold_to_org_id, bhx.end_date_active, bh.salesrep_id
into l_sold_to_org_id, l_end_date, l_salesrep_id
from oe_blanket_headers_all bh, oe_blanket_headers_ext bhx
where bh.header_id = p_header_id
and bh.order_number = bhx.order_number;
select wpa.activity_name
into l_activity_name
from wf_item_activity_statuses wias, wf_process_activities wpa
where item_type = OE_GLOBALS.G_WFI_BKT
and item_key = to_char(p_header_id)
and activity_status = 'NOTIFIED'
and wpa.activity_name = 'CLOSE_BLANKET_ELIGIBLE'
and wias.process_activity = wpa.instance_id;
select bh.sold_to_org_id, bhx.end_date_active, bh.salesrep_id
into l_sold_to_org_id, l_end_date, l_salesrep_id
from oe_blanket_headers_all bh, oe_blanket_headers_ext bhx
where bh.header_id = p_header_id
and bh.order_number = bhx.order_number;
SELECT obhe.End_Date_Active
INTO l_end_date
FROM oe_blanket_headers_all obha, oe_blanket_headers_ext obhe
WHERE obha.header_id = to_number(itemkey)
AND obha.order_number = obhe.order_number;