DBA Data[Home] [Help]

APPS.PO_EMAIL_GENERATE SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 186

l_allow_item_desc_update mtl_system_items.allow_item_desc_update_flag%TYPE;
Line: 193

Select datatype_id, media_id
from fnd_attached_docs_form_vl
where entity_name = v_entity_name
and pk1_value = to_char(v_document_id) /* Bug 5964375 */
and function_name = 'PO_PRINTPO'
and datatype_id in (1,2)
and media_id is not null
order by seq_num;
Line: 209

Select datatype_id, media_id
from fnd_attached_docs_form_vl fad, financials_system_parameters fsp
where entity_name = v_entity_name
and pk1_value = to_char(v_document_id) /* Bug 5964375 */
and function_name = 'PO_PRINTPO'
and datatype_id in (1,2)
and media_id is not null
AND (publish_flag = 'Y'
     --Security level is Organization
     OR (security_type = 1 AND security_id = fsp.org_id)
     --Security level is Set Of Books
     OR (security_type = 2 AND security_id = fsp.set_of_books_id)
     --Security level is NONE
     OR (security_type = 4)
    )
order by fad.seq_num;
Line: 229

SELECT datatype_id,
       media_id
  FROM fnd_attached_docs_form_vl
 WHERE entity_name = 'MTL_SYSTEM_ITEMS' AND
       pk1_value = to_char(v_org_id) AND
       pk2_value = to_char(v_item_id) AND
       function_name = 'PO_PRINTPO' and
	datatype_id in (1,2) and
	media_id is not null
	order by seq_num;
Line: 241

SELECT pol.line_num,
       pll.po_line_id,
       msi.concatenated_segments,
       pol.item_revision,
       pol.vendor_product_num,
       pol.item_description,
       umvl.unit_of_measure_tl,   /* Bug 2701946 */
       pll.quantity,
       pol.unit_price,
       pll.need_by_date,
       pll.promised_date,
       pll.taxable_flag,
       pol.note_to_vendor,
       pol.un_number_id,
       pol.hazard_class_id,
       pll.cancel_flag,
       pll.cancel_date,
       pll.quantity_cancelled,
       pol.item_id,
       fsp.inventory_organization_id org_id,  /* Bug 3064519 */
       pol.contract_num,
       pll.line_location_id,
       pll.ship_to_location_id,
       pll.consigned_flag, --< SUP_CON FPI>
       null,                   /*  */
       null,                    /*  */
       --
       pol.from_header_id,
       pol.from_line_id,
       --
        pll.drop_ship_flag --Bug 9356725
  FROM po_lines_all   pol,    --  --po_lines   pol,
       po_line_locations pll,
       mtl_system_items_kfv msi,
       mtl_units_of_measure_vl umvl,
       financials_system_params_all  fsp     --  --financials_system_parameters  fsp
  where  PLL.PO_HEADER_ID = v_document_id
  and    PLL.po_line_id    = POL.po_line_id
  and    PLL.po_release_id is NULL /* Bug 4513703 */
  and    pol.item_id = msi.inventory_item_id(+)
  and    NVL(msi.organization_id, fsp.inventory_organization_id) = fsp.inventory_organization_id
  and    nvl(pol.cancel_flag,'N') = 'N'
  and    nvl(pll.unit_meas_lookup_code, pol.unit_meas_lookup_code) = umvl.unit_of_measure
  and    POL.org_id = FSP.org_id      --
  order by line_num, pll.shipment_num asc;    --
Line: 289

SELECT pol.line_num,
       pll.po_line_id,
       msi.concatenated_segments,
       pol.item_revision,
       pol.vendor_product_num,
       pol.item_description,
       umvl.unit_of_measure_tl,   /* Bug 2701946 */
       pll.quantity,
       nvl(pll.price_override, pol.unit_price) unit_price,
       pll.need_by_date,
       pll.promised_date,
       pll.taxable_flag,
       pol.note_to_vendor,
       pol.un_number_id,
       pol.hazard_class_id,
       pll.cancel_flag,
       pll.cancel_date,
       pll.quantity_cancelled,
       pol.item_id,
       fsp.inventory_organization_id org_id,  /* Bug 3064519 */
       pol.contract_num,
       pll.line_location_id,
       pll.ship_to_location_id,
       NULL, -- 
       pll.start_date,                 /*  */
       pll.end_date,                    /*  */
       --
       null,
       NULL,
       --
       pll.drop_ship_flag --Bug 9356725
  FROM po_lines_all   pol,    --  --po_lines   pol,
       po_line_locations pll,
       mtl_system_items_kfv msi,
       mtl_units_of_measure_vl umvl,
       financials_system_params_all  fsp     --  --financials_system_parameters  fsp
  where  POL.PO_HEADER_ID = v_document_id
  and    POL.po_line_id  = PLL.po_line_id(+)
  and    pol.item_id = msi.inventory_item_id(+)
  and 	 pll.shipment_type(+) = 'PRICE BREAK'
  and    NVL(msi.organization_id, fsp.inventory_organization_id) = fsp.inventory_organization_id
  and    nvl(pol.cancel_flag,'N') = 'N'
  and    nvl(pll.unit_meas_lookup_code, pol.unit_meas_lookup_code) = umvl.unit_of_measure
  and    POL.org_id = FSP.org_id      --
  order by line_num, pll.shipment_num asc;    --
Line: 336

SELECT pol.line_num,
       pol.po_line_id,
       msi.concatenated_segments,
       pol.item_revision,
       pol.vendor_product_num,
       pol.item_description,
       umvl.unit_of_measure_tl,   /* Bug 2701946 */
       pol.quantity,
       pol.unit_price,
       null, --pol.need_by_date,
       null, -- pol.promised_date,
       null, --pll.taxable_flag,
       pol.note_to_vendor,
       pol.un_number_id,
       pol.hazard_class_id,
       pol.cancel_flag,
       pol.cancel_date,
       null, --pll.quantity_cancelled,
       pol.item_id,
       fsp.inventory_organization_id org_id,  /* Bug 3064519 */
       pol.contract_num,
       null, --pll.line_location_id,
       poh.ship_to_location_id,
       NULL, -- 
       null,                   /*  */
       null,                    /*  */
       --
       null,
       NULL,
       --
        NULL --Bug 9356725
  FROM po_lines   pol,
       po_headers_all poh,       --   --po_headers poh,
       mtl_system_items_kfv msi,
       mtl_units_of_measure_vl umvl,
       financials_system_params_all  fsp     --  --financials_system_parameters  fsp
  where  POL.PO_HEADER_ID = v_document_id
  and    POL.po_header_id = POH.po_header_id
  and    pol.item_id = msi.inventory_item_id(+)
  and    NVL(msi.organization_id, fsp.inventory_organization_id) = fsp.inventory_organization_id
  and    nvl(pol.cancel_flag,'N') = 'N'
  and    pol.unit_meas_lookup_code = umvl.unit_of_measure
  and    POL.org_id = FSP.org_id      --
  order by line_num asc;
