DBA Data[Home] [Help]

APPS.WSH_DELIVERY_DETAILS_UTILITIES SQL Statements

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

Line: 100

  l_sc_SELECT            VARCHAR2(2000);
Line: 117

  SELECT t.id, d.ignore_for_planning
  FROM wsh_tmp            t,
       wsh_new_deliveries d
  WHERE d.delivery_id = t.id
  AND NOT EXISTS (
      SELECT /*+ no_unnest */ WDA.delivery_detail_id
      FROM wsh_delivery_assignments_v WDA,
           wsh_delivery_details       WDD
      WHERE WDA.delivery_detail_id = WDD.delivery_detail_id
      AND WDA.delivery_id = t.id
      AND WDA.delivery_id is not NULL
      AND WDD.source_code <> 'OE'
      AND wdd.container_flag = 'N')
  AND NOT EXISTS (
      -- deliveries in consolidations are ineligible
      SELECT 1
      FROM WSH_DELIVERY_LEGS WDL
      WHERE WDL.delivery_id = t.id
      AND   WDL.parent_delivery_leg_id IS NOT NULL
  )
  ORDER BY d.creation_date;
Line: 144

  l_tms_update              VARCHAR2(1);
Line: 179

   l_cc_in_ids.delete;
Line: 197

      l_sc_SELECT                                 := NULL;
Line: 219

      l_cc_line_groups.delete;
Line: 254

         l_cc_group_ids.delete;
Line: 323

       l_group_info.delete;
Line: 324

       l_attr_tab.delete;
Line: 370

            l_details_in_cc_group.delete;
Line: 437

            l_tms_update := 'N';
Line: 512

                       WSH_NEW_DELIVERIES_PVT.C_TMS_DELETE_REQUIRED,
                       WSH_NEW_DELIVERIES_PVT.C_TMS_DELETE_IN_PROCESS,
                       WSH_NEW_DELIVERIES_PVT.C_TMS_UPDATE_REQUIRED)) THEN
                    l_tms_update := 'Y';
Line: 517

                    l_new_interface_flag_tab(1) := WSH_NEW_DELIVERIES_PVT.C_TMS_UPDATE_REQUIRED;
Line: 593

                           p_line_rows.delete(j);
Line: 617

                      WSH_DEBUG_SV.log(l_module_name, 'l_tms_update', l_tms_update);
Line: 618

                      IF (l_tms_update = 'Y') THEN
                        WSH_DEBUG_SV.log(l_module_name, 'l_new_interface_flag_tab', l_new_interface_flag_tab(1));
Line: 625

                  UPDATE wsh_new_deliveries
                  SET    intmed_ship_to_location_id = NVL(intmed_ship_to_location_id,l_attr_tab(1).intmed_ship_to_location_id),
                         fob_code                   = NVL(fob_code,l_attr_tab(1).fob_code),
                         freight_terms_code         = NVL(freight_terms_code,l_attr_tab(1).freight_terms_code),
                         ship_method_code           = NVL(ship_method_code,l_attr_tab(1).ship_method_code),
                         carrier_id                 = NVL(carrier_id,l_attr_tab(1).carrier_id),
                         initial_pickup_date        = least(initial_pickup_date, l_date_scheduled),
                         -- bug 2466054 - switch between date_scheduled and date_requested
                         ultimate_dropoff_date      = greatest(least(initial_pickup_date, l_date_scheduled),
                                                               least(ultimate_dropoff_date,l_date_requested)),
                         service_level              = NVL(service_level,l_attr_tab(1).service_level),
                         mode_of_transport          = NVL(mode_of_transport,l_attr_tab(1).mode_of_transport),
                         source_header_id           = NVL(source_header_id, l_attr_tab(1).source_header_id),
                         last_update_date           = SYSDATE,
                         last_updated_by            = FND_GLOBAL.user_id,
                         last_update_login          = FND_GLOBAL.login_id,
                         -- OTM R12
                         TMS_INTERFACE_FLAG = decode(l_tms_update, 'Y', l_new_interface_flag_tab(1), nvl(TMS_INTERFACE_FLAG, WSH_NEW_DELIVERIES_PVT.C_TMS_NOT_TO_BE_SENT)),
                         TMS_VERSION_NUMBER = decode(l_tms_update, 'Y', l_tms_version_number, nvl(tms_version_number, 1))
                         -- End of OTM R12
                  WHERE  delivery_id = l_delivery_id;
