DBA Data[Home] [Help]

APPS.RCV_TRANSACTIONS_INTERFACE_SV1 SQL Statements

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

Line: 147

        SELECT NVL(MAX(unit_of_measure), 'notfound')
        INTO   x_unit_of_measure
        FROM   mtl_units_of_measure
        WHERE  unit_of_measure = x_uom_record.unit_of_measure;
Line: 169

            SELECT primary_unit_of_measure
            INTO   x_primary_unit_of_measure
            FROM   mtl_system_items_kfv
            WHERE  inventory_item_id = x_uom_record.item_id
            AND    organization_id = NVL(x_uom_record.to_organization_id, organization_id); -- Raj added as org_id is part of uk
Line: 207

        SELECT NVL(MAX(unit_meas_lookup_code), 'notfound')
        INTO   x_unit_meas_lookup_code_lines
        FROM   po_lines
        WHERE  po_line_id = x_uom_record.po_line_id;
Line: 228

        SELECT NVL(MAX(enable_cum_flag), 'F')
        INTO   x_cum_enabled
        FROM   chv_org_options
        WHERE  organization_id = NVL(x_uom_record.to_organization_id, organization_id);
Line: 233

        SELECT NVL(MAX(supply_agreement_flag), 'N')
        INTO   x_supply_agreement_flag
        FROM   po_headers
        WHERE  po_header_id = x_uom_record.po_header_id
        AND    type_lookup_code = 'BLANKET'
        AND    supply_agreement_flag = 'Y';
Line: 242

            SELECT NVL(MAX(NULL), 'notfound') -- purchasing_unit_of_measure doesn't exist!!
            INTO   x_asl_uom
            FROM   chv_cum_period_items
            WHERE  organization_id = NVL(x_uom_record.to_organization_id, organization_id);
Line: 301

        SELECT NVL(MAX(inventory_item_id), -9999)
        INTO   x_inventory_item
        FROM   mtl_system_items
        WHERE  inventory_item_id = x_item_id_record.item_id;
Line: 311

        SELECT NVL(MAX(inventory_item_id), -9999)
        INTO   x_inventory_item
        FROM   mtl_system_items
        WHERE  SYSDATE BETWEEN NVL(start_date_active, SYSDATE - 1) AND NVL(end_date_active, SYSDATE + 1)
        AND    inventory_item_id = x_item_id_record.item_id;
Line: 327

          * check below. Similarly changed the select statement and the
          * check for nvl(max(item_id),0).
         */
        SELECT NVL(MAX(organization_id), -9999)
        INTO   x_organization_id
        FROM   mtl_system_items
        WHERE  inventory_item_id = x_item_id_record.item_id
        AND    organization_id = NVL(x_item_id_record.to_organization_id, organization_id);
Line: 341

        SELECT NVL(MAX(item_id), -9999)
        INTO   x_item_id_po
        FROM   po_lines
        WHERE  po_line_id = x_item_id_record.po_line_id
        AND    item_id = x_item_id_record.item_id;
Line: 366

        SELECT NVL(MAX(item_id), -9999)
        INTO   x_item_id_po
        FROM   po_lines
        WHERE  po_line_id = x_item_id_record.po_line_id
        AND    item_id = x_item_id_record.item_id;
Line: 445

        SELECT NVL(MAX(inventory_item_id), 0)
        INTO   x_inventory_item
        FROM   mtl_system_items
        WHERE  inventory_item_id = x_sub_item_id_record.substitute_item_id
        AND    organization_id = NVL(x_sub_item_id_record.to_organization_id, organization_id);
Line: 456

        SELECT NVL(MAX(inventory_item_id), 0)
        INTO   x_inventory_item
        FROM   mtl_system_items
        WHERE  SYSDATE BETWEEN NVL(start_date_active, SYSDATE - 1) AND NVL(end_date_active, SYSDATE + 1)
        AND    inventory_item_id = x_sub_item_id_record.substitute_item_id
        AND    organization_id = NVL(x_sub_item_id_record.to_organization_id, organization_id);
Line: 471

        SELECT NVL(MAX(inventory_item_id), 0)
        INTO   x_inventory_item
        FROM   mtl_system_items
        WHERE  inventory_item_id = x_sub_item_id_record.substitute_item_id
        AND    organization_id = NVL(x_sub_item_id_record.to_organization_id, organization_id);