Line: 382

SELECT pol.line_num,
       pll.po_line_id,
       msi.concatenated_segments,
       pol.item_revision,
       pol.vendor_product_num,
       pol.item_description,
       umvl.unit_of_measure_tl,   /* Bug 2701946 */
       pll.quantity,
       pll.price_override,
       pll.need_by_date,
       pll.promised_date,
       pll.taxable_flag,
       pol.note_to_vendor,
       pol.un_number_id,
       pol.hazard_class_id,
       pll.cancel_flag,
       pll.cancel_date,
       pll.quantity_cancelled,
       pol.item_id,
       fsp.inventory_organization_id org_id,  /* Bug 3064519 */
       pol.contract_num,
       pll.line_location_id,
       pll.ship_to_location_id,
       NULL, -- 
       null,                   /*  */
       null,                    /*  */
       --
       null,
       NULL,
       --
       pll.drop_ship_flag --Bug 9356725
  FROM po_lines_all   pol,    --  --po_lines   pol,
       po_line_locations pll,
       mtl_system_items_kfv msi,
       mtl_units_of_measure_vl umvl,
       financials_system_params_all  fsp     --  --financials_system_parameters  fsp
  where  PLL.PO_RELEASE_ID = v_document_id
  and    PLL.po_line_id    = POL.po_line_id
  and    pol.item_id = msi.inventory_item_id(+)
  and    NVL(msi.organization_id, fsp.inventory_organization_id) =
          fsp.inventory_organization_id
  and   nvl(pol.cancel_flag,'N') = 'N'
  and   nvl(pll.unit_meas_lookup_code, pol.unit_meas_lookup_code) = umvl.unit_of_measure
  and   PLL.org_id = FSP.org_id      --
  order by line_num, pll.shipment_num asc;    --
Line: 429

select distinct deliver_to_person_id
FROM    po_distributions pdp
WHERE    pdp.line_location_id = v_line_location_id;
Line: 475

 	                 PO_WF_DEBUG_PKG.insert_debug('itemtype','itemkey','l_item_type= ' || l_item_type);
Line: 476

 	                 PO_WF_DEBUG_PKG.insert_debug('itemtype','itemkey','l_item_key= ' || l_item_key);
Line: 477

 	                 PO_WF_DEBUG_PKG.insert_debug('itemtype','itemkey','l_document_id= ' || l_document_id);
Line: 478

 	                 PO_WF_DEBUG_PKG.insert_debug('itemtype','itemkey','l_document_type= ' || l_document_type);
Line: 479

 	                 PO_WF_DEBUG_PKG.insert_debug('itemtype','itemkey','l_org_id= ' || l_org_id);
Line: 492

          select authorization_status
            into l_document_status
            from po_headers_all
           where po_header_id = l_document_id;
Line: 499

          select po_header_id into l_po_header_id from po_releases_all
          where po_release_id = l_document_id;
Line: 502

          select authorization_status
            into l_document_status
            from po_headers_all
           where po_header_id = l_po_header_id;
Line: 516

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_document_status= ' || l_document_status);
Line: 517

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_po_header_id= ' || l_po_header_id);
Line: 533

            select type_lookup_code
            into x_subtype
            from po_headers
            where po_header_id = l_document_id;
Line: 541

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'x_subtype= ' || x_subtype);
Line: 551

		select count(distinct pll.ship_to_location_id) into l_ship_to_count
		from
	        po_lines_all   pol,   --   --po_lines   pol,
       		po_line_locations pll
  		where  PLL.PO_HEADER_ID = l_document_id
  		and    PLL.po_line_id    = POL.po_line_id;
Line: 559

	  	select count(distinct pll.ship_to_location_id) into l_ship_to_count
	        FROM  po_lines_all   pol,   --   --po_lines   pol,
       		po_line_locations pll
  		where  PLL.PO_RELEASE_ID = l_document_id
  		and    PLL.po_line_id    = POL.po_line_id;
Line: 571

		select nvl(count(distinct pll.ship_to_location_id),0)
                into l_ship_to_count
  		FROM po_lines_all   pol,   --   --po_lines   pol,
       		po_line_locations pll
  		where  PLL.PO_HEADER_ID = l_document_id
  		and    PLL.po_line_id    = POL.po_line_id
		and    PLL.shipment_type = 'PRICE BREAK';
Line: 584

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_ship_to_count= ' || l_ship_to_count);
Line: 589

           select count(*) into x_pb_count
           from po_line_locations
           where po_header_id = l_document_id;
Line: 596

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'x_pb_count= ' || x_pb_count);
Line: 660

		select  note_to_vendor ,currency_code
		into  l_header_note_to_vendor , l_currency_code
		from po_headers
		where po_header_id = to_number(l_document_id);
Line: 670

		select  note_to_vendor ,po_header_id
		into l_header_note_to_vendor , l_po_header_id
		from po_releases
		where po_release_id = to_number(l_document_id);
Line: 675

                select currency_code into l_currency_code
                from po_headers
                where po_header_id = l_po_header_id;
Line: 683

		select  note_to_vendor ,currency_code, blanket_total_amount
		into l_header_note_to_vendor ,l_currency_code, l_blanket_total_amount
		from po_headers
		where po_header_id = to_number(l_document_id);
Line: 701

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_header_note_to_vendor= ' || l_header_note_to_vendor);
Line: 702

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_currency_code= ' || l_currency_code);
Line: 703

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_blanket_total_amount= ' || l_blanket_total_amount);
Line: 735

	      select short_text into l_text from fnd_documents_short_text
	      where media_id = l_media_id;
Line: 752

	        select long_text into l_long_text from fnd_documents_long_text
	        where media_id = l_media_id;
Line: 781

	  select po_header_id into l_po_header_id from po_releases
	    where po_release_id = l_document_id;
Line: 794

	      select short_text into l_text from fnd_documents_short_text
	      where media_id = l_media_id;
Line: 811

	        select long_text into l_long_text from fnd_documents_long_text
	        where media_id = l_media_id;
Line: 897

                           the select statement */

                    -- Bug 3574886: Query from base tables in case the session context is not set correctly
                    -- when this SQL is executed; fetch translated columns from hr_locations_all_tl
