DBA Data[Home] [Help]

APPS.GML_OPM_OM_CONV_MIG_PKG SQL Statements

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

Line: 100

l_insert_rsv_rec        inv_reservation_global.mtl_reservation_rec_type; -- Record for inserting reservations
Line: 113

  SELECT header_id,
         line_id,
         inventory_item_id,
         ship_from_org_id,
         schedule_status_code,
         'OE' source,
         ordered_quantity qty -- added for debug only
    FROM oe_order_lines_all ol,
         mtl_parameters mtl
   WHERE ol.ship_from_org_id = mtl.organization_id
     AND mtl.process_enabled_flag = 'Y' AND
         NVL(ol.shipping_interfaced_flag,'N')= 'N'
   UNION ALL
    SELECT wdd.source_header_id,
         wdd.source_line_id,
         wdd.inventory_item_id,
         wdd.organization_id,
         to_char(NULL) schedule_status_code,
         'WDD' source,
         0 qty
    FROM wsh_delivery_details wdd,
          mtl_parameters mtl
   WHERE wdd.organization_id = mtl.organization_id
     AND mtl.process_enabled_flag = 'Y'
     AND wdd.released_status in ('B','R','S', 'X'); -- 5475003 need to include status X for non inv items
Line: 140

  SELECT *
    FROM ic_tran_pnd
   WHERE doc_type = 'OMSO'
     AND line_id = p_line_id
     AND delete_mark = 0
     AND staged_ind = 0
     AND completed_ind = 0
     AND abs(round(trans_qty,5)) > 0
     AND (lot_id >0 OR location <> l_IC$DEFAULT_LOCT);
Line: 151

  SELECT m.lot_divisible_flag,m.lot_control_code,m.tracking_quantity_ind, ic.NONINV_IND  -- 5475003 rework
	FROM mtl_system_items m, ic_item_mst ic                               -- 5475003 rework
	WHERE inventory_item_id = p_item_id and organization_id = p_organization_id
	AND m.segment1 = ic.item_no;  -- 5475003 rework
Line: 157

  SELECT subinventory_ind_flag, organization_id    -- 5574631
    FROM ic_whse_mst
   WHERE whse_code = p_whse_code;
Line: 162

  SELECT locator_id, inventory_location_id   -- 5576431
    FROM ic_loct_mst
   WHERE whse_code = p_whse_code
     AND location = p_location;
Line: 170

  SELECT subinventory_code
  FROM mtl_item_locations
  WHERE inventory_location_id = p_inventory_location_id;
Line: 176

  SELECT lot_no,sublot_no
    FROM ic_lots_mst
   WHERE item_id = p_item_id
     AND lot_id = p_lot_id;
Line: 182

  SELECT *
    FROM ic_txn_request_lines
   WHERE txn_source_line_id = p_line_id
     AND line_status = 7; -- 7 is open , 5 is closed , 9 is cancelled
Line: 188

   SELECT delivery_detail_id
     FROM wsh_delivery_details
    WHERE move_order_line_id = p_mo_line_id
      AND source_line_id = p_line_id;
Line: 194

  SELECT h.*
    FROM ic_txn_request_headers h,
         ic_txn_request_lines l
   WHERE l.header_id = h.header_id
     AND l.line_id = p_line_id;
Line: 201

  SELECT schedule_status_code
    FROM oe_order_lines_all
   WHERE line_id = p_line_id;
Line: 208

	  select distinct wda.delivery_id
	  from   wsh_delivery_details wdd,
	         wsh_new_deliveries wnd,
	         wsh_delivery_assignments wda
	  where  wdd.source_line_id = p_line_id
	  and    wdd.delivery_detail_id = wda.delivery_detail_id
	  and    wda.delivery_id = wnd.delivery_id
	  and    wnd.delivery_id is not null;
Line: 219

  SELECT default_stage_locator_id, pick_grouping_rule_id
    FROM wsh_shipping_parameters
   WHERE organization_id = p_org_id;
Line: 225

  select sales_order_id
  from oe_order_headers_all oe, mtl_sales_orders mtl
  where oe.header_id = p_header_id and mtl.segment1 = oe.order_number;
Line: 274

                l_insert_rsv_rec.reservation_id             := NULL; -- cannot know
Line: 275

                l_insert_rsv_rec.requirement_date           := SYSDATE;
Line: 276

                l_insert_rsv_rec.organization_id            := open_order_line_rec.ship_from_org_id;
Line: 277

                l_insert_rsv_rec.inventory_item_id          := open_order_line_rec.inventory_item_id;