Line: 482

        SELECT NVL(MAX(inventory_item_id), 0)
        INTO   x_inventory_item
        FROM   mtl_system_items
        WHERE  inventory_item_id = x_sub_item_id_record.substitute_item_id
        AND    organization_id = NVL(x_sub_item_id_record.to_organization_id, organization_id)
        AND    purchasing_item_flag = 'Y';
Line: 494

        SELECT NVL(MAX(inventory_item_id), 0)
        INTO   x_inventory_item
        FROM   mtl_system_items
        WHERE  inventory_item_id = x_sub_item_id_record.substitute_item_id
        AND    organization_id = NVL(x_sub_item_id_record.to_organization_id, organization_id)
        AND    purchasing_enabled_flag = 'Y';
Line: 515

        SELECT NVL(MAX(inventory_item_id), 0)
        INTO   x_inventory_item
        FROM   mtl_related_items
        WHERE  inventory_item_id = (SELECT item_id
                                    FROM   po_lines
                                    WHERE  po_line_id = x_sub_item_id_record.po_line_id)
        AND    related_item_id = x_sub_item_id_record.substitute_item_id
        AND    relationship_type_id = 2; -- substitute items
Line: 528

            SELECT NVL(MAX(inventory_item_id), 0)
            INTO   x_inventory_item
            FROM   mtl_related_items
            WHERE  related_item_id = (SELECT item_id
                                      FROM   po_lines
                                      WHERE  po_line_id = x_sub_item_id_record.po_line_id)
            AND    inventory_item_id = x_sub_item_id_record.substitute_item_id
            AND    reciprocal_flag = 'Y'
            AND    relationship_type_id = 2;
Line: 588

        SELECT DECODE(msi.revision_qty_control_code,
                      1, 'N',
                      2, 'Y',
                      'N'
                     )
        INTO   x_revision_control_flag
        FROM   mtl_system_items msi
        WHERE  inventory_item_id = x_item_revision_record.item_id
        AND    organization_id = x_item_revision_record.to_organization_id;
Line: 603

            SELECT NVL(MAX(po_line_id), 0)
            INTO   x_inventory_item
            FROM   po_lines
            WHERE  po_line_id = x_item_revision_record.po_line_id
            AND    NVL(item_revision, x_item_revision_record.item_revision) = x_item_revision_record.item_revision;
Line: 627

        SELECT NVL(MAX(inventory_item_id), 0)
        INTO   x_inventory_item
        FROM   mtl_item_revisions
        WHERE  inventory_item_id = x_item_revision_record.item_id
        AND    organization_id = NVL(x_item_revision_record.to_organization_id, organization_id)
        AND    revision = x_item_revision_record.item_revision;
Line: 641

        SELECT NVL(MAX(inventory_item_id), 0) -- does this accurately check for active revisions??
        INTO   x_inventory_item
        FROM   mtl_item_revisions_org_val_v mir
        WHERE  mir.inventory_item_id = x_item_revision_record.item_id
        AND    mir.organization_id = NVL(x_item_revision_record.to_organization_id, mir.organization_id)
        AND    mir.revision = x_item_revision_record.item_revision;
Line: 655

        SELECT NVL(MAX(po_line_id), 0)
        INTO   x_inventory_item
        FROM   po_lines
        WHERE  po_line_id = x_item_revision_record.po_line_id
        AND    NVL(item_revision, x_item_revision_record.item_revision) = x_item_revision_record.item_revision;
Line: 699

            SELECT NVL(MAX(po_line_id), 0)
            INTO   x_po_line_id
            FROM   po_lines
            WHERE  po_line_id = x_ref_integrity_rec.po_line_id
            AND    vendor_product_num = x_ref_integrity_rec.vendor_item_num;
Line: 717

            SELECT NVL(MAX(vendor_id), 0)
            INTO   x_po_vendor_id
            FROM   po_headers
            WHERE  po_header_id = x_ref_integrity_rec.po_header_id
            AND    vendor_id = x_ref_integrity_rec.vendor_id;
Line: 739

            SELECT NVL(MAX(vendor_site_id), 0)
            INTO   x_po_vendor_site_id
            FROM   po_headers
            WHERE  po_header_id = x_ref_integrity_rec.po_header_id
            AND    vendor_site_id = x_ref_integrity_rec.vendor_site_id;
Line: 752

            SELECT NVL(MAX(vendor_site_id), 0)
            INTO   x_po_vendor_site_id
            FROM   po_headers
            WHERE  po_header_id = x_ref_integrity_rec.po_header_id
            AND    revision_num = x_ref_integrity_rec.po_revision_num;