Line: 901

		    select distinct
                           hlt.location_code,
                           hlt.description,
                           hrl.address_line_1,
		           hrl.address_line_2,
                           hrl.address_line_3,
                         --hrl.town_or_city, --bug#5870952 commented to fetch tow_or_city from fnd_lookup_values
			   Decode(hrl.town_or_city,flv4.lookup_code,flv4.meaning,hrl.town_or_city),
                           hrl.postal_code,
                           ftv.territory_short_name,
			   nvl(decode(hrl.region_1, null,
                                      hrl.region_2, decode(flv1.meaning,null,
                                                           decode(flv2.meaning, null, flv3.meaning, flv2.lookup_code),
                                                           flv1.lookup_code)),
   			       hrl.region_2)
		    into  l_hrl_location,
                          l_hrl_description,
		          l_hrl_address_line_1,
                          l_hrl_address_line_2,
		          l_hrl_address_line_3,
                          l_hrl_town_or_city,
		          l_hrl_postal_code,
                          l_hrl_country,
                          l_hrl_to_region1
		    from  hr_locations_all hrl,
                          hr_locations_all_tl hlt,
                          fnd_territories_vl ftv,
                          fnd_lookup_values_vl flv1,
			  fnd_lookup_values_vl flv2,
                          fnd_lookup_values_vl flv3,
			  fnd_lookup_values_vl flv4
		    where hrl.region_1 = flv1.lookup_code (+)
                    and   hrl.country || '_PROVINCE' = flv1.lookup_type (+)
                    and   hrl.location_id = hlt.location_id and hlt.language = USERENV('LANG')
	            and   hrl.region_2 = flv2.lookup_code (+)
                    and   hrl.country || '_STATE' = flv2.lookup_type (+)
		    and   hrl.region_1 = flv3.lookup_code (+)
                    and   hrl.country || '_COUNTY' = flv3.lookup_type (+)
		    and   hrl.country = ftv.territory_code (+)
                    and   hrl.location_id = l_line_loc.ship_to_location_id
 		    AND   hrl.town_or_city = flv4.lookup_code(+)
 	            AND   hrl.country || '_PROVINCE'  = flv4.lookup_type (+);
Line: 953

                      /*select description, address1,
                    address2, address3, city, postal_code,
                    country
                    into  l_hrl_description,
                    l_hrl_address_line_1, l_hrl_address_line_2,
                    l_hrl_address_line_3, l_hrl_town_or_city,
                    l_hrl_postal_code, l_hrl_country
                    from hz_locations
                    where location_id = l_line_loc.ship_to_location_id;*/
Line: 964

 	                            SELECT
 	                              HLC.DESCRIPTION,
 	                              HLC.ADDRESS1,
 	                              HLC.ADDRESS2,
 	                              HLC.ADDRESS3,
 	                              HLC.CITY,
 	                              HLC.POSTAL_CODE,
 	                              HLC.COUNTRY,
 	                              NVL(DECODE(HLC.county, NULL, HLC.state,
 	                              DECODE(FCL1.MEANING, NULL,
 	                              DECODE(FCL2.MEANING, NULL,FCL3.MEANING, FCL2.LOOKUP_CODE),
 	                              FCL1.LOOKUP_CODE)), HLC.state)
 	                    INTO
 	                            l_hrl_description,
 	                            l_hrl_address_line_1,
 	                            l_hrl_address_line_2,
 	                            l_hrl_address_line_3,
 	                            l_hrl_town_or_city,
 	                            l_hrl_postal_code,
 	                            l_hrl_country,
 	                            l_hrl_to_region1
 	                     FROM
 	                            HZ_LOCATIONS             HLC,
 	                            FND_LOOKUP_VALUES            FCL1,
 	                            FND_LOOKUP_VALUES            FCL2,
 	                            FND_LOOKUP_VALUES            FCL3
 	                     WHERE
 	                         HLC.LOCATION_ID  = l_line_loc.ship_to_location_id AND
 	                         HLC.county = FCL1.LOOKUP_CODE (+) AND
 	                         HLC.COUNTRY || '_PROVINCE' = FCL1.LOOKUP_TYPE (+) AND
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', FCL1.SECURITY_GROUP_ID) =
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1',
 	                         FND_GLOBAL.LOOKUP_SECURITY_GROUP(FCL1.LOOKUP_TYPE,
 	                         FCL1.VIEW_APPLICATION_ID)) AND
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', FCL1.VIEW_APPLICATION_ID) =
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', 3) AND
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', FCL1.LANGUAGE) =
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', USERENV('LANG')) AND
 	                         HLC.state = FCL2.LOOKUP_CODE (+) AND
 	                         HLC.COUNTRY || '_STATE' = FCL2.LOOKUP_TYPE (+) AND
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', FCL2.SECURITY_GROUP_ID) =
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1',
 	                         FND_GLOBAL.LOOKUP_SECURITY_GROUP(FCL2.LOOKUP_TYPE,
 	                         FCL2.VIEW_APPLICATION_ID)) AND
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', FCL2.VIEW_APPLICATION_ID) =
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', 3) AND
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', FCL2.LANGUAGE) =
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', USERENV('LANG'))        AND
 	                         HLC.county = FCL3.LOOKUP_CODE (+) AND
 	                         HLC.COUNTRY || '_COUNTY' = FCL3.LOOKUP_TYPE (+) AND
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', FCL3.SECURITY_GROUP_ID) =
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1',
 	                         FND_GLOBAL.LOOKUP_SECURITY_GROUP(FCL3.LOOKUP_TYPE,
 	                         FCL3.VIEW_APPLICATION_ID)) AND
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', FCL3.VIEW_APPLICATION_ID) =
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', 3) AND
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', FCL3.LANGUAGE) =
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', USERENV('LANG')) ;
Line: 1040

		    select un_number into l_un_number from po_un_numbers pun
		    where pun.un_number_id = l_line_loc.un_number_id;
Line: 1052

		    select hazard_class into l_hazard_class
		    from po_hazard_classes phc
		    where phc.hazard_class_id = l_line_loc.hazard_class_id;
Line: 1114

			select allow_item_desc_update_flag into l_allow_item_desc_update
            from mtl_system_items_vl
            where inventory_item_id = l_line_loc.item_id
			and organization_id = l_org_id;
Line: 1119

			if (l_allow_item_desc_update = 'N') then
				select description into l_mtl_system_items_desc
                from mtl_system_items_vl
                where inventory_item_id = l_line_loc.item_id
			    and organization_id = l_org_id;
Line: 1140

	      		   select short_text into l_item_short_text from fnd_documents_short_text
	      		   where media_id = l_media_id;
Line: 1144

			   select long_text into l_item_long_text from fnd_documents_long_text
			   where media_id = l_media_id;
Line: 1187

	      	   select short_text into l_text from fnd_documents_short_text
	      	   where media_id = l_media_id;
Line: 1195

		    select long_text into l_long_text from fnd_documents_long_text
	      	    where media_id = l_media_id;
Line: 1219

                 select nvl(global_agreement_flag, 'N') into l_global_flag
                 from po_headers_all where po_header_id = l_line_loc.from_header_id;
Line: 1237

	      	        select short_text into l_text from fnd_documents_short_text
	      	        where media_id = l_media_id;
Line: 1245

		         select long_text into l_long_text from fnd_documents_long_text
	      	         where media_id = l_media_id;
Line: 1270

	      	         select short_text into l_text from fnd_documents_short_text
	      	         where media_id = l_media_id;
