138: if (req_header_id is NOT NULL) then
139:
140: select org_id
141: into x_org_id
142: from po_requisition_headers
143: where requisition_header_id = req_header_id;
144:
145: end if;
146:
304: the same and change the cursor c1 to increase the performance
305:
306: cursor c1 is x_req_header_id is a parameter
307: select pol.requisition_line_id
308: from po_requisition_headers poh, po_requisition_lines pol
309: where line_location_id is null AND
310: nvl(pol.cancel_flag,'N') ='N' AND
311: nvl(pol.closed_code,'OPEN') <> 'FINALLY CLOSED' AND
312: nvl(modified_by_agent_flag,'N') ='N' AND
325: */
326: /*The first part of this query cause performance hit for bug 10243160. splite the cursor
327: cursor c1 is -- x_req_header_id is a parameter
328: select pol.requisition_line_id
329: from po_requisition_headers_all poh, --
331: where x_req_header_id is null AND
332: line_location_id is null AND
333: nvl(pol.cancel_flag,'N') ='N' AND
337: authorization_status = 'APPROVED' AND
338: poh.requisition_header_id = pol.requisition_header_id
339: union all
340: select pol.requisition_line_id
341: from po_requisition_headers_all poh, --
343: where x_req_header_id is not null AND
344: poh.requisition_header_id = x_req_header_id AND
345: line_location_id is null AND
353: --Bug 10243160 start. Separate the cursor into c1 and c2. c2 is for concurrent program. It may cause performance hit.
354: --Use c2 only if it needs. so that reduce the overhead for regular autocreate flow.
355: cursor c1 is --c1 is for autocreate flow. x_req_header_id is a parameter
356: select pol.requisition_line_id
357: from po_requisition_headers_all poh, --
359: where poh.requisition_header_id = x_req_header_id AND
360: line_location_id is null AND
361: nvl(pol.cancel_flag,'N') ='N' AND
368:
369: --c2 is for concurrent program flow.
370: cursor c2 is
371: select pol.requisition_line_id
372: from po_requisition_headers_all poh, --
374: where line_location_id is null AND
375: nvl(pol.cancel_flag,'N') ='N' AND
376: nvl(pol.closed_code,'OPEN') <> 'FINALLY CLOSED' AND
399: CURSOR C_ConsumeReqLines is
400: SELECT prl.requisition_line_id
401: FROM po_lines pol,
402: po_requisition_lines prl,
403: po_requisition_headers_all prh --
405: AND prl.auction_header_id = pol.auction_header_id
406: AND prl.bid_line_number = pol.bid_line_number
407: AND prl.bid_number = pol.bid_number
416:
417: --
418: cursor C_CLMReqLines is
419: select pol.requisition_line_id
420: from po_requisition_headers_all poh, --
422: where poh.requisition_header_id = x_req_header_id AND
423: line_location_id is null AND
424: nvl(pol.cancel_flag,'N') ='N' AND
977: x_suggested_vendor_site_id,
978: l_job_id, --
979: l_labor_req_line_id, --
980: x_federal_flag -- Bug 14314684
981: from po_requisition_headers_all phs, --
983: where pls.requisition_line_id = x_req_line_id
984: and phs.requisition_header_id = pls.requisition_header_id;
985:
5930: aname => 'REQ_HEADER_ID');
5931: BEGIN
5932: SELECT emergency_po_num
5933: INTO x_emergency_po_num
5934: FROM po_requisition_headers
5935: WHERE requisition_header_id=x_req_header_id;
5936: EXCEPTION
5937: WHEN OTHERS THEN
5938:
6393: l_req_num,
6394: l_org_id,
6395: l_preparer_id,
6396: doc_subtype
6397: from po_requisition_headers hd,
6398: po_lookup_codes ty,
6399: po_lookup_codes st
6400: where hd.requisition_header_id = p_req_header_id
6401: and ty.lookup_type = 'DOCUMENT TYPE'
6421: l_org_id,
6422: l_preparer_id,
6423: doc_subtype,
6424: ItemType
6425: from po_requisition_headers hd,
6426: po_document_types ty ,
6427: po_drafts pod
6428: where hd.requisition_header_id = p_req_header_id
6429: and ty.document_type_code = 'REQUISITION'