DBA Data[Home] [Help]

APPS.PO_COPYDOC_SUB SQL Statements

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

Line: 7

    SELECT *
    FROM   PO_LINES
    WHERE  po_header_id = x_po_header_id
    ORDER BY line_num;
Line: 20

    SELECT *
    FROM   PO_LINE_LOCATIONS
    WHERE  po_line_id = x_po_line_id
    AND    shipment_type not in ('BLANKET','SCHEDULED')
    ORDER BY shipment_num;
Line: 27

    SELECT *
    FROM  PO_DISTRIBUTIONS POD
    WHERE POD.line_location_id = x_line_location_id
    AND   POD.distribution_type <> 'AGREEMENT'  --
    ORDER BY distribution_num;
Line: 35

    SELECT *
    FROM  PO_DISTRIBUTIONS POD
    WHERE POD.po_header_id = x_po_header_id
    AND   POD.distribution_type = 'AGREEMENT'
    ORDER BY distribution_num;
Line: 341

  SELECT fsp.ship_to_location_id,
         fsp.bill_to_location_id,
         fsp.ship_via_lookup_code,
         fsp.fob_lookup_code,
         fsp.freight_terms_lookup_code,
         fsp.terms_id
  INTO   x_ship_to_location_id,
         x_bill_to_location_id,
         x_ship_via_lookup_code,
         x_fob_lookup_code,
         x_freight_terms_lu_code,
         x_terms_id
  FROM   FINANCIALS_SYSTEM_PARAMETERS fsp;
Line: 402

  SELECT null,
         null,
         null,
         null,
         null,
         terms_id
  INTO   x_ship_to_location_id,
         x_bill_to_location_id,
         x_ship_via_lookup_code,
         x_fob_lookup_code,
         x_freight_terms_lu_code,
         x_terms_id
  FROM   PO_VENDORS
  WHERE  vendor_id = x_vendor_id;
Line: 463

  SELECT ship_to_location_id,
         bill_to_location_id,
         ship_via_lookup_code,
         fob_lookup_code,
         freight_terms_lookup_code,
         terms_id
  INTO   x_ship_to_location_id,
         x_bill_to_location_id,
         x_ship_via_lookup_code,
         x_fob_lookup_code,
         x_freight_terms_lu_code,
         x_terms_id
  FROM   PO_VENDOR_SITES
  WHERE  vendor_id = x_vendor_id
  AND    vendor_site_id = x_vendor_site_id;
Line: 531

    SELECT distinct 'Y'
    INTO   x_valid_flag
    FROM   po_buyers_val_v
    WHERE  employee_id = (
           SELECT agent_id FROM po_agents
           WHERE sysdate between nvl(start_date_active, sysdate-1)
                         and nvl(end_date_active, sysdate+1)
             AND agent_id = x_buyer_id);
Line: 581

    SELECT distinct 'Y'
    INTO   x_valid_flag
    FROM   PO_VENDORS
    WHERE  vendor_id = x_vendor_id
    AND    enabled_flag = 'Y'
    AND    SYSDATE BETWEEN nvl(start_date_active, SYSDATE-1)
                       AND nvl(end_date_active, SYSDATE+1);
Line: 611

      SELECT distinct 'Y'
      INTO   x_valid_flag
      FROM   PO_VENDOR_SITES
      WHERE  vendor_site_id = x_vendor_site_id
      AND    vendor_id = x_vendor_id
      AND    nvl(rfq_only_site_flag,'N') <> 'Y'
      AND    purchasing_site_flag = 'Y'
      AND    SYSDATE < nvl(inactive_date, SYSDATE + 1);
Line: 642

        SELECT distinct 'Y'
        INTO   x_valid_flag
        FROM   PO_VENDOR_CONTACTS
        WHERE  vendor_contact_id = x_vendor_contact_id
        AND    vendor_site_id = x_vendor_site_id
        AND    SYSDATE < nvl(inactive_date, SYSDATE+1);
Line: 738

      SELECT distinct 'Y'
      INTO   x_valid_flag
      FROM   PO_SHIP_TO_LOC_ORG_V
      WHERE  location_id = x_ship_to_location_id
      AND    (set_of_books_id IS NULL OR set_of_books_id = x_sob_id);
Line: 763

      SELECT distinct 'Y'
      INTO   x_valid_flag
      FROM   HR_BILLING_LOCATIONS_PO_V
      WHERE  location_id = x_bill_to_location_id;