Line: 796

        SELECT NVL(MAX(freight_code), 'notfound')
        INTO   x_freight_code
        FROM   org_freight_code_val_v
        WHERE  freight_code = x_freight_carrier_record.freight_carrier_code
        AND    organization_id = NVL(x_freight_carrier_record.to_organization_id, organization_id);
Line: 807

        SELECT NVL(MAX(freight_code), 'notfound')
        INTO   x_freight_code
        FROM   org_freight
        WHERE  organization_id = NVL(x_freight_carrier_record.to_organization_id, organization_id)
        AND    freight_code = x_freight_carrier_record.freight_carrier_code
        AND    NVL(disable_date, SYSDATE + 1) > SYSDATE;
Line: 842

        SELECT NVL(MAX(NAME), 'notfound')
        INTO   x_name
        FROM   ap_tax_codes
        WHERE  NAME = x_tax_name_record.tax_name;
Line: 852

        SELECT NVL(MAX(NAME), 'notfound')
        INTO   x_name
        FROM   ap_tax_codes
        WHERE  NAME = x_tax_name_record.tax_name
        AND    NVL(inactive_date, SYSDATE + 1) > SYSDATE;
Line: 897

        SELECT NVL(MAX(supply_agreement_flag), 'N')
        INTO   x_supply_agreement_flag
        FROM   po_headers
        WHERE  po_header_id = x_asl_record.po_header_id
        AND    type_lookup_code = 'BLANKET'
        AND    supply_agreement_flag = 'Y';
Line: 909

            SELECT NVL(MAX('found'), 'notfound')
            INTO   x_success
            FROM   po_approved_supplier_lis_val_v
            WHERE  vendor_id = x_asl_record.vendor_id
            AND    vendor_site_id = x_asl_record.vendor_site_id
            AND    item_id = x_asl_record.item_id
            AND    (   using_organization_id = NVL(x_asl_record.to_organization_id, using_organization_id)
                    OR using_organization_id = -1); -- per discussion with cindy
Line: 948

        x_rtv_update_cum_flag     chv_org_options.rtv_update_cum_flag%TYPE;
Line: 966

        SELECT NVL(MAX(supply_agreement_flag), 'N')
        INTO   x_supply_agreement_flag
        FROM   po_headers
        WHERE  po_header_id = x_cum_quantity_record.po_header_id
        AND    type_lookup_code = 'BLANKET'
        AND    supply_agreement_flag = 'Y';
Line: 978

            SELECT MAX(enable_cum_flag)
            INTO   x_success
            FROM   chv_org_options
            WHERE  organization_id = NVL(x_cum_quantity_record.to_organization_id, organization_id);
Line: 998

        SELECT NVL(MAX(rtv_update_cum_flag), 'N')
        INTO   x_rtv_update_cum_flag
        FROM   chv_org_options
        WHERE  organization_id = x_cum_quantity_record.to_organization_id;
Line: 1004

            asn_debug.put_line('RTV update cum flag ' || x_rtv_update_cum_flag);
Line: 1007

        IF (x_rtv_update_cum_flag = 'Y') THEN
            BEGIN
                IF (g_asn_debug = 'Y') THEN
                    asn_debug.put_line('Org Id ' || TO_CHAR(x_cum_quantity_record.to_organization_id));
Line: 1014

                SELECT cum_period_start_date,
                       cum_period_end_date
                INTO   x_cum_period_start_date,
                       x_cum_period_end_date
                FROM   chv_cum_periods
                WHERE  organization_id = x_cum_quantity_record.to_organization_id
                AND    x_cum_quantity_record.transaction_date BETWEEN cum_period_start_date AND cum_period_end_date;
Line: 1046

                                                        x_rtv_update_cum_flag,
                                                        x_cum_period_start_date,
                                                        x_cum_period_end_date,
                                                        x_cum_quantity_record.primary_unit_of_measure,
                                                        x_qty_received_primary,
                                                        x_qty_received_purchasing
                                                       );
Line: 1112

        SELECT NVL(MAX(pol.lookup_code), 'notfound')
        INTO   x_lookup_code
        FROM   po_lookup_codes pol
        WHERE  pol.lookup_code = x_po_lookup_code_record.lookup_code
        AND    pol.lookup_type = x_po_lookup_code_record.lookup_type;