Line: 1278

		          select long_text into l_long_text from fnd_documents_long_text
	      	          where media_id = l_media_id;
Line: 1306

		select vendor_quote_num into l_vendor_quote_num
		from po_lines_print
		where po_line_id = l_line_loc.po_line_id
		and po_header_id = l_document_id;
Line: 1312

		select vendor_quote_num into l_vendor_quote_num
		from po_lines_print
		where po_line_id = l_line_loc.po_line_id
		and po_release_id = l_document_id;
Line: 1334

		   select po_quote_num, src_ga_flag
                   into l_po_quote_num, l_src_ga_flag
		   from po_lines_print
		   where po_line_id = l_line_loc.po_line_id
		   and po_header_id = l_document_id;
Line: 1342

		   select po_quote_num into l_po_quote_num
		   from po_lines_print
		   where po_line_id = l_line_loc.po_line_id
		   and po_release_id = l_document_id;
Line: 1465

	      	   select short_text into l_text from fnd_documents_short_text
	      	   where media_id = l_media_id;
Line: 1471

		    select long_text into l_long_text from fnd_documents_long_text
	      	    where media_id = l_media_id;
Line: 1515

                select full_name,work_telephone,email_address
                  into l_requestor_name,l_phone,l_email_address
                  from per_all_people_f
                  where person_id = l_requestor_id
                  and effective_start_date <= sysdate
                  and effective_end_date >= sysdate;
Line: 1669

                select full_name,work_telephone,email_address
                  into l_requestor_name,l_phone,l_email_address
                  from per_all_people_f
                  where person_id = l_requestor_id
                     and effective_start_date <= sysdate
                     and effective_end_date >= sysdate;
Line: 1773

                   select short_text into l_text from fnd_documents_short_text
                   where media_id = l_media_id;
Line: 1781

                    select long_text into l_long_text from fnd_documents_long_text
                    where media_id = l_media_id;
Line: 1969

		select  note_to_vendor,currency_code
		into  l_header_note_to_vendor ,l_currency_code
		from po_headers
		where po_header_id = to_number(l_document_id);
Line: 1975

		select  note_to_vendor
		into  l_header_note_to_vendor
		from po_releases where po_release_id = to_number(l_document_id);
Line: 1980

               select  note_to_vendor,currency_code
		into l_header_note_to_vendor ,l_currency_code
		from po_headers
		where po_header_id = to_number(l_document_id);
Line: 1989

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_header_note_to_vendor= ' || l_header_note_to_vendor);
Line: 1990

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_currency_code= ' || l_currency_code);
Line: 2010

	      select short_text into l_text from fnd_documents_short_text
	      where media_id = l_media_id;
Line: 2027

	        select long_text into l_long_text from fnd_documents_long_text
	        where media_id = l_media_id;
Line: 2054

          select po_header_id into l_po_header_id from po_releases
	  where po_release_id = l_document_id;
Line: 2067

	      select short_text into l_text from fnd_documents_short_text
	      where media_id = l_media_id;
Line: 2084

	        select long_text into l_long_text from fnd_documents_long_text
	        where media_id = l_media_id;
Line: 2142

		    select un_number into l_un_number from po_un_numbers pun
		    where pun.un_number_id = l_line_loc.un_number_id;
Line: 2149

		    select hazard_class into l_hazard_class
		    from po_hazard_classes phc
		    where phc.hazard_class_id = l_line_loc.hazard_class_id;
Line: 2189

	      		   select short_text into l_item_short_text from fnd_documents_short_text
	      		   where media_id = l_media_id;
Line: 2193

			   select long_text into l_item_long_text from fnd_documents_long_text
			   where media_id = l_media_id;
Line: 2247

	      	   select short_text into l_text from fnd_documents_short_text
	      	   where media_id = l_media_id;
Line: 2253

		    select long_text into l_long_text from fnd_documents_long_text
	      	    where media_id = l_media_id;
Line: 2272

                select nvl(global_agreement_flag, 'N') into l_global_flag
                 from po_headers_all where po_header_id = l_line_loc.from_header_id;
Line: 2290

	      	   select short_text into l_text from fnd_documents_short_text
	      	   where media_id = l_media_id;
Line: 2298

		    select long_text into l_long_text from fnd_documents_long_text
	      	    where media_id = l_media_id;
Line: 2324

	      	   select short_text into l_text from fnd_documents_short_text
	      	   where media_id = l_media_id;
Line: 2332

		    select long_text into l_long_text from fnd_documents_long_text
	      	    where media_id = l_media_id;
Line: 2358

		select vendor_quote_num into l_vendor_quote_num
		from po_lines_print
		where po_line_id = l_line_loc.po_line_id;
Line: 2367

		select po_quote_num into l_po_quote_num
		from po_lines_print
		where po_line_id = l_line_loc.po_line_id;
Line: 2425

	      	   select short_text into l_text from fnd_documents_short_text
	      	   where media_id = l_media_id;
Line: 2431

		    select long_text into l_long_text from fnd_documents_long_text
	      	    where media_id = l_media_id;
Line: 2465

                  select full_name,work_telephone,email_address
                  into l_requestor_name,l_phone,l_email_address
                  from per_all_people_f
                  where person_id = l_requestor_id
                  and effective_start_date <= sysdate
                  and effective_end_date >= sysdate;
Line: 2705

select distinct deliver_to_person_id
FROM    po_distributions
WHERE    po_header_id = v_po_header_id
  AND    distribution_type <> 'AGREEMENT'; -- 
Line: 2711

select distinct deliver_to_person_id
FROM    po_distributions
WHERE    po_release_id = v_po_release_id;
Line: 2717

select distinct PLL.ship_to_location_id
FROM po_lines_all   pol,   --   --po_lines   pol,
po_line_locations pll
where  PLL.PO_RELEASE_ID = to_number(v_po_release_id)
and    PLL.po_line_id    = POL.po_line_id;
Line: 2735

select nvl(count(distinct pll.ship_to_location_id), 0)
FROM po_lines_all   pol,   -- 
     po_line_locations pll
where  PLL.PO_HEADER_ID = to_number(v_po_header_id)
and    PLL.po_line_id    = POL.po_line_id
and    PLL.shipment_type = 'PRICE BREAK';
Line: 2743

select ship_to_location_id
FROM   po_headers
where  PO_HEADER_ID = to_number(v_po_header_id);
Line: 2748

select distinct pll.ship_to_location_id
FROM po_lines_all   pol,   -- 
     po_line_locations pll
where  PLL.PO_HEADER_ID = to_number(v_po_header_id)
and    PLL.po_line_id    = POL.po_line_id
and    PLL.shipment_type = 'PRICE BREAK';
Line: 2756

select distinct PLL.ship_to_location_id
FROM po_lines_all   pol,   -- 
po_line_locations pll
where  PLL.PO_HEADER_ID = to_number(v_po_header_id)
and    PLL.po_line_id    = POL.po_line_id;
Line: 2763