Line: 278

                l_insert_rsv_rec.demand_source_type_id      := 2; /* For the Sales Order line */
Line: 279

                l_insert_rsv_rec.demand_source_name         := NULL;
Line: 280

                l_insert_rsv_rec.demand_source_header_id    := allocations_for_line_rec.doc_id; --open_order_line_rec.header_id;
Line: 281

                l_insert_rsv_rec.demand_source_line_id      := open_order_line_rec.line_id;
Line: 282

                l_insert_rsv_rec.demand_source_delivery     := NULL;
Line: 283

                l_insert_rsv_rec.primary_uom_code           := l_primary_uom_code;
Line: 286

                   l_insert_rsv_rec.secondary_uom_code         := l_secondary_uom_code;
Line: 289

                l_insert_rsv_rec.primary_uom_id             := NULL;
Line: 290

                l_insert_rsv_rec.secondary_uom_id           := NULL;
Line: 291

                l_insert_rsv_rec.reservation_uom_code       := NULL;
Line: 292

                l_insert_rsv_rec.reservation_uom_id         := NULL;
Line: 293

                l_insert_rsv_rec.reservation_quantity       := NULL;
Line: 295

                l_insert_rsv_rec.primary_reservation_quantity  := abs(trunc(allocations_for_line_rec.trans_qty,5)); -- 5616998
Line: 298

                   l_insert_rsv_rec.secondary_reservation_quantity:= abs(trunc(allocations_for_line_rec.trans_qty2,5)); -- 5616998
Line: 300

                   l_insert_rsv_rec.secondary_reservation_quantity := NULL; -- need to initialize this back else will fail
Line: 304

                l_insert_rsv_rec.autodetail_group_id           := NULL;
Line: 305

                l_insert_rsv_rec.external_source_code          := NULL;
Line: 306

                l_insert_rsv_rec.external_source_line_id       := NULL;
Line: 307

                l_insert_rsv_rec.supply_source_type_id         := inv_reservation_global.g_source_type_inv;
Line: 308

                l_insert_rsv_rec.supply_source_header_id       := NULL;
Line: 309

                l_insert_rsv_rec.supply_source_line_id         := NULL;
Line: 310

                l_insert_rsv_rec.supply_source_name            := NULL;
Line: 311

                l_insert_rsv_rec.supply_source_line_detail     := NULL;
Line: 312

                l_insert_rsv_rec.revision                      := NULL;
Line: 328

		                -- 1 update the SO line with new org (open_order_line_rec.ship_from_org_id) ;
Line: 329

		                -- 2 update any delivery details with new org;