Line: 1171

        SELECT NVL(MAX(secondary_inventory_name), 'notfound')
        INTO   x_subinventory
        FROM   mtl_secondary_inventories msub,
               mtl_system_items msi
        WHERE  msub.secondary_inventory_name = x_subinventory_record.subinventory
        AND    msub.organization_id = x_subinventory_record.to_organization_id
        AND    x_subinventory_record.transaction_date < NVL(msub.disable_date, x_subinventory_record.transaction_date + 1)
        AND    msi.inventory_item_id = x_subinventory_record.item_id
        AND    msi.organization_id = x_subinventory_record.to_organization_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 = x_subinventory_record.to_organization_id
                               AND    mis.inventory_item_id = x_subinventory_record.item_id
                               AND    mis.secondary_inventory = x_subinventory_record.subinventory)
                   )
               );
Line: 1252

         * exists in hr_locations. Now select from hr_locations_all
         */
        BEGIN
            SELECT location_id
            INTO   x_location
            FROM   hr_locations_all hrl --1942696
            WHERE  (   hrl.inventory_organization_id = x_location_record.to_organization_id
                    OR NVL(hrl.inventory_organization_id, 0) = 0)
            AND    (   hrl.inactive_date IS NULL
                    OR hrl.inactive_date > SYSDATE)
            AND    (hrl.location_id = x_location_record.location_id);
Line: 1266

                    SELECT location_id
                    INTO   x_location
                    FROM   hz_locations hz
                    WHERE  (   hz.address_expiration_date IS NULL
                            OR hz.address_expiration_date > SYSDATE)
                    AND    (hz.location_id = x_location_record.location_id);
Line: 1325

        SELECT NVL(MAX(hre.full_name), 'notfound')
        INTO   x_full_name
        FROM   hr_employees_current_v hre
        WHERE  (   hre.inactive_date IS NULL
                OR hre.inactive_date > SYSDATE)
        AND    hre.employee_id = x_employee_record.employee_id;
Line: 1442

                SELECT NVL(MAX(ml.concatenated_segments), 'notfound')
                INTO   x_locator
                FROM   mtl_item_locations_kfv ml
                WHERE  ml.inventory_location_id = x_locator_record.locator_id
                AND    (   ml.disable_date > SYSDATE
                        OR ml.disable_date IS NULL)
                AND    NVL(ml.subinventory_code, 'z') = NVL(x_locator_record.subinventory, 'z')
                AND    ml.organization_id = x_locator_record.to_organization_id;
Line: 1459

                SELECT NVL(MAX(ml.concatenated_segments), 'notfound')
                INTO   x_locator
                FROM   mtl_item_locations_kfv ml
                WHERE  ml.inventory_location_id = x_locator_record.locator_id
                AND    (   ml.disable_date > SYSDATE
                        OR ml.disable_date IS NULL)
                AND    NVL(ml.subinventory_code, 'z') = NVL(x_locator_record.subinventory, 'z')
                AND    ml.inventory_location_id IN(SELECT secondary_locator
                                                   FROM   mtl_secondary_locators msl
                                                   WHERE  msl.inventory_item_id = x_locator_record.item_id
                                                   AND    msl.organization_id = x_locator_record.to_organization_id
                                                   AND    msl.subinventory_code = x_locator_record.subinventory);
Line: 1541

   SELECT NVL(PROJECT_REFERENCE_ENABLED, 0)
        INTO V_PROJECT_ENABLED
        FROM MTL_PARAMETERS
       WHERE ORGANIZATION_ID = X_LOCATOR_RECORD.TO_ORGANIZATION_ID;
Line: 1566

      SELECT PROJECT_ID, TASK_ID, ORG_ID -- BUG 13709880
        INTO X_PROJECT_ID, X_TASK_ID, L_PJM_VALIDATION_OU_ID -- BUG 13709880
        FROM PO_DISTRIBUTIONS_ALL
       WHERE PO_DISTRIBUTION_ID = X_LOCATOR_RECORD.PO_DISTRIBUTION_ID;
Line: 1653

        SELECT NVL(MAX(territory_code), 'FF')
        INTO   x_code
        FROM   fnd_territories_vl
        WHERE  territory_code = x_country_of_origin_record.country_of_origin_code;
Line: 1690

        SELECT consigned_flag
        INTO   l_consigned_po_flag
        FROM   po_line_locations
        WHERE  line_location_id = x_consigned_po_rec.po_line_location_id;