select area_code || phone
from po_vendor_contacts
where vendor_contact_id = v_vendor_contact_id;
Line: 2804

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,l_progress);
Line: 2805

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_item_type= ' || l_item_type);
Line: 2806

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_item_key= ' || l_item_key);
Line: 2807

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_document_id= ' || l_document_id);
Line: 2808

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_document_type= ' || l_document_type);
Line: 2809

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_org_id= ' || l_org_id);
Line: 2822

          select authorization_status
            into l_document_status
            from po_headers_all
           where po_header_id = l_document_id;
Line: 2833

          select po_header_id into l_po_header_id from po_releases_all
          where po_release_id = l_document_id;
Line: 2836

          select authorization_status
            into l_document_status
            from po_headers_all
           where po_header_id = l_po_header_id;
Line: 2844

 	                 PO_WF_DEBUG_PKG.INSERT_DEBUG(l_item_type, l_item_key, 'l_document_status= ' || l_document_status);
Line: 2845

 	                 PO_WF_DEBUG_PKG.INSERT_DEBUG(l_item_type, l_item_key, 'l_po_header_id= ' || l_po_header_id);
Line: 2871

        select type_lookup_code
        into x_subtype
        from po_headers
        where po_header_id = l_document_id;
Line: 2878

 	                 PO_WF_DEBUG_PKG.INSERT_DEBUG(l_item_type, l_item_key, 'x_subtype= ' || x_subtype);
Line: 2886

	  select org_id into l_operating_unit_id from po_headers_all
	  where po_header_id = l_document_id;   */
Line: 2913

              select full_name,work_telephone,email_address
                into l_deliver_to_person,l_phone,l_email_address
                from per_all_people_f
                where person_id = l_deliver_to_id
                and effective_start_date <= sysdate
                and effective_end_date >= sysdate;
Line: 2929

 	               PO_WF_DEBUG_PKG.INSERT_DEBUG(l_item_type, l_item_key, 'l_deliver_to_person= ' || l_deliver_to_person);
Line: 2930

 	               PO_WF_DEBUG_PKG.INSERT_DEBUG(l_item_type, l_item_key, 'l_phone= ' || l_phone);
Line: 2931

 	               PO_WF_DEBUG_PKG.INSERT_DEBUG(l_item_type, l_item_key, 'l_email_address= ' || l_email_address);
Line: 2987

               the select statement. */

            -- Bug 3574886: Query from base tables in case the session context is not set correctly
            -- when this SQL is executed; fetch translated columns from hr_locations_all_tl
Line: 2991

	    select distinct hlt.description,
       		   hrl.address_line_1,
	  	   hrl.address_line_2,
		   hrl.address_line_3,
       		 --hrl.town_or_city, -- bug#15993315 commented to fetch tow_or_city from fnd_lookup_values
		   Decode(hrl.town_or_city,flv4.lookup_code,flv4.meaning,hrl.town_or_city) ,
       		   hrl.postal_code,
                   ftv.territory_short_name,
                   nvl(decode(hrl.region_1, null,
                              hrl.region_2, decode(flv1.meaning,null,
                                                   decode(flv2.meaning,null,flv3.meaning,flv2.lookup_code),
                                                   flv1.lookup_code)),
                       hrl.region_2)
	    into
		  l_ship_to_desc,
		  l_ship_to_add1,
		  l_ship_to_add2,
		  l_ship_to_add3,
		  l_ship_to_city,
		  l_ship_to_postal_code,
		  l_ship_to_country,
		  l_ship_to_region2
  	    FROM  hr_locations_all hrl,
                  hr_locations_all_tl hlt,
                  fnd_territories_vl ftv,
                  fnd_lookup_values_vl flv1,
                  fnd_lookup_values_vl flv2,
		  fnd_lookup_values_vl flv3,
		  fnd_lookup_values_vl flv4
  	    where hrl.region_1 = flv1.lookup_code (+)
            and   hrl.country || '_PROVINCE' = flv1.lookup_type (+)
            and   hrl.location_id = hlt.location_id
            and   hlt.language = USERENV('LANG')
            and   hrl.region_2 = flv2.lookup_code (+)
            and   hrl.country || '_STATE' = flv2.lookup_type (+)
            and   hrl.region_1 = flv3.lookup_code (+)
            and   hrl.country || '_COUNTY' = flv3.lookup_type (+)
            and   hrl.country = ftv.territory_code(+)
            and   HRL.location_id = l_location_id
            AND  hrl.town_or_city = flv4.lookup_code(+)
 	    AND  hrl.country || '_PROVINCE'  = flv4.lookup_type (+);
Line: 3041

                  /*select distinct
                  hrl.description,
                  hrl.address1,
                  hrl.address2,
                  hrl.address3,
                  hrl.city,
                  hrl.postal_code,
                  hrl.country
                 into
                  l_ship_to_desc,
                  l_ship_to_add1,
                  l_ship_to_add2,
                  l_ship_to_add3,
                  l_ship_to_city,
                  l_ship_to_postal_code,
                  l_ship_to_country
                  FROM  hz_locations hrl
                  where  HRL.location_id = l_location_id;*/
Line: 3060

 	                    SELECT
 	                              HLC.DESCRIPTION,
 	                              HLC.ADDRESS1,
 	                              HLC.ADDRESS2,
 	                              HLC.ADDRESS3,
 	                              HLC.CITY,
 	                              HLC.POSTAL_CODE,
 	                              HLC.COUNTRY,
 	                              NVL(DECODE(HLC.county, NULL, HLC.state,
 	                              DECODE(FCL1.MEANING, NULL,
 	                              DECODE(FCL2.MEANING, NULL,FCL3.MEANING, FCL2.LOOKUP_CODE),
 	                              FCL1.LOOKUP_CODE)), HLC.state)
 	                    INTO
 	                           l_ship_to_desc,
 	                           l_ship_to_add1,
 	                           l_ship_to_add2,
 	                           l_ship_to_add3,
 	                           l_ship_to_city,
 	                           l_ship_to_postal_code,
 	                           l_ship_to_country,
 	                           l_ship_to_region2
 	                     FROM
 	                            HZ_LOCATIONS             HLC,
 	                            FND_LOOKUP_VALUES            FCL1,
 	                            FND_LOOKUP_VALUES            FCL2,
 	                            FND_LOOKUP_VALUES            FCL3
 	                     WHERE
 	                         HLC.LOCATION_ID  = l_location_id AND
 	                         HLC.county = FCL1.LOOKUP_CODE (+) AND
 	                         HLC.COUNTRY || '_PROVINCE' = FCL1.LOOKUP_TYPE (+) AND
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', FCL1.SECURITY_GROUP_ID) =
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1',
 	                         FND_GLOBAL.LOOKUP_SECURITY_GROUP(FCL1.LOOKUP_TYPE,
 	                         FCL1.VIEW_APPLICATION_ID)) AND
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', FCL1.VIEW_APPLICATION_ID) =
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', 3) AND
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', FCL1.LANGUAGE) =
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', USERENV('LANG')) AND
 	                         HLC.state = FCL2.LOOKUP_CODE (+) AND
 	                         HLC.COUNTRY || '_STATE' = FCL2.LOOKUP_TYPE (+) AND
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', FCL2.SECURITY_GROUP_ID) =
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1',
 	                         FND_GLOBAL.LOOKUP_SECURITY_GROUP(FCL2.LOOKUP_TYPE,
 	                         FCL2.VIEW_APPLICATION_ID)) AND
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', FCL2.VIEW_APPLICATION_ID) =
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', 3) AND
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', FCL2.LANGUAGE) =
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', USERENV('LANG'))        AND
 	                         HLC.county = FCL3.LOOKUP_CODE (+) AND
 	                         HLC.COUNTRY || '_COUNTY' = FCL3.LOOKUP_TYPE (+) AND
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', FCL3.SECURITY_GROUP_ID) =
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1',
 	                         FND_GLOBAL.LOOKUP_SECURITY_GROUP(FCL3.LOOKUP_TYPE,
 	                         FCL3.VIEW_APPLICATION_ID)) AND
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', FCL3.VIEW_APPLICATION_ID) =
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', 3) AND
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', FCL3.LANGUAGE) =
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', USERENV('LANG')) ;
Line: 3210

	  select po_header_id into l_po_header_id from po_releases
	  where po_release_id = l_document_id;