Line: 330

		                -- 3 update wsh_new_deliveries  (trips do NOT store orgs) with the new org (all because of GMD's requirements);
Line: 332

		                -- 5 update any mo lines with new org id   -- 5731584

		                /* need to update the SO line with new org (open_order_line_rec.ship_from_org_id)  */
		               	 GMI_RESERVATION_UTIL.PrintLn(' before update to ship_from_org_id of so line '|| open_order_line_rec.line_id);
Line: 337

		               	 UPDATE oe_order_lines_all
		               	 SET  ship_from_org_id = l_organization_id
		               	 WHERE line_id = open_order_line_rec.line_id;
Line: 342

		                 -- update any OPM mo lines with new org id so that new id will be used for migration down below -- 5731584
		                  -- 5731584 start

		                 UPDATE ic_txn_request_lines
		               	 SET  organization_id = l_organization_id
		               	 WHERE txn_source_line_id = open_order_line_rec.line_id
		               	 AND line_status = 7;
Line: 387

		                 /* possibly multiple delivery details are updated */
			       	update wsh_delivery_details
					set organization_id = l_organization_id
					where source_line_id = open_order_line_rec.line_id;
Line: 393

				GMI_RESERVATION_UTIL.PrintLn(' after update to wsh_delivery_details for organization_id  '|| l_organization_id);
Line: 394

				/* update the deliveries to reflect the new organization */

				FOR wsh1 in c_wsh_deliveres (open_order_line_rec.line_id)
				LOOP
				 GMI_RESERVATION_UTIL.PrintLn(' before update to wsh_delivery_details for organization_id  '|| l_organization_id);
Line: 400

				 update wsh_new_deliveries
	         		 set organization_id = l_organization_id
		       		 where delivery_id = wsh1.delivery_id;
Line: 407

		                 l_insert_rsv_rec.organization_id            := l_organization_id;
Line: 414

                GMI_RESERVATION_UTIL.PrintLn('primary_reservation_quantity ' || l_insert_rsv_rec.primary_reservation_quantity );
Line: 416

                l_insert_rsv_rec.subinventory_id            := NULL;
Line: 488

                    l_insert_rsv_rec.locator_id := l_locator_id;
Line: 494

                    l_insert_rsv_rec.subinventory_code := l_subinventory_code;
Line: 498

                    l_insert_rsv_rec.locator_id             := NULL;
Line: 499

                    l_insert_rsv_rec.subinventory_code      := NULL;
Line: 503

								GMI_RESERVATION_UTIL.Println('locator_id is '|| l_insert_rsv_rec.locator_id);
Line: 569

                 l_insert_rsv_rec.lot_number                    := l_odm_lot_num;
Line: 570

                 l_insert_rsv_rec.lot_number_id                 := NULL;
Line: 571

                 l_insert_rsv_rec.pick_slip_number              := NULL;
Line: 572

                 l_insert_rsv_rec.lpn_id                        := NULL;
Line: 573

                 l_insert_rsv_rec.attribute_category            := NULL;
Line: 574

                 l_insert_rsv_rec.attribute1                    := NULL;
Line: 575

                 l_insert_rsv_rec.attribute2                    := NULL;
Line: 576

                 l_insert_rsv_rec.attribute3                    := NULL;
Line: 577

          			 l_insert_rsv_rec.attribute4                    := NULL;
Line: 578

                 l_insert_rsv_rec.attribute5                    := NULL;
Line: 579

                 l_insert_rsv_rec.attribute6                    := NULL;
Line: 580

                 l_insert_rsv_rec.attribute7                    := NULL;
Line: 581

                 l_insert_rsv_rec.attribute8                    := NULL;
Line: 582

                 l_insert_rsv_rec.attribute9                    := NULL;
Line: 583

                 l_insert_rsv_rec.attribute10                   := NULL;
Line: 584

                 l_insert_rsv_rec.attribute11                   := NULL;
Line: 585

                 l_insert_rsv_rec.attribute12                   := NULL;
Line: 586

                 l_insert_rsv_rec.attribute13                   := NULL;
Line: 587

                 l_insert_rsv_rec.attribute14                   := NULL;
Line: 588

                 l_insert_rsv_rec.attribute15                   := NULL;
Line: 589

                 l_insert_rsv_rec.ship_ready_flag               := 2;
Line: 590

                 l_insert_rsv_rec.detailed_quantity             := 0;
Line: 593

              inv_reservation_pvt.print_rsv_rec(l_insert_rsv_rec);
Line: 604

            		, p_rsv_rec                    => l_insert_rsv_rec
            		, p_serial_number              => l_dummy_sn
            		, x_serial_number              => l_dummy_sn
            		, p_partial_reservation_flag   => fnd_api.g_true
            		, p_force_reservation_flag     => fnd_api.g_false
            		, p_validation_flag            => 'Q'
            		, x_quantity_reserved          => l_qty_reserved
            		, x_secondary_quantity_reserved=> l_sec_qty_reserved
            		, x_reservation_id             => l_reservation_id
            		);
Line: 637

								-- insert more comprehensive data into gma log table.

								 	   GMA_COMMON_LOGGING.gma_migration_central_log (
									                p_run_id          => p_migration_run_id,
											p_log_level       => FND_LOG.LEVEL_ERROR,
											p_message_token   => 'GMI_UNEXPECTED_ERROR',
											p_table_name      => 'IC_TRAN_PND',
											p_context         => 'CREATE RESERVATION',
											p_param1          => INV_GMI_Migration.item(allocations_for_line_rec.item_id),
											p_param2          => INV_GMI_Migration.lot(allocations_for_line_rec.lot_id),
											p_param3          => allocations_for_line_rec.whse_code,
											p_param4          => l_insert_rsv_rec.subinventory_code,
											p_param5          => l_insert_rsv_rec.locator_id,
											p_db_error        => NULL,
											p_app_short_name  => 'GMI');
Line: 759

               l_trohdr_rec.last_updated_by            := FND_GLOBAL.user_id;
Line: 760

               l_trohdr_rec.last_update_date           := sysdate;
Line: 761

               l_trohdr_rec.last_update_login          := FND_GLOBAL.login_id;
Line: 807

								-- insert more comprehensive data into gma log table.

								 	   GMA_COMMON_LOGGING.gma_migration_central_log (
											p_run_id          => p_migration_run_id,
											p_log_level       => FND_LOG.LEVEL_ERROR,
											p_message_token   => 'INV_ERROR_CREATING_MO',
											p_table_name      => 'mtl_txn_request_headers',
											p_context         => 'Create_move_order_header',
											p_param1          => l_ic_mo_header_rec.request_number,
											p_param2          => l_ic_mo_header_rec.organization_id,
											p_param3          => NULL,
											p_param4          => NULL,
											p_param5          => NULL,
											p_db_error        => NULL,
											p_app_short_name  => 'INV');