Line: 788

      SELECT distinct 'Y'
      INTO   x_valid_flag
      FROM   PO_LOOKUP_CODES
      WHERE  lookup_type = 'FOB'
      AND    SYSDATE < nvl(inactive_date, SYSDATE+1)
      AND    lookup_code = x_fob_lookup_code;
Line: 815

      SELECT distinct 'Y'
      INTO   x_valid_flag
      FROM   PO_LOOKUP_CODES
      WHERE  lookup_type = 'FREIGHT TERMS'
      AND    SYSDATE < nvl(inactive_date, SYSDATE+1)
      AND    lookup_code = x_freight_terms_lu_code;
Line: 842

      SELECT distinct 'Y'
      INTO   x_valid_flag
      FROM   AP_TERMS_VAL_V
      WHERE  term_id = x_terms_id;
Line: 889

      SELECT distinct 'Y'
      INTO   x_valid_flag
      FROM   MTL_SYSTEM_ITEMS
      WHERE  inventory_item_id = x_item_id
      AND    purchasing_enabled_flag = 'Y'
      AND    organization_id = x_inv_org_id;
Line: 921

        SELECT distinct 'Y'
        INTO   x_valid_flag
        FROM   MTL_SYSTEM_ITEMS MSI
        WHERE  MSI.inventory_item_id = x_item_id
        AND    MSI.organization_id = x_inv_org_id
        AND    (MSI.outside_operation_flag <> 'Y'
                OR (MSI.outside_operation_flag = 'Y'
                    AND EXISTS (SELECT 'op line type'
                                FROM   PO_LINE_TYPES PLT
                                WHERE  PLT.line_type_id = x_line_type_id
                                AND    PLT.outside_operation_flag = 'Y')
                   )
               );
Line: 958

        SELECT distinct 'Y'
        INTO   x_valid_flag
        FROM   PO_LINE_TYPES
        WHERE  line_type_id = x_line_type_id
        AND    order_type_lookup_code <> 'AMOUNT';
Line: 986

          SELECT distinct 'Y'
          INTO   x_valid_flag
          FROM   MTL_ITEM_REVISIONS_ORG_VAL_V
          WHERE  revision = x_item_revision
          AND    inventory_item_id = x_item_id;
Line: 1012

          SELECT MIC.category_id
          INTO   x_category_id
          FROM   MTL_ITEM_CATEGORIES MIC,
                 MTL_DEFAULT_SETS_VIEW MDSV
          WHERE  MIC.inventory_item_id = x_item_id
          AND    MIC.organization_id = x_inv_org_id
          AND    MIC.category_set_id = MDSV.category_set_id
          AND    MDSV.functional_area_id = 2;
Line: 1052

          SELECT distinct 'Y'
          INTO   x_valid_flag
          FROM   MTL_ITEM_CATEGORIES MIC,
                 MTL_DEFAULT_SETS_VIEW MDSV
          WHERE  MIC.category_id = x_category_id
          AND    MIC.inventory_item_id = x_item_id
          AND    MIC.organization_id = x_inv_org_id
          AND    MIC.category_set_id = MDSV.category_set_id
          AND    MDSV.functional_area_id = 2;
Line: 1105

	SELECT distinct 'Y'
        INTO   x_valid_flag
        FROM   MTL_CATEGORY_SET_VALID_CATS MCSVC,
               MTL_DEFAULT_SETS_VIEW MDSV
        WHERE  MCSVC.category_id = x_category_id
        AND    MCSVC.category_set_id = MDSV.category_set_id
        AND    MDSV.functional_area_id = 2;
Line: 1114

            select validate_flag,
                   category_set_id
            INTO l_validate_flag,
                 l_category_set_id
            FROM MTL_DEFAULT_SETS_VIEW MDSV
            where MDSV.functional_area_id = 2;
Line: 1127

             SELECT distinct 'Y'
             INTO   x_valid_flag
             FROM   MTL_CATEGORY_SET_VALID_CATS MCSVC,
                    MTL_CATEGORIES_VL MCV
             WHERE  MCSVC.category_id = x_category_id
             AND    MCSVC.category_set_id = l_category_set_id
             AND    MCV.category_id = MCSVC.category_id
             AND    sysdate < nvl(mcv.disable_date, sysdate+1)
             AND    mcv.enabled_flag = 'Y';
Line: 1139

             SELECT distinct 'Y'
             INTO   x_valid_flag
             FROM   MTL_CATEGORIES_VL MCV
             WHERE  MCV.category_id = x_category_id
             AND    sysdate < nvl(mcv.disable_date, sysdate+1)
             AND    mcv.enabled_flag = 'Y';