Line: 3214

	  select org_id into l_operating_unit_id from po_headers
	  where po_header_id = l_po_header_id;*/
Line: 3234

              select full_name,work_telephone,email_address
                into l_deliver_to_person,l_phone,l_email_address
                from per_all_people_f
                where person_id = l_deliver_to_id
                and effective_start_date <= sysdate
                and effective_end_date >= sysdate;
Line: 3250

 	                 PO_WF_DEBUG_PKG.INSERT_DEBUG(l_item_type, l_item_key, 'l_deliver_to_person= ' || l_deliver_to_person);
Line: 3251

 	                 PO_WF_DEBUG_PKG.INSERT_DEBUG(l_item_type, l_item_key, 'l_phone= ' || l_phone);
Line: 3252

 	                 PO_WF_DEBUG_PKG.INSERT_DEBUG(l_item_type, l_item_key, 'l_email_address= ' || l_email_address);
Line: 3271

              the select statement. */

           -- Bug 3574886: Query from base tables in case the session context is not set correctly
           -- when this SQL is executed; fetch translated columns from hr_locations_all_tl
Line: 3275

	   select distinct hlt.description,
		  hrl.address_line_1,
		  hrl.address_line_2,
		  hrl.address_line_3,
       		  --hrl.town_or_city, -- bug#15993315 commented to fetch town_or_city from fnd_lookup_values
		  Decode(hrl.town_or_city,flv4.lookup_code,flv4.meaning,hrl.town_or_city) ,
       		  hrl.postal_code,
                  ftv.territory_short_name,
                  nvl(decode(hrl.region_1, null,
                             hrl.region_2, decode(flv1.meaning,null,
                                                  decode(flv2.meaning,null,flv3.meaning,flv2.lookup_code),
                                                  flv1.lookup_code)),
                      hrl.region_2)
	    into
		  l_ship_to_desc,
		  l_ship_to_add1,
		  l_ship_to_add2,
		  l_ship_to_add3,
		  l_ship_to_city,
		  l_ship_to_postal_code,
		  l_ship_to_country,
		  l_ship_to_region2
  	    FROM  hr_locations_all hrl,
                  hr_locations_all_tl hlt,
                  fnd_territories_vl ftv,
                  fnd_lookup_values_vl flv1,
                  fnd_lookup_values_vl flv2,
		  fnd_lookup_values_vl flv3,
		  fnd_lookup_values_vl flv4
	    where hrl.region_1 = flv1.lookup_code (+)
            and   hrl.country || '_PROVINCE' = flv1.lookup_type (+)
            and   hrl.location_id = hlt.location_id
            and   hlt.language = USERENV('LANG')
            and   hrl.region_2 = flv2.lookup_code (+)
            and   hrl.country || '_STATE' = flv2.lookup_type (+)
            and   hrl.region_1 = flv3.lookup_code (+)
            and   hrl.country || '_COUNTY' = flv3.lookup_type (+)
            and   hrl.country = ftv.territory_code(+)
            and   hrl.location_id = l_location_id
	    AND  hrl.town_or_city = flv4.lookup_code(+)
 	    AND  hrl.country || '_PROVINCE'  = flv4.lookup_type (+);
Line: 3325

                   /*select distinct
                  hrl.description,
                  hrl.address1,
                  hrl.address2,
                  hrl.address3,
                  hrl.city,
                  hrl.postal_code,
                  hrl.country
                  into
                  l_ship_to_desc,
                  l_ship_to_add1,
                  l_ship_to_add2,
                  l_ship_to_add3,
                  l_ship_to_city,
                  l_ship_to_postal_code,
                  l_ship_to_country
                   FROM  hz_locations hrl
                  where HRL.location_id = l_location_id;*/