Line: 830

                      /* Update attribute15 in ic_txn_request_headers */
			                GMI_RESERVATION_UTIL.PrintLn(' before update to attribute15 of in ic_txn_request_headers: '||to_char(l_trohdr_rec.header_id));
Line: 833

			                UPDATE ic_txn_request_headers
			                SET  attribute15 = to_char(l_trohdr_rec.header_id)
			                WHERE header_id = l_ic_mo_header_rec.header_id;
Line: 837

			                GMI_RESERVATION_UTIL.PrintLn(' after update to attribute15 of in ic_txn_request_headers');
Line: 899

               l_trolin_tbl(l_order_count).last_updated_by    := FND_GLOBAL.USER_ID;
Line: 900

   	       l_trolin_tbl(l_order_count).last_update_date   := sysdate;
Line: 901

               l_trolin_tbl(l_order_count).last_update_login  := FND_GLOBAL.LOGIN_ID;
Line: 965

								-- insert more comprehensive data into gma log table.

								 	   GMA_COMMON_LOGGING.gma_migration_central_log (
											p_run_id          => p_migration_run_id,
											p_log_level       => FND_LOG.LEVEL_ERROR,
											p_message_token   => 'INV_ERROR_CREATING_MO',
											p_table_name      => 'mtl_txn_request_lines',
											p_context         => 'Create_Move_Order_Lines',
											p_param1          => l_mo_header_id,
											p_param2          => move_order_line_rec.inventory_item_id,
											p_param3          => open_order_line_rec.line_id,
											p_param4          => NULL,
											p_param5          => NULL,
											p_db_error        => NULL,
											p_app_short_name  => 'INV');
Line: 987

                   /* Update OPM move order line attribute15 */

                 l_mo_line_id := l_trolin_tbl(l_order_count).line_id;
Line: 991

                 GMI_RESERVATION_UTIL.PrintLn(' before update of ic_txn_request_lines to attribute15 to line: '||to_char(l_mo_line_id));
Line: 993

                 UPDATE ic_txn_request_lines
                    SET attribute15 = to_char(l_trolin_tbl(l_order_count).line_id)
                  WHERE  line_id = move_order_line_rec.line_id;
Line: 997

                 GMI_RESERVATION_UTIL.PrintLn(' after update to ic_txn_request_lines to attribute15 to line: '||to_char(l_mo_line_id));
Line: 1004

                 UPDATE mtl_txn_request_lines
                    SET to_locator_id = l_to_locator_id
                  WHERE  line_id = l_line_id;
Line: 1008

                 GMI_RESERVATION_UTIL.PrintLn(' locator_id updated to :- ' ||  l_to_locator_id);
Line: 1022

               /* UPDATE the WSH_DELIVERY_DETAILS with this new move order info */
                 GMI_RESERVATION_UTIL.PrintLn(' before update of wsh_delivery_detail for move order line id');
Line: 1029

                  GMI_RESERVATION_UTIL.PrintLn(' in loop to update wsh_delivery_detail delivery_detail_rec.delivery_detail_id '||to_char(delivery_detail_rec.delivery_detail_id));
Line: 1030

                  GMI_RESERVATION_UTIL.PrintLn(' in loop to update wsh_delivery_detail old ic_txn_request_lines line_id  '||to_char(move_order_line_rec.line_id));
Line: 1031

                  GMI_RESERVATION_UTIL.PrintLn(' in loop to update wsh_delivery_detail open_order_line_rec.line_id '||to_char(open_order_line_rec.line_id));
Line: 1032

                  GMI_RESERVATION_UTIL.PrintLn(' in loop to update wsh_delivery_detail l_opm_noninv_ind  '||to_char(l_opm_noninv_ind ));
Line: 1036

                  UPDATE wsh_delivery_details
                     SET released_status = 'Y', -- 5475003
                     picked_quantity = move_order_line_rec.quantity, -- 5475003
                     picked_quantity2 = move_order_line_rec.secondary_quantity       -- 5475003
                   WHERE delivery_detail_id = delivery_detail_rec.delivery_detail_id;
Line: 1043

                  UPDATE wsh_delivery_details
                     SET move_order_line_id  = l_mo_line_id
                    WHERE delivery_detail_id = delivery_detail_rec.delivery_detail_id;
Line: 1050

                  GMI_RESERVATION_UTIL.PrintLn(' in loop after update');