Line: 648

                  IF (l_gc3_is_installed = 'Y' AND l_tms_update = 'Y') THEN
                    WSH_XC_UTIL.LOG_OTM_EXCEPTION(
                                p_delivery_info_tab      => l_delivery_info_tab,
                                p_new_interface_flag_tab => l_new_interface_flag_tab,
                                x_return_status          => l_otm_return_status);
Line: 669

                        l_cc_group_ids.delete(i);
Line: 734

                           p_line_rows.delete(j);
Line: 745

                           l_details_in_cc_group.delete(k);
Line: 767

                      WSH_DEBUG_SV.log(l_module_name, 'l_tms_update', l_tms_update);
Line: 768

                      IF (l_tms_update = 'Y') THEN
                        WSH_DEBUG_SV.log(l_module_name, 'l_new_interface_flag_tab', l_new_interface_flag_tab(1));
Line: 775

                  UPDATE wsh_new_deliveries
                  SET    intmed_ship_to_location_id = NVL(intmed_ship_to_location_id,l_attr_tab(1).intmed_ship_to_location_id),
                         fob_code                   = NVL(fob_code,l_attr_tab(1).fob_code),
                         freight_terms_code         = NVL(freight_terms_code,l_attr_tab(1).freight_terms_code),
                         ship_method_code           = NVL(ship_method_code,l_attr_tab(1).ship_method_code),
                         carrier_id                 = NVL(carrier_id,l_attr_tab(1).carrier_id),
                         initial_pickup_date        = least(initial_pickup_date,l_date_scheduled),
                         -- bug 2466054 - switch between date_scheduled and date_requested
                         ultimate_dropoff_date      = greatest(least(initial_pickup_date,l_date_scheduled),
                                                               least(ultimate_dropoff_date,l_date_requested)),
                         service_level              = NVL(service_level,l_attr_tab(1).service_level),
                         mode_of_transport          = NVL(mode_of_transport,l_attr_tab(1).mode_of_transport),
                         source_header_id           = NVL(source_header_id, l_attr_tab(1).source_header_id),
                         last_update_date           = SYSDATE,
                         last_updated_by            = FND_GLOBAL.user_id,
                         last_update_login          = FND_GLOBAL.login_id,
                         -- OTM R12
                         TMS_INTERFACE_FLAG = decode(l_tms_update, 'Y', l_new_interface_flag_tab(1), nvl(TMS_INTERFACE_FLAG, WSH_NEW_DELIVERIES_PVT.C_TMS_NOT_TO_BE_SENT)),
                         TMS_VERSION_NUMBER = decode(l_tms_update, 'Y', l_tms_version_number, nvl(tms_version_number, 1))
                         -- End of OTM R12
                  WHERE  delivery_id = l_delivery_id;
Line: 798

                  IF (l_gc3_is_installed = 'Y' AND l_tms_update = 'Y') THEN
                    WSH_XC_UTIL.LOG_OTM_EXCEPTION(
                                p_delivery_info_tab      => l_delivery_info_tab,
                                p_new_interface_flag_tab => l_new_interface_flag_tab,
                                x_return_status          => l_otm_return_status);
Line: 826

                        l_cc_group_ids.delete(i);
Line: 847

                     p_line_rows.delete(i);
Line: 857

                     l_cc_group_ids.delete(i);
Line: 901

                  p_line_rows.delete(j);
Line: 906

            l_cc_group_ids.delete(i);