Line: 3344

                   SELECT
 	                              HLC.DESCRIPTION,
 	                              HLC.ADDRESS1,
 	                              HLC.ADDRESS2,
 	                              HLC.ADDRESS3,
 	                              HLC.CITY,
 	                              HLC.POSTAL_CODE,
 	                              HLC.COUNTRY,
 	                              NVL(DECODE(HLC.county, NULL, HLC.state,
 	                              DECODE(FCL1.MEANING, NULL,
 	                              DECODE(FCL2.MEANING, NULL,FCL3.MEANING, FCL2.LOOKUP_CODE),
 	                                    FCL1.LOOKUP_CODE)), HLC.state)
 	                    INTO
 	                                l_ship_to_desc,
 	                             l_ship_to_add1,
 	                             l_ship_to_add2,
 	                             l_ship_to_add3,
 	                             l_ship_to_city,
 	                             l_ship_to_postal_code,
 	                             l_ship_to_country,
 	                             l_ship_to_region2
 	                     FROM
 	                            HZ_LOCATIONS             HLC,
 	                            FND_LOOKUP_VALUES            FCL1,
 	                            FND_LOOKUP_VALUES            FCL2,
 	                            FND_LOOKUP_VALUES            FCL3
 	                     WHERE
 	                         HLC.LOCATION_ID  = l_location_id AND
 	                         HLC.county = FCL1.LOOKUP_CODE (+) AND
 	                         HLC.COUNTRY || '_PROVINCE' = FCL1.LOOKUP_TYPE (+) AND
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', FCL1.SECURITY_GROUP_ID) =
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1',
 	                         FND_GLOBAL.LOOKUP_SECURITY_GROUP(FCL1.LOOKUP_TYPE,
 	                         FCL1.VIEW_APPLICATION_ID)) AND
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', FCL1.VIEW_APPLICATION_ID) =
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', 3) AND
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', FCL1.LANGUAGE) =
 	                         DECODE(FCL1.LOOKUP_CODE, NULL, '1', USERENV('LANG')) AND
 	                         HLC.state = FCL2.LOOKUP_CODE (+) AND
 	                         HLC.COUNTRY || '_STATE' = FCL2.LOOKUP_TYPE (+) AND
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', FCL2.SECURITY_GROUP_ID) =
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1',
 	                         FND_GLOBAL.LOOKUP_SECURITY_GROUP(FCL2.LOOKUP_TYPE,
 	                         FCL2.VIEW_APPLICATION_ID)) AND
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', FCL2.VIEW_APPLICATION_ID) =
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', 3) AND
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', FCL2.LANGUAGE) =
 	                         DECODE(FCL2.LOOKUP_CODE, NULL, '1', USERENV('LANG'))        AND
 	                         HLC.county = FCL3.LOOKUP_CODE (+) AND
 	                         HLC.COUNTRY || '_COUNTY' = FCL3.LOOKUP_TYPE (+) AND
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', FCL3.SECURITY_GROUP_ID) =
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1',
 	                         FND_GLOBAL.LOOKUP_SECURITY_GROUP(FCL3.LOOKUP_TYPE,
 	                         FCL3.VIEW_APPLICATION_ID)) AND
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', FCL3.VIEW_APPLICATION_ID) =
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', 3) AND
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', FCL3.LANGUAGE) =
 	                         DECODE(FCL3.LOOKUP_CODE, NULL, '1', USERENV('LANG')) ;