Line: 1211

  SELECT distinct 'Y'
  INTO   x_valid_flag
  FROM   gl_code_combinations gcc,
         gl_sets_of_books sob
  WHERE  gcc.code_combination_id = x_account_id
  AND  gcc.enabled_flag = 'Y'
  AND  trunc(nvl(x_gl_date,SYSDATE)) BETWEEN
       trunc(nvl(start_date_active, nvl(x_gl_date,SYSDATE) ))
       AND
       trunc(nvl (end_date_active, nvl(x_gl_date,SYSDATE) ))
  AND  gcc.detail_posting_allowed_flag = 'Y'
  AND  gcc.summary_flag = 'N'
  AND  gcc.chart_of_accounts_id = sob.chart_of_accounts_id
  AND  sob.set_of_books_id = x_sob_id;
Line: 1296

     SELECT distinct 'Y'
     INTO   x_valid_flag
     FROM   pa_projects_expend_v
     WHERE  project_id=x_project_id;
Line: 1305

    SELECT distinct 'Y'
    INTO   x_valid_flag
    FROM   mtl_project_v m,
           pjm_project_parameters p
    WHERE  p.organization_id = x_ship_to_organization_id
    AND    m.project_id = p.project_id
    AND    m.project_id = x_project_id;
Line: 1358

  select distinct 'Y'
  into   x_valid_flag
  from   pa_tasks_expend_v
  where  project_id = x_project_id
  and    task_id = x_task_id;
Line: 1404

   select distinct 'Y'
          into  x_valid_flag
          from pa_projects_all prj,
               pa_tasks tsk
          where
               prj.project_id = x_project_id
           and prj.project_id = tsk.project_id
           and tsk.task_id    = x_task_id
           and x_exp_item_date between
               nvl(prj.start_date,x_exp_item_date)
           and nvl(prj.completion_date,x_exp_item_date)
           and x_exp_item_date between
               nvl(tsk.start_date,x_exp_item_date)
           and nvl(tsk.completion_date,x_exp_item_date);
Line: 1453

   SELECT
      'Y' into x_valid_flag
       FROM
            pa_expenditure_types_expend_v et
       WHERE
           system_linkage_function = 'VI' and
	  (et.project_id = x_project_id or et.project_id is null)  and
	  trunc(sysdate) between nvl(et.expnd_typ_start_date_active, trunc(sysdate)) and
	  nvl(et.expnd_typ_end_date_Active, trunc(sysdate))
	  and et.expenditure_type = x_exp_type;
Line: 1497

   select 'Y'
           into x_valid_flag
   from  pa_organizations_expend_v pao
   where pao.active_flag = 'Y'
   and   pao.organization_id = x_org_id ;
Line: 1554

  /*SELECT expense_accrual_code
  INTO   x_expense_accrual_code
  FROM   po_system_parameters; Bug7351781 */
Line: 1560

  SELECT consigned_flag
  INTO   x_consigned_flag
  FROM   po_line_locations
  WHERE  line_location_id = x_line_location_id;
Line: 1595

        SELECT NVL(PLT.OUTSIDE_OPERATION_FLAG,'N')
        INTO   x_osp_line_flag
        FROM   PO_LINE_TYPES PLT, PO_LINES POL
        WHERE  PLT.LINE_TYPE_ID = POL.LINE_TYPE_ID
        AND    POL.PO_LINE_ID = x_po_line_id;
Line: 1619

       select distinct 'Y' valid
       into   x_valid_flag
       from   po_lookup_codes
       where  lookup_type = 'DESTINATION TYPE'
       and ( ( nvl(x_item_status,'D') = 'D'
               and lookup_code <> 'INVENTORY' )
          or ( nvl(x_item_status,'D') = 'E'
               and lookup_code <> 'SHOP FLOOR')
          or ( nvl(x_item_status,'D') = 'O'
               and lookup_code = 'SHOP FLOOR') )
       and ( ( nvl(x_consigned_flag,'N') = 'Y' and lookup_code = 'INVENTORY' )
           OR( p_transaction_flow_header_id IS NOT NULL )   --< Bug 3546252 >
           or( nvl(x_consigned_flag,'N') = 'N'
               and ( (nvl(x_accrue_on_receipt_flag,'Y') = 'N'
                      and lookup_code ='EXPENSE')
                  or ( nvl(x_accrue_on_receipt_flag,'Y') = 'Y'
                       and lookup_code IN ('EXPENSE','INVENTORY','SHOP FLOOR') ) ) ) ) --bug7351781
       and  lookup_code= x_destination_type_code;