Line: 1026

  SELECT   wdd.delivery_detail_id,
           wdd.ship_to_location_id,
           wdd.ship_from_location_id,
           wdd.customer_id,
           wdd.intmed_ship_to_location_id,
           wdd.fob_code,
           wdd.freight_terms_code,
           wdd.ship_method_code,
           wdd.carrier_id,
           wdd.source_header_id,
           wdd.deliver_to_location_id,
           wdd.organization_id,
           wdd.date_scheduled,
           wdd.date_requested,
           wdd.released_status,
           wdd.container_flag,
           wdd.shipping_control,
           wdd.party_id,
           wdd.line_direction,
           wdd.inventory_item_id,
           wdd.source_code,
           wdd.lpn_id,
           wsp.appending_limit,
	   wdd.ignore_for_planning --bugfix 7164767
  FROM     wsh_delivery_details wdd,
           wsh_delivery_assignments_v wda,
           wsh_shipping_parameters  wsp
  WHERE    wdd.delivery_detail_id = c_detail_id
           AND wda.delivery_detail_id = wdd.delivery_detail_id
           AND wda.delivery_id is NULL
           AND NVL(wdd.line_direction, 'O') in ('O', 'IO')
           AND wdd.source_code = 'OE'
           AND wdd.container_flag = 'N'
           AND wsp.organization_id   = wdd.organization_id;
Line: 1105

    x_unappended_det_tbl.delete;  -- unappended list
Line: 1106

    x_appended_det_tbl.delete;    -- successfully appended list
Line: 1107

    x_appended_del_tbl.delete;    -- appended deliveries
Line: 1147

          l_detail_info.delete(l_index);
Line: 1155

             select delivery_detail_id into l_delivery_detail_id from wsh_delivery_details where
             delivery_detail_id = p_delivery_detail_tbl(l_index) for update nowait;
Line: 1160

             l_detail_info.delete(l_index);
Line: 1183

         l_unassigned_rows.delete;
Line: 1331

PROCEDURE Check_Updates_Allowed(
          p_changed_attributes IN  WSH_INTERFACE.ChangedAttributeTabType,
          p_source_code        IN  VARCHAR2,
          x_update_allowed     OUT NOCOPY  VARCHAR2,
          x_return_status      OUT NOCOPY  VARCHAR2)
IS
   CURSOR c_del_details ( c_source_line_id IN NUMBER )
   IS
   select organization_id,
          src_requested_quantity,
          src_requested_quantity_uom,
          requested_quantity,
          requested_quantity_uom,
          inventory_item_id
   from   wsh_delivery_details
   where  source_code= p_source_code
   and    released_status not in ( 'D', 'C' )
   and    shipment_batch_id is not null
   and    source_line_id = c_source_line_id
   and    rownum = 1;
Line: 1354

   select nvl(sum(requested_quantity), 0)
   from   wsh_delivery_details
   where  source_code = p_source_code
   and    released_status in ( 'R', 'X', 'B' ) -- Check with klr
   and    source_line_id = c_source_line_id
   and    shipment_batch_id is null
   and    shipment_line_number is null;
Line: 1372

   wsh_update_not_allowed   EXCEPTION;
Line: 1378

   l_module_name CONSTANT   VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'Check_Updates_Allowed';
Line: 1460

                     raise wsh_update_not_allowed;
Line: 1523

                     raise wsh_update_not_allowed;
Line: 1538

   x_update_allowed := 'Y';
Line: 1542

      WSH_DEBUG_SV.log(l_module_name, 'x_update_allowed', x_update_allowed);
Line: 1548

   WHEN wsh_update_not_allowed THEN
      x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR;
Line: 1550

      FND_MESSAGE.SET_NAME('WSH', 'WSH_UPDATE_NOT_ALLOWED');
Line: 1552

      x_update_allowed := 'N';
Line: 1559

          WSH_DEBUG_SV.pop(l_module_name,'EXCEPTION:wsh_update_not_allowed');
Line: 1564

      x_update_allowed := 'N';
Line: 1588

END Check_Updates_Allowed;
Line: 1610

   select wdd.*
   from   wsh_delivery_details     wdd
   where  wdd.source_line_id = c_line_id
   and    wdd.source_code = 'OE'
   and    wdd.released_status not in ( 'D', 'C' )
   and    wdd.shipment_batch_id is not null
   and    wdd.shipment_line_number is not null
   and    rownum = 1;