Line: 1728

        SELECT consigned_consumption_flag
        INTO   l_consumption_po_flag
        FROM   po_headers
        WHERE  po_header_id = x_consumption_po_rec.po_header_id;
Line: 1766

        SELECT consigned_consumption_flag
        INTO   l_consumption_release_flag
        FROM   po_releases
        WHERE  po_release_id = x_consumption_release_rec.po_release_id;
Line: 1867

  SELECT LOT_NUMBER  FROM  mtl_transaction_lots_interface WHERE product_transaction_id=l_transaction_id;
Line: 1871

  SELECT transaction_quantity, LOT_NUMBER ,SECONDARY_TRANSACTION_QUANTITY FROM  mtl_transaction_lots_interface WHERE product_transaction_id=l_transaction_id;
Line: 1931

      SELECT tracking_quantity_ind , secondary_default_ind
         INTO l_TRACKING_QUANTITY_IND ,l_secondary_default_ind
         FROM mtl_system_items_b
         WHERE INVENTORY_ITEM_ID = x_att_rec.inventory_item_id
         AND  ORGANIZATION_ID = x_att_rec.to_organization_id;
Line: 2018

      SELECT   SECONDARY_UOM_CODE
         INTO  l_secondary_uom_code
         FROM  MTL_SYSTEM_ITEMS_B
         WHERE MTL_SYSTEM_ITEMS_B.INVENTORY_ITEM_ID = x_att_rec.inventory_item_id
         AND   MTL_SYSTEM_ITEMS_B.ORGANIZATION_ID = x_att_rec.to_organization_id;
Line: 2046

         Select UNIT_OF_MEASURE
            INTO  x_att_rec.secondary_unit_of_measure
            FROM  mtl_units_of_measure
            WHERE uom_code = x_att_rec.secondary_uom_code;
Line: 2075

      SELECT   SECONDARY_UOM_CODE
         INTO  x_att_rec.secondary_uom_code
         FROM  MTL_SYSTEM_ITEMS_B
         WHERE MTL_SYSTEM_ITEMS_B.INVENTORY_ITEM_ID=x_att_rec.inventory_item_id
         AND   MTL_SYSTEM_ITEMS_B.ORGANIZATION_ID=x_att_rec.to_organization_id;
Line: 2085

      SELECT   UNIT_OF_MEASURE
         INTO  l_secondary_unit_of_measure
         FROM  mtl_units_of_measure
         WHERE uom_code = x_att_rec.secondary_uom_code;
Line: 2133

      SELECT   SECONDARY_UOM_CODE
         INTO  x_att_rec.secondary_uom_code
         FROM  MTL_SYSTEM_ITEMS_B
         WHERE MTL_SYSTEM_ITEMS_B.INVENTORY_ITEM_ID=x_att_rec.inventory_item_id
         AND   MTL_SYSTEM_ITEMS_B.ORGANIZATION_ID=x_att_rec.to_organization_id;
Line: 2143

      Select   UNIT_OF_MEASURE
         INTO  x_att_rec.secondary_unit_of_measure
         FROM  mtl_units_of_measure
         WHERE uom_code = x_att_rec.secondary_uom_code;
Line: 2171

      SELECT   SECONDARY_UOM_CODE
         INTO  l_secondary_uom_code
         FROM  MTL_SYSTEM_ITEMS_B
         WHERE MTL_SYSTEM_ITEMS_B.INVENTORY_ITEM_ID=x_att_rec.inventory_item_id
         AND   MTL_SYSTEM_ITEMS_B.ORGANIZATION_ID=x_att_rec.to_organization_id;
Line: 2203

         SELECT   UNIT_OF_MEASURE
            INTO  l_secondary_unit_of_measure
            FROM  mtl_units_of_measure
            WHERE uom_code = x_att_rec.secondary_uom_code;
Line: 2347

     SELECT 1 INTO l_conv_exist
       FROM   mtl_lot_uom_class_conversions
       WHERE  organization_id = x_att_rec.to_organization_id
       AND    lot_number = lot_rec1.LOT_NUMBER
       AND    inventory_item_id = x_att_rec.inventory_item_id
       AND    FROM_UNIT_OF_MEASURE=X_ATT_REC.transaction_unit_of_measure
       AND    TO_UNIT_OF_MEASURE=x_att_rec.Secondary_UNIT_OF_MEASURE;