Line: 1649

  select distinct 'Y' valid
  into   x_valid_flag
  from   po_lookup_codes
  where  lookup_type = 'DESTINATION TYPE'
  and ( ( nvl( x_item_status,'D') = 'D'
          and lookup_code = 'EXPENSE')
     or ( nvl( x_item_status,'D') = 'E'
          and lookup_code <> 'SHOP FLOOR')
     or ( nvl( x_item_status,'D') = 'O'
          and lookup_code = 'SHOP FLO-OR') )
  and ( ( nvl( x_accrue_on_receipt_flag,'Y') = 'N'
          and ( lookup_code = 'EXPENSE' or
                x_consigned_flag = 'Y') )
      OR (p_transaction_flow_header_id IS NOT NULL)   --< Bug 3546252 >
      OR  (nvl(x_accrue_on_receipt_flag,'Y') = 'N'
                      and lookup_code ='EXPENSE')
      OR ( nvl(x_accrue_on_receipt_flag,'Y') = 'Y'
                       and lookup_code IN ('EXPENSE','INVENTORY','SHOP FLOOR'))) --bug7351781
  and    lookup_code= x_destination_type_code;
Line: 1711

  SELECT distinct 'Y'
  INTO   x_valid_flag
  FROM   hr_employees_current_v
  WHERE  employee_id = x_deliver_to_person_id;
Line: 1764

	   select entity_type
	     into x_entity_type
	     from wip_entities
            where wip_entity_id=x_wip_entity_id;
Line: 1773

	      select count(*)
	        into x_count
	        from wip_entities we,
	             wip_discrete_jobs wdj
	       where we.wip_entity_id = wdj.wip_entity_id
	         and we.entity_type = 6
	         and wdj.status_type in (3,4,6);
Line: 1781

	      select count(*) into x_count
	        from wip_osp_jobs_val_v job, pa_tasks task
	       where job.wip_entity_id = x_wip_entity_id
	         and job.organization_id = x_destination_organization_id
	         and task.task_id (+) = job.task_id;
Line: 1801

	   select count(*)
	     into x_count
	     from wip_osp_lines_val_v
	    where line_id = x_wip_line_id
	      and organization_id = x_destination_organization_id;
Line: 1824

	   select count(*)
	     INTO x_count
	     from WIP_OPERATIONS WO,
	          BOM_STANDARD_OPERATIONS  BSO
	    WHERE WO.WIP_ENTITY_ID=x_wip_entity_id
	      AND operation_seq_num=x_wip_operation_seq_num
	      AND WO.STANDARD_OPERATION_ID = BSO.STANDARD_OPERATION_ID (+)    --Bug 3557910 Added Outer JOIN
	      AND nvl(BSO.OPERATION_TYPE,1) =1
	      AND BSO.line_id is null;
Line: 1835

	   select count(*) into x_count
	     from wip_osp_operations_val_v
	    where operation_seq_num = x_wip_operation_seq_num
	      and organization_id = x_destination_organization_id
	      and ((wip_entity_id = x_wip_entity_id) and x_wip_line_id is null);
Line: 1843

		select count(*) into x_count
		from wip_osp_operations_val_v
		where operation_seq_num = x_wip_operation_seq_num
		and organization_id = x_destination_organization_id
		and repetitive_schedule_id = x_wip_repetitive_schedule_id;
Line: 1866

	   select count(*) into x_count
	     from wip_osp_resources_val_v
	    where resource_seq_num = x_wip_resource_seq_num
	      and organization_id = x_destination_organization_id
	      and ((wip_entity_id = x_wip_entity_id and x_wip_line_id is null)
	       or repetitive_schedule_id = x_wip_repetitive_schedule_id)
	      and operation_seq_num = x_wip_operation_seq_num;
Line: 1921

   SELECT distinct 'Y'
   INTO   x_valid_flag
   FROM   HR_LOCATIONS_ALL
   WHERE  nvl(inventory_organization_id,x_ship_to_organization_id) = x_ship_to_organization_id
   AND    nvl(inactive_date, trunc(sysdate + 1)) > trunc(sysdate)
   AND    location_id = x_deliver_to_location_id;
Line: 1930

       SELECT distinct 'Y'
       INTO   x_valid_flag
       FROM   HZ_LOCATIONS
       WHERE  nvl(address_expiration_date, trunc(sysdate + 1)) > trunc(sysdate)
       AND    location_id = x_deliver_to_location_id;