Line: 3498

	select bill_to_location_id, vendor_site_id, vendor_id, segment1,
	revision_num, to_char(creation_date,FND_PROFILE.VALUE_SPECIFIC('ICX_DATE_FORMAT_MASK', fnd_global.user_id),
                                     'NLS_CALENDAR = ''' || NVL( FND_PROFILE.VALUE_SPECIFIC('FND_FORMS_USER_CALENDAR', fnd_global.user_id) , 'GREGORIAN' ) || ''''),
		      to_char(revised_date,FND_PROFILE.VALUE_SPECIFIC('ICX_DATE_FORMAT_MASK', fnd_global.user_id),
                                     'NLS_CALENDAR = ''' ||  NVL(FND_PROFILE.VALUE_SPECIFIC('FND_FORMS_USER_CALENDAR', fnd_global.user_id)  , 'GREGORIAN' ) || ''''),
	ship_via_lookup_code, freight_terms_lookup_code, FOB_LOOKUP_CODE,
	nvl(vendor_contact_id, -99), terms_id,
	to_char(start_date,FND_PROFILE.VALUE_SPECIFIC('ICX_DATE_FORMAT_MASK', fnd_global.user_id),
	                          'NLS_CALENDAR = ''' ||  NVL(FND_PROFILE.VALUE_SPECIFIC('FND_FORMS_USER_CALENDAR', fnd_global.user_id)  , 'GREGORIAN' ) || '''') ,
	to_char(end_date, FND_PROFILE.VALUE_SPECIFIC('ICX_DATE_FORMAT_MASK', fnd_global.user_id),
                                  'NLS_CALENDAR = ''' ||  NVL(FND_PROFILE.VALUE_SPECIFIC('FND_FORMS_USER_CALENDAR', fnd_global.user_id)  , 'GREGORIAN' ) || '''') ,
	blanket_total_amount
	into l_bill_to_id, l_vendor_site_id, l_vendor_id,
	l_po_number, l_po_revision, l_date_of_order, l_date_of_revision,
	l_ship_via_lookup_code, l_freight_terms_lc, l_fob_lookup_code, l_vendor_contact_id,
	l_payment_terms_id,l_start_date,l_end_date,l_blanket_amt_agreed
	from po_headers
	where po_header_id = to_number(l_po_header_id);
Line: 3520

			select freight_code_tl into l_ship_via_lookup_desc
			from org_freight_vl
			where organization_id =  l_org_id --
			and freight_code = l_ship_via_lookup_code;
Line: 3536

		select last_name || ',' || first_name into l_vendor_contact_name from
			po_vendor_contacts where vendor_contact_id = l_vendor_contact_id;
Line: 3548

           select displayed_field
             into l_fob_lookup_desc
             from po_lookup_codes
             where lookup_type = 'FOB'
              and lookup_code = l_fob_lookup_code;
Line: 3565

	   select release_num,
	   to_char(revised_date ,FND_PROFILE.VALUE_SPECIFIC('ICX_DATE_FORMAT_MASK',fnd_global.user_id),
	                         'NLS_CALENDAR = ''' || NVL( FND_PROFILE.VALUE_SPECIFIC('FND_FORMS_USER_CALENDAR', fnd_global.user_id) ,'GREGORIAN' ) || ''''),
	   revision_num
	   into l_release_num, l_date_of_revision, l_po_revision
	   from po_releases
	   where po_release_id = l_document_id;
Line: 3574

	   select to_char(release_date , FND_PROFILE.VALUE_SPECIFIC('ICX_DATE_FORMAT_MASK',fnd_global.user_id),
	                                'NLS_CALENDAR = ''' || NVL( FND_PROFILE.VALUE_SPECIFIC('FND_FORMS_USER_CALENDAR', fnd_global.user_id) ,'GREGORIAN') || '''')
      	   into l_date_of_order
	   from po_releases
	   where po_release_id = l_document_id;
Line: 3596

        /*select name
        into l_company_name
        from hr_all_organization_units
        where organization_id = (select to_number(org_information2)
                                 from hr_organization_information
                                 where org_information_context = 'Operating Unit Information'
                                 and organization_id = l_operating_unit_id);*/
Line: 3619

 	                 PO_WF_DEBUG_PKG.INSERT_DEBUG(l_item_type, l_item_key, 'l_company_name= ' || l_company_name);
Line: 3625

           the select statement. */
	select distinct houv.name, houv.address_line_1, houv.address_line_2, houv.address_line_3,
	houv.town_or_city,
    nvl(decode(houv.region_1,
		null, houv.region_2,
		decode(flv1.meaning,null, decode(flv2.meaning,null,flv3.meaning,flv2.lookup_code),flv1.lookup_code))
		,houv.region_2),
	houv.postal_code, ftv.territory_short_name
	into
	l_operating_unit_desc, l_operating_unit_add1,
	l_operating_unit_add2, l_operating_unit_add3, l_operating_unit_city,
	l_operating_unit_state,l_operating_unit_postal_code, l_operating_unit_country
	from hr_organization_units_v houv, fnd_territories_vl ftv, fnd_lookup_values_vl flv1, fnd_lookup_values_vl flv2,
	fnd_lookup_values_vl flv3
	where
	houv.region_1 = flv1.lookup_code (+) and houv.country || '_PROVINCE' = flv1.lookup_type (+)
	and houv.region_2 = flv2.lookup_code (+) and houv.country || '_STATE' = flv2.lookup_type (+)
	and houv.region_1 = flv3.lookup_code (+) and houv.country || '_COUNTY' = flv3.lookup_type (+)
	and houv.country = ftv.territory_code(+) and organization_id = l_org_id; --
Line: 3655

           the select statement. */
	begin

        -- Bug 3574886: Query from base tables in case the session context is not set correctly
        -- when this SQL is executed; fetch translated columns from hr_locations_all_tl
Line: 3660

	select distinct hlt.description,
               hrl.address_line_1,
               hrl.address_line_2,
               hrl.address_line_3,
	       -- hrl.town_or_city,  --bug#15993315 commented to fetch town_or_city from fnd_lookup_values
	       Decode(hrl.town_or_city,flv4.lookup_code,flv4.meaning,hrl.town_or_city) ,
               ftv.territory_short_name,
               hrl.postal_code,
               nvl(decode(hrl.region_1, null,
                          hrl.region_2, decode(flv1.meaning, null,
                                               decode(flv2.meaning,null,flv3.meaning,flv2.lookup_code),
                                               flv1.lookup_code)),
                   hrl.region_2)
	into   l_bill_to_desc,
               l_bill_to_add1,
               l_bill_to_add2,
               l_bill_to_add3,
               l_bill_to_city,
	       l_bill_to_country,
               l_bill_to_postal_code,
               l_bill_to_region2
	from   hr_locations_all hrl,
               hr_locations_all_tl hlt,
               fnd_territories_vl ftv,
               fnd_lookup_values_vl flv1,
               fnd_lookup_values_vl flv2,
	       fnd_lookup_values_vl flv3,
	       fnd_lookup_values_vl flv4
	where  hrl.region_1 = flv1.lookup_code (+)
        and    hrl.country || '_PROVINCE' = flv1.lookup_type (+)
        and    hrl.location_id = hlt.location_id
        and    hlt.language = USERENV('LANG')
        and    hrl.region_2 = flv2.lookup_code (+)
        and    hrl.country || '_STATE' = flv2.lookup_type (+)
        and    hrl.region_1 = flv3.lookup_code (+)
        and    hrl.country || '_COUNTY' = flv3.lookup_type (+)
	and    hrl.country = ftv.territory_code(+)
        and    hrl.location_id = l_bill_to_id
	AND  hrl.town_or_city = flv4.lookup_code(+)
 	AND  hrl.country || '_PROVINCE'  = flv4.lookup_type (+);
Line: 3710

           the select statement. */
	begin
	select pvs.address_line1, pvs.address_line2, pvs.address_line3, pvs.city, nvl(nvl(pvs.state, pvs.county), pvs.province),
	ftv.territory_short_name, zip
	into
	l_vendor_add1, l_vendor_add2, l_vendor_add3, l_vendor_city, l_vendor_state,
	l_vendor_country, l_vendor_zip
	from po_vendor_sites pvs , fnd_territories_vl ftv
	where
	ftv.territory_code(+) = pvs.country --
	and vendor_site_id = l_vendor_site_id;
Line: 3739

	     select full_name into l_buyer
	     from per_all_people_f                   --
         where person_id = (select agent_id from po_headers
						    where po_header_id = to_number(l_po_header_id))
         and trunc(sysdate) between trunc(effective_start_date) and trunc(effective_end_date); --Bug#5161502
Line: 3746

	     select full_name into l_buyer
	     from per_all_people_f                   --
         where person_id = (select agent_id from po_headers_archive
						where po_header_id = to_number(l_po_header_id) and
						revision_num = 0)
         and trunc(sysdate) between trunc(effective_start_date) and trunc(effective_end_date); --Bug#5161502
Line: 3762

	        select full_name into l_revision_buyer
	        from per_all_people_f                   --
            where person_id = (select agent_id from po_headers_archive
						where po_header_id = to_number(l_po_header_id) and
						revision_num = l_po_revision)
                  and trunc(sysdate) between trunc(effective_start_date) and trunc(effective_end_date); --Bug#5161502
Line: 3780

	  select full_name into l_buyer
	  from per_all_people_f                   --
      where person_id = (select agent_id from po_releases_archive
						where po_release_id = to_number(l_document_id) and
						revision_num = 0)
	    and trunc(sysdate) between trunc(effective_start_date) and trunc(effective_end_date); --Bug#5161502
Line: 3794

	        select full_name into l_revision_buyer
	       from per_all_people_f                   --
            where person_id = (select agent_id from po_releases_archive
						where po_release_id = to_number(l_document_id) and
						revision_num = l_po_revision)
                 and trunc(sysdate) between trunc(effective_start_date) and trunc(effective_end_date); --Bug#5161502
Line: 3833

	  select nvl(pvs.customer_num, pov.customer_num) into l_customer_acct_num
	  from po_vendor_sites pvs, po_vendors pov
	  where pvs.vendor_site_id = l_vendor_site_id
	  and   pov.vendor_id	 = l_vendor_id;
Line: 3842

	  select segment1, vendor_name
	  into l_vendor_num, l_vendor_desc
	  from po_vendors pov
	  where pov.vendor_id = l_vendor_id;
Line: 3853

	  select name into l_payment_terms
	  from ap_terms_val_v apv
	  where apv.TERM_ID = l_payment_terms_id;
Line: 4256

            select type_lookup_code
            into x_subtype
            from po_headers
            where po_header_id = l_document_id;
Line: 4263

 	                 PO_WF_DEBUG_PKG.INSERT_DEBUG(l_item_type, l_item_key, 'x_subtype= ' || x_subtype);
Line: 4638

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,l_progress);
Line: 4639

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_item_type= ' || l_item_type);
Line: 4640

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_item_key= ' || l_item_key);
Line: 4641

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_document_id= ' || l_document_id);
Line: 4642

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_document_type= ' || l_document_type);
Line: 4643

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_org_id= ' || l_org_id);
Line: 4652

          select authorization_status
            into l_document_status
            from po_headers_all
           where po_header_id = l_document_id;
Line: 4659

          select po_header_id into l_po_header_id from po_releases
          where po_release_id = l_document_id;
Line: 4662

          select authorization_status
            into l_document_status
            from po_headers_all
           where po_header_id = l_po_header_id;
Line: 4670

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_document_status= ' || l_document_status);
Line: 4671

 	                 PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_po_header_id= ' || l_po_header_id);
Line: 4695

 	            PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_user_id= ' || l_user_id);
Line: 4696

 	            PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_application_id= ' || l_application_id);
Line: 4697

 	            PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,'l_responsibility_id= ' || l_responsibility_id);