The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT ACTIVITY_STATUS
INTO l_activity_status
FROM wf_item_activity_statuses wias, wf_process_activities wpa
WHERE wias.item_type = 'OEOL'
AND wias.item_key = to_char(p_line_id)
AND wias.process_activity = wpa.instance_id
AND wpa.ACTIVITY_ITEM_TYPE = 'OEOL'
AND wpa.activity_name = 'SCHEDULING_ELIGIBLE'
AND wias.activity_status = 'NOTIFIED';
SELECT schedule_status_code, source_type_code
INTO l_schedule_status_code, l_source_type_code
FROM oe_order_lines_all
WHERE line_id = p_line_id;
l_stmt :=' SELECT ola.line_id '||
' FROM oe_order_lines_all ola, wf_item_activity_statuses wias, wf_process_activities wpa '||
l_where_clause||
' AND wias.item_key = to_char(ola.line_id)'||
' AND wias.item_type = '||'''OEOL'''||
' AND wias.process_activity = wpa.instance_id'||
' AND wpa.ACTIVITY_ITEM_TYPE = '||'''OEOL'''||
' AND wpa.activity_name = '||'''SCHEDULING_ELIGIBLE'''||
' AND wias.activity_status = '||'''NOTIFIED''';
SELECT line_id
, top_model_line_id
, item_type_code
, line_category_code
, schedule_status_code
, ship_model_complete_flag
, ato_line_id
, source_type_code
, request_date
, schedule_ship_date
, ship_from_org_id
, header_id
, order_source_id
, orig_sys_document_ref
, orig_sys_line_ref
, orig_sys_shipment_ref
, change_sequence
, source_document_type_id
, source_document_id
, source_document_line_id
, link_to_line_id
, inventory_item_id
INTO l_line_id, l_top_model_line_id
, l_item_type_code
, l_line_category_code
, l_schedule_status_code
, l_ship_model_complete_flag
, l_ato_line_id
, l_source_type_code
, l_request_date
, l_sch_ship_date
, l_ship_from_org_id
, l_header_id
, l_order_source_id
, l_orig_sys_document_ref
, l_orig_sys_line_ref
, l_orig_sys_shipment_ref
, l_change_sequence
, l_source_document_type_id
, l_source_document_id
, l_source_document_line_id
, l_link_to_line_id -- 3000761
, l_line_rec.inventory_item_id
FROM oe_order_lines
WHERE line_id = to_number(itemkey);
SELECT line_id, top_model_line_id
INTO l_line_id, l_top_model_line_id
FROM oe_order_lines
WHERE line_id = l_top_model_line_id
FOR UPDATE;
SELECT line_id
INTO l_line_id
FROM oe_order_lines
WHERE line_id = l_child_line_id
FOR UPDATE;
SELECT ACTIVITY_STATUS
INTO l_activity_status_code
FROM wf_item_activity_statuses wias, wf_process_activities wpa
WHERE wias.item_type = 'OEOL' AND
wias.item_key = to_char(l_top_model_line_id) AND
wias.process_activity = wpa.instance_id AND
wpa.ACTIVITY_ITEM_TYPE = 'OEOL' AND
wpa.activity_name = 'SCHEDULING_ELIGIBLE' AND
wias.activity_status = 'NOTIFIED';
SELECT ACTIVITY_STATUS
INTO l_activity_status_code
FROM wf_item_activity_statuses wias, wf_process_activities wpa
WHERE wias.item_type = 'OEOL' AND
wias.item_key = to_char(l_ato_line_id) AND
wias.process_activity = wpa.instance_id AND
wpa.ACTIVITY_ITEM_TYPE = 'OEOL' AND
wpa.activity_name = 'SCHEDULING_ELIGIBLE' AND
wias.activity_status = 'NOTIFIED';
OE_MSG_PUB.update_msg_context( p_entity_code => 'LINE'
,p_entity_id => l_line_rec.line_id
,p_header_id => l_line_rec.header_id
,p_line_id => l_line_rec.line_id
,p_orig_sys_document_ref => l_line_rec.orig_sys_document_ref
,p_orig_sys_document_line_ref => l_line_rec.orig_sys_line_ref
,p_orig_sys_shipment_ref => l_line_rec.orig_sys_shipment_ref
,p_change_sequence => l_line_rec.change_sequence
,p_source_document_id => l_line_rec.source_document_id
,p_source_document_line_id => l_line_rec.source_document_line_id
,p_order_source_id => l_line_rec.order_source_id
,p_source_document_type_id => l_line_rec.source_document_type_id);
l_line_rec.operation := OE_GLOBALS.G_OPR_UPDATE;
/* Changes for performance, the query row is being replaced by a select.
OE_Line_Util.Query_Row(p_line_id => to_number(itemkey),
x_line_rec => l_line_rec);
SELECT SOURCE_TYPE_CODE,
ITEM_TYPE_CODE,
ATO_LINE_ID
INTO l_source_type_code,
l_item_type_code,
l_ato_line_id
FROM OE_ORDER_LINES
WHERE LINE_ID = l_line_id;
line to purchase (i.e: insert into req interface tables).
----------------------------------------------------------------------- */
PROCEDURE Release_to_purchasing(
itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout in out nocopy varchar2) /* file.sql.39 change */
IS
l_line_rec OE_Order_PUB.Line_Rec_Type;
l_allow_item_desc_update VARCHAR2(1);
SELECT name
INTO l_order_type_name
FROM oe_order_types_v
WHERE order_type_id = l_header_rec.order_type_id;
SELECT fu.user_name,nvl(fu.employee_id, -99)
INTO l_user_name,l_employee_id
FROM fnd_user fu
WHERE fu.user_id = l_line_rec.created_by; --bug 4682158
SELECT inventory_asset_flag,expense_account,allow_item_desc_update_flag
into item_asset_flag,item_expense_account,l_allow_item_desc_update
FROM mtl_system_items
WHERE inventory_item_id = l_line_rec.inventory_item_id
AND organization_id = l_line_rec.ship_from_org_id;
SELECT material_account,expense_account
into org_material_account,org_expense_account
FROM mtl_parameters
WHERE organization_id = l_line_rec.ship_from_org_id;
SELECT LOC.LOCATION_ID
INTO l_deliver_to_location_id
FROM HZ_LOCATIONS LOC,
HZ_PARTY_SITES PARTY,
HZ_CUST_ACCT_SITES ACCT,
HZ_CUST_SITE_USES_ALL CUST
WHERE CUST.SITE_USE_ID=L_LINE_REC.SHIP_TO_ORG_ID
AND CUST.SITE_USE_CODE='SHIP_TO'
AND CUST.STATUS='A'
AND ACCT.STATUS='A' --2752321
AND ACCT.ORG_ID = CUST.ORG_ID
AND CUST.CUST_ACCT_SITE_ID=ACCT.CUST_ACCT_SITE_ID AND ACCT.PARTY_SITE_ID=PARTY.PARTY_SITE_ID
AND PARTY.LOCATION_ID=LOC.LOCATION_ID;
SELECT line_id
INTO l_line_id
FROM oe_order_lines_all
WHERE line_id = l_line_rec.line_id
FOR UPDATE NOWAIT;
AND nvl(l_allow_item_desc_update, 'N') = 'Y' THEN
l_drop_ship_line_rec.item_description := l_line_rec.user_item_description;
SELECT item_type_code,schedule_status_code ,line_category_code
INTO l_item_type_code,l_schedule_status_code ,l_line_category_code
FROM oe_order_lines_all
WHERE line_id = to_number(itemkey);
SELECT item_type_code,firm_demand_flag ,line_category_code, shipped_quantity,
fulfilled_flag,open_flag,cancelled_flag,source_type_code
INTO l_item_type_code,l_firm_demand_flag ,l_line_category_code, l_shipped_quantity,
l_fulfilled_flag,l_open_flag,l_cancelled_flag,l_source_type_code
FROM oe_order_lines_all
WHERE line_id = to_number(itemkey);
SELECT ola.line_id line_id
FROM oe_order_lines_all ola,
wf_item_activity_statuses wias,
wf_process_activities wpa
WHERE top_model_line_id = nvl(l_top_model_line_id, ola.top_model_line_id)
And ato_line_id = nvl(l_ato_line_id, ola.ato_line_id)
And wias.item_key = ola.line_id
And wias.item_type = 'OEOL'
And wias.process_activity = wpa.instance_id
And wpa.ACTIVITY_ITEM_TYPE = 'OEOL'
And wpa.activity_name = 'FIRM_ELIGIBLE'
And wias.activity_status = 'NOTIFIED';
Select firm_demand_flag, top_model_line_id, ato_line_id,
ship_model_complete_flag
Into l_firm_demand_flag, l_top_model_line_id, l_ato_line_id,
l_ship_model_complete_flag
From oe_order_lines_all
Where line_id = to_number(itemkey);
Select firm_demand_flag
Into l_firm_demand_flag
From oe_order_lines
Where line_id = l_top_model_line_id
For Update;
Update oe_order_lines
Set firm_demand_flag = 'Y'
Where top_model_line_id = l_top_model_line_id;
Select firm_demand_flag
Into l_firm_demand_flag
From oe_order_lines
Where line_id = l_ato_line_id
For Update;
Update oe_order_lines
Set firm_demand_flag = 'Y'
Where ato_line_id = l_ato_line_id;
Select firm_demand_flag
Into l_firm_demand_flag
From oe_order_lines
Where line_id = l_itemkey
For Update;
Update oe_order_lines
Set firm_demand_flag = 'Y'
Where line_id = to_number(itemkey);