Line: 1979

  select  distinct 'Y'
  into    x_valid_flag
  from    mtl_secondary_inventories msub
  where   msub.organization_id = nvl(x_ship_to_organization_id, msub.organization_id)
  and     nvl(msub.disable_date, trunc(sysdate+1)) > trunc(sysdate)
  and     (x_item_id is null
           or
          (x_item_id is not null
           and exists (select null
                       from   mtl_system_items msi
                       where  msi.organization_id = nvl(x_ship_to_organization_id, msi.organization_id)
                       and msi.inventory_item_id = x_item_id
                       and (msi.restrict_subinventories_code = 2
                       or (msi.restrict_subinventories_code = 1
                           and exists (select null
                                       from mtl_item_sub_inventories mis
                                       where mis.organization_id = nvl(x_ship_to_organization_id , mis.organization_id)
                                       and mis.inventory_item_id = msi.inventory_item_id
                                       and mis.secondary_inventory = msub.secondary_inventory_name))))))
  and msub.secondary_inventory_name =  x_destination_subinventory;
Line: 2051

  SELECT 'Y'
  INTO   x_valid_flag
  FROM   po_headers_all POH
  WHERE  POH.po_header_id = p_contract_id
  AND    POH.type_lookup_code = 'CONTRACT'
  AND    POH.authorization_status = 'APPROVED'
  AND    NVL(POH.closed_code, 'OPEN') = 'OPEN'
  AND    NVL(POH.cancel_flag, 'N') <> 'Y'
  AND    NVL(POH.frozen_flag, 'N') <> 'Y';
Line: 2108

  SELECT 'Y'
  INTO   l_valid_flag
  FROM   po_headers_all
  WHERE  po_header_id = p_from_header_id
  AND    nvl(closed_code,'OPEN') <> 'FINALLY CLOSED'
  AND    nvl(cancel_flag,'N') <> 'Y';
Line: 2185

    SELECT pj.name,
           pb.name
    INTO   l_job_name,
           l_bg_name
    FROM   per_jobs_vl pj,
           per_business_groups_perf pb
    WHERE  pj.business_group_id = pb.business_group_id
    AND    pj.job_id = p_job_id;
Line: 2201

    SELECT 'Y'
    INTO   l_valid_flag
    FROM   per_jobs
    WHERE  job_id = p_job_id
    AND    sysdate between date_from and nvl(date_to,sysdate+1);
Line: 2232

    SELECT mtl.concatenated_segments
    INTO   l_category
    FROM   po_job_associations pja,
           mtl_categories_kfv mtl
    WHERE  pja.category_id = mtl.category_id
    AND    pja.job_id = p_job_id;
Line: 2239

    SELECT 'Y'
    INTO   l_valid_flag
    FROM   po_job_associations
    WHERE  job_id = p_job_id
    AND    ( inactive_date is null
           OR trunc(sysdate) < trunc(inactive_date));
Line: 2322

  SELECT *
  INTO   x_po_header_record
  FROM   po_headers
  WHERE  po_header_id = x_po_header_id;
Line: 3006

    INSERT INTO po_online_report_text
    (
           online_report_id,
           last_update_login,
           last_updated_by,
           last_update_date,
           created_by,
           creation_date,
           sequence,
           text_line,
           message_type
    )
    --SQL What: Check if the requesting orgs for enabled org assignments are
    --          still valid.
    --SQL Why: Insert an error for each invalid requesting org
    SELECT p_online_report_id,
           l_login_id,
           l_user_id,
           SYSDATE,
           l_user_id,
           SYSDATE,
           x_sequence + ROWNUM,
           SUBSTRB(l_err_prefix||psg.char1||l_text_line,1,2000),
           l_message_type
      FROM po_session_gt psg
     WHERE psg.key = l_key
       AND NOT EXISTS
           (SELECT 'is active ou'
              FROM hr_operating_units hou,
                   financials_system_params_all fspa,
                   po_system_parameters_all pspa
             WHERE hou.organization_id = psg.num1
               AND hou.organization_id = pspa.org_id
               AND pspa.org_id = fspa.org_id
               AND TRUNC(SYSDATE) BETWEEN TRUNC(hou.date_from)
                                      AND TRUNC(NVL(hou.date_to, SYSDATE+1))
           );
Line: 3054

    INSERT INTO po_online_report_text
    (
           online_report_id,
           last_update_login,
           last_updated_by,
           last_update_date,
           created_by,
           creation_date,
           sequence,
           text_line,
           message_type
    )
    --SQL What: Check if the purchasing orgs for enabled org assignments are
    --          still valid.
    --SQL Why: Insert an error for each invalid purchasing org
    SELECT p_online_report_id,
           l_login_id,
           l_user_id,
           SYSDATE,
           l_user_id,
           SYSDATE,
           x_sequence + ROWNUM,
           SUBSTRB(l_err_prefix||psg.char1||l_text_line,1,2000),
           l_message_type
      FROM po_session_gt psg
     WHERE psg.key = l_key
       AND (NOT EXISTS
               (SELECT 'is active ou'
                  FROM hr_operating_units hou,
                       financials_system_params_all fspa,
                       po_system_parameters_all pspa
                 WHERE hou.organization_id = psg.num2
                   AND hou.organization_id = pspa.org_id
                   AND pspa.org_id = fspa.org_id
                   AND TRUNC(SYSDATE) BETWEEN TRUNC(hou.date_from)
                                          AND TRUNC(NVL(hou.date_to, SYSDATE+1))
               )
            OR
            NOT EXISTS
                (SELECT 'encumbrance check'
                   FROM financials_system_params_all fspa1,
                        financials_system_params_all fspa2
                  WHERE fspa1.org_id = psg.num1
                    AND fspa2.org_id = psg.num2
                    AND (   fspa1.org_id = fspa2.org_id
                         OR
                            (    NVL(fspa1.purch_encumbrance_flag,'N') = 'N'
                             AND NVL(fspa1.req_encumbrance_flag,'N') = 'N'
                             AND NVL(fspa2.purch_encumbrance_flag,'N') = 'N'
                             AND NVL(fspa2.req_encumbrance_flag,'N') = 'N'
                            )
                        )
                )
            OR
            NOT EXISTS
                (SELECT 'Valid vendor site for POU'
                   FROM po_vendor_sites_all pvsa
                  WHERE pvsa.vendor_id = p_vendor_id
                    AND pvsa.org_id = psg.num2
                    AND pvsa.purchasing_site_flag = 'Y'
                    AND NVL(pvsa.rfq_only_site_flag, 'N') = 'N'
                    AND TRUNC(SYSDATE) <
                        TRUNC(NVL(pvsa.inactive_date, SYSDATE+1))
                )
           );
Line: 3130

    INSERT INTO po_online_report_text
    (
           online_report_id,
           last_update_login,
           last_updated_by,
           last_update_date,
           created_by,
           creation_date,
           sequence,
           text_line,
           message_type
    )
    --SQL What: Check if the purchasing sites for enabled org assignments are
    --          still valid.
    --SQL Why: Insert an error for each invalid purchasing site
    SELECT p_online_report_id,
           l_login_id,
           l_user_id,
           SYSDATE,
           l_user_id,
           SYSDATE,
           x_sequence + ROWNUM,
           SUBSTRB(l_err_prefix||psg.char1||l_text_line,1,2000),
           l_message_type
      FROM po_session_gt psg
     WHERE psg.key = l_key
       AND NOT EXISTS
           (SELECT 'Valid vendor site'
              FROM po_vendor_sites_all pvsa
             WHERE pvsa.vendor_site_id = psg.num3
               AND pvsa.vendor_id = p_vendor_id
               AND pvsa.org_id = psg.num2
               AND pvsa.purchasing_site_flag = 'Y'
               AND NVL(pvsa.rfq_only_site_flag, 'N') = 'N'
               AND TRUNC(SYSDATE) < TRUNC(NVL(pvsa.inactive_date, SYSDATE+1))
           );
Line: 3241

    SELECT po_session_gt_s.nextval
      INTO x_key
      FROM DUAL;
Line: 3249

    INSERT INTO po_session_gt
    (
           key,
           num1,
           num2,
           num3,
           char1
    )
    --SQL What: Get info for all enabled org assignments of this GA
    --SQL Why: Store info temporarily for org assignment submission checks
    SELECT x_key,
           pgoa.organization_id,
           pgoa.purchasing_org_id,
           pgoa.vendor_site_id,
           hout.name
      FROM po_ga_org_assignments pgoa,
           hr_all_organization_units_tl hout
     WHERE pgoa.po_header_id = p_po_header_id
       AND pgoa.organization_id = hout.organization_id
       AND hout.language = USERENV('LANG')
       AND pgoa.enabled_flag = 'Y';