DBA Data[Home] [Help]

APPS.GME_RESCHEDULE_BATCH_PVT SQL Statements

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

Line: 76

         SELECT status_type
           FROM gmd_status gs, gmd_recipe_validity_rules grvr
          WHERE grvr.recipe_validity_rule_id = v_validity_rule_id
            AND status_code = grvr.validity_rule_status;
Line: 85

         SELECT start_date, end_date
           FROM gmd_recipe_validity_rules
          WHERE recipe_validity_rule_id = v_validity_rule_id;
Line: 93

         SELECT material_detail_id, line_type
           FROM gme_material_details
          WHERE batch_id = v_batch_id;
Line: 99

         SELECT phantom_id, m.material_detail_id, release_type, line_type
               ,i.batchstep_id
           FROM gme_material_details m, gme_batch_step_items i
          WHERE m.batch_id = v_batch_id
            AND NVL (phantom_id, 0) > 0
            AND m.batch_id = i.batch_id(+)
            AND m.material_detail_id = i.material_detail_id(+);
Line: 109

         SELECT plan_start_date
           FROM gme_batch_steps
          WHERE batch_id = v_batch_id AND batchstep_id = v_batchstep_id;
Line: 118

         SELECT batchstep_no, plan_cmplt_date
           FROM gme_batch_steps
          WHERE batch_id = v_batch_id
            AND (plan_cmplt_date + l_diff) > v_plan_cmplt_date;
Line: 126

         SELECT *
           FROM gmd_recipe_validity_rules
          WHERE recipe_validity_rule_id = NVL (p_recipe_validity_rule_id, -1);
Line: 132

         SELECT primary_item_id
           FROM wip_entities
          WHERE wip_entity_id = v_batch_id;
Line: 140

         SELECT   plan_qty, dtl_um
             FROM gme_material_details
            WHERE batch_id = v_batch_id
              AND inventory_item_id = v_item_id
              AND line_type = 1
         ORDER BY line_no ASC;
Line: 151

         SELECT segment1
           FROM mtl_system_items
          WHERE organization_id = p_organization_id
            AND inventory_item_id = p_item_id;
Line: 158

         SELECT 1
           FROM DUAL
          WHERE EXISTS (SELECT 1
                          FROM gme_batch_step_charges
                         WHERE batch_id = v_batch_id);
Line: 300

         gme_debug.put_line ('Delete all the  pending resource transactions');
Line: 304

      IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
         DELETE FROM gme_resource_txns
               WHERE doc_id = x_batch_header_rec.batch_id
                 AND doc_type = l_doc_type
                 AND line_id IN (
                        SELECT batchstep_resource_id
                          FROM gme_batch_step_resources
                         WHERE batch_id = x_batch_header_rec.batch_id
                           AND batchstep_id IN (
                                  SELECT batchstep_id
                                    FROM gme_batch_steps
                                   WHERE batch_id =
                                                   x_batch_header_rec.batch_id
                                     AND step_status = 1) );
Line: 318

         DELETE FROM gme_resource_txns_gtmp
               WHERE doc_id = x_batch_header_rec.batch_id
                 AND doc_type = l_doc_type
                 AND line_id IN (
                        SELECT batchstep_resource_id
                          FROM gme_batch_step_resources
                         WHERE batch_id = x_batch_header_rec.batch_id
                           AND batchstep_id IN (
                                  SELECT batchstep_id
                                    FROM gme_batch_steps
                                   WHERE batch_id =
                                                   x_batch_header_rec.batch_id
                                     AND step_status = 1) );
Line: 422

         SELECT primary_uom_code
           INTO l_prim_item_um
           FROM mtl_system_items
          WHERE inventory_item_id =
                                  l_recipe_validity_rule_rec.inventory_item_id
            AND organization_id = l_batch_header_rec.organization_id;
Line: 669

            gme_debug.put_line ('Update gme_batch_header.');
Line: 672

         UPDATE gme_batch_header
            SET plan_start_date = x_batch_header_rec.plan_start_date
               ,plan_cmplt_date = x_batch_header_rec.plan_cmplt_date
               ,due_date =
                   NVL (x_batch_header_rec.due_date
                       ,x_batch_header_rec.plan_cmplt_date)
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = x_batch_header_rec.batch_id;
Line: 686

                (   ' After update gme_batch_header. Final plan_start_date '
                 || TO_CHAR (x_batch_header_rec.plan_start_date
                            ,'yyyy/mon/dd hh24:mi:ss')
                 || ' Final plan_cmplt_date '
                 || TO_CHAR (x_batch_header_rec.plan_cmplt_date
                            ,'yyyy/mon/dd hh24:mi:ss') );
Line: 698

         SELECT MIN (plan_start_date)
           INTO min_start_date
           FROM gme_batch_steps
          WHERE batch_id = p_batch_header_rec.batch_id;
Line: 725

         SELECT MAX (plan_cmplt_date)
           INTO max_cmplt_date
           FROM gme_batch_steps
          WHERE batch_id = p_batch_header_rec.batch_id;
Line: 774

            UPDATE gme_batch_header
               SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
             WHERE batch_id = x_batch_header_rec.batch_id;
Line: 809

      /*  for the current batch if the update inventory ind is set for the batch  */
      IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
         IF (NVL (g_debug, 0) IN
                       (gme_debug.g_log_statement, gme_debug.g_log_procedure) ) THEN
            gme_debug.put_line
               ('Load all the transactions and resources to the temporary table.');
Line: 831

      END IF;           /* IF x_batch_header_rec.update_inventory_ind = 'Y' */
Line: 879

      /* Now we have to update the transaction dates of pending transactions */
      /* for the material lines which are not of step release type           */
      OPEN cur_get_material (x_batch_header_rec.batch_id);
Line: 902

            SELECT plan_start_date, plan_cmplt_date
            INTO   l_start_date, l_cmplt_date
            FROM   gme_batch_steps
            WHERE  batch_id = x_batch_header_rec.batch_id
              AND  batchstep_id = (SELECT batchstep_id
                                   FROM   gme_batch_step_items
                                   WHERE  batch_id = x_batch_header_rec.batch_id
                                     AND  material_detail_id = l_material_detail_ids(i));
Line: 962

	  R: When reservations are deleted for a material line
	  M: When MO Allocations are deleted for a material line
	  B: When Both reservations and material lines are deleted for a material line
	 */
	 IF x_return_status = 'R' THEN
 	   l_R_count := l_R_count + 1;
Line: 980

       gme_common_pvt.log_message('GME_EXPIRED_RESERV_MO_DELETED');
Line: 983

       gme_common_pvt.log_message('GME_EXPIRED_RESERV_DELETED');
Line: 986

       gme_common_pvt.log_message('GME_EXPIRED_MO_DELETED');
Line: 1013

         UPDATE gme_batch_header
            SET FINITE_SCHEDULED_IND = 0
          WHERE batch_id = x_batch_header_rec.batch_id;
Line: 1020

      /* Update the row who columns */
      x_batch_header_rec.last_update_date := gme_common_pvt.g_timestamp;
Line: 1022

      x_batch_header_rec.last_updated_by := gme_common_pvt.g_user_ident;
Line: 1023

      x_batch_header_rec.last_update_login := gme_common_pvt.g_login_id;
Line: 1100

      This particular procedure is used to update the pending transactions of the material detail
      line passed in to the trans date to the plan_start or completion dates of the batch/
    Parameters

      P_batch_header     Batch Header Row.
      p_date             number possible values = 0 for start date and 1 for end date
      x_return_status    outcome of the API call
                S - Success
                E - Error
                U - Unexpected error
      Revision History
                Rishi Varma bug # 3446787.
                       Added the p_batchstep_id parameter for updating only the steps,actvities,
                       resources,resource transactions.
                       For this modified the sql query to include the condition
                       "AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id)" for
                       steps,activities,resources and resource transactions.
   ***********************************************************************************/
   PROCEDURE truncate_date (
      p_batch_header_rec   IN              gme_batch_header%ROWTYPE
     ,p_date               IN              NUMBER
     ,p_batchstep_id       IN              gme_batch_steps.batchstep_id%TYPE
            DEFAULT NULL
     ,x_return_status      OUT NOCOPY      VARCHAR2)
   IS
      l_api_name   CONSTANT VARCHAR2 (30) := 'UPDATE_TRANSACTION';
Line: 1151

            UPDATE gme_batch_header
               SET plan_start_date = p_batch_header_rec.plan_start_date
                  ,last_updated_by = gme_common_pvt.g_user_ident
                  ,last_update_date = gme_common_pvt.g_timestamp
                  ,last_update_login = gme_common_pvt.g_login_id
             WHERE batch_id = l_batch_id;
Line: 1159

            UPDATE gme_batch_header
               SET plan_cmplt_date = p_batch_header_rec.plan_start_date
                  ,last_updated_by = gme_common_pvt.g_user_ident
                  ,last_update_date = gme_common_pvt.g_timestamp
                  ,last_update_login = gme_common_pvt.g_login_id
             WHERE batch_id = l_batch_id
               AND plan_cmplt_date < p_batch_header_rec.plan_start_date;
Line: 1168

            UPDATE gme_batch_header
               SET due_date = p_batch_header_rec.plan_start_date
                  ,last_updated_by = gme_common_pvt.g_user_ident
                  ,last_update_date = gme_common_pvt.g_timestamp
                  ,last_update_login = gme_common_pvt.g_login_id
             WHERE batch_id = l_batch_id
               AND due_date < p_batch_header_rec.plan_start_date;
Line: 1178

         UPDATE gme_batch_steps
            SET plan_start_date = p_batch_header_rec.plan_start_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = l_batch_id
            AND plan_start_date < p_batch_header_rec.plan_start_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1188

         UPDATE gme_batch_steps
            SET plan_cmplt_date = p_batch_header_rec.plan_start_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = l_batch_id
            AND plan_cmplt_date < p_batch_header_rec.plan_start_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1198

         UPDATE gme_batch_steps
            SET due_date = p_batch_header_rec.plan_start_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = l_batch_id
            AND due_date < p_batch_header_rec.plan_start_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1208

         UPDATE gme_batch_step_activities
            SET plan_start_date = p_batch_header_rec.plan_start_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = l_batch_id
            AND plan_start_date < p_batch_header_rec.plan_start_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1218

         UPDATE gme_batch_step_activities
            SET plan_cmplt_date = p_batch_header_rec.plan_start_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = l_batch_id
            AND plan_cmplt_date < p_batch_header_rec.plan_start_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1228

         UPDATE gme_batch_step_resources
            SET plan_start_date = p_batch_header_rec.plan_start_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = l_batch_id
            AND plan_start_date < p_batch_header_rec.plan_start_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1238

         UPDATE gme_batch_step_resources
            SET plan_cmplt_date = p_batch_header_rec.plan_start_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = l_batch_id
            AND plan_cmplt_date < p_batch_header_rec.plan_start_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1248

         UPDATE gme_resource_txns
            SET start_date = p_batch_header_rec.plan_start_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE doc_id = l_batch_id
            AND doc_type = l_doc_type
            AND start_date < p_batch_header_rec.plan_start_date;
Line: 1258

         UPDATE gme_resource_txns
            SET end_date = p_batch_header_rec.plan_start_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE doc_id = l_batch_id
            AND doc_type = l_doc_type
            AND end_date < p_batch_header_rec.plan_start_date;
Line: 1268

         UPDATE gme_resource_txns
            SET trans_date = p_batch_header_rec.plan_start_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE doc_id = l_batch_id
            AND doc_type = l_doc_type
            AND trans_date < p_batch_header_rec.plan_start_date;
Line: 1279

            UPDATE gme_batch_header
               SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
                  ,last_updated_by = gme_common_pvt.g_user_ident
                  ,last_update_date = gme_common_pvt.g_timestamp
                  ,last_update_login = gme_common_pvt.g_login_id
             WHERE batch_id = l_batch_id;
Line: 1287

            UPDATE gme_batch_header
               SET plan_start_date = p_batch_header_rec.plan_cmplt_date
                  ,last_updated_by = gme_common_pvt.g_user_ident
                  ,last_update_date = gme_common_pvt.g_timestamp
                  ,last_update_login = gme_common_pvt.g_login_id
             WHERE batch_id = l_batch_id
               AND plan_start_date > p_batch_header_rec.plan_cmplt_date;
Line: 1299

            UPDATE gme_batch_header
               SET due_date = p_batch_header_rec.due_date
                  ,last_updated_by = gme_common_pvt.g_user_ident
                  ,last_update_date = gme_common_pvt.g_timestamp
                  ,last_update_login = gme_common_pvt.g_login_id
             WHERE batch_id = l_batch_id
               AND due_date > p_batch_header_rec.plan_cmplt_date;
Line: 1309

         UPDATE gme_batch_steps
            SET plan_start_date = p_batch_header_rec.plan_cmplt_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = l_batch_id
            AND plan_start_date > p_batch_header_rec.plan_cmplt_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1319

         UPDATE gme_batch_steps
            SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = l_batch_id
            AND plan_cmplt_date > p_batch_header_rec.plan_cmplt_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1329

         UPDATE gme_batch_steps
            SET due_date = p_batch_header_rec.plan_cmplt_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = l_batch_id
            AND due_date > p_batch_header_rec.plan_cmplt_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1339

         UPDATE gme_batch_step_activities
            SET plan_start_date = p_batch_header_rec.plan_cmplt_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = l_batch_id
            AND plan_start_date > p_batch_header_rec.plan_cmplt_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1349

         UPDATE gme_batch_step_activities
            SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = l_batch_id
            AND plan_cmplt_date > p_batch_header_rec.plan_cmplt_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1359

         UPDATE gme_batch_step_resources
            SET plan_start_date = p_batch_header_rec.plan_cmplt_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = l_batch_id
            AND plan_start_date > p_batch_header_rec.plan_cmplt_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1369

         UPDATE gme_batch_step_resources
            SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE batch_id = l_batch_id
            AND plan_cmplt_date > p_batch_header_rec.plan_cmplt_date
            AND (p_batchstep_id IS NULL OR batchstep_id = p_batchstep_id);
Line: 1379

         UPDATE gme_resource_txns
            SET start_date = p_batch_header_rec.plan_cmplt_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE doc_id = l_batch_id
            AND doc_type = l_doc_type
            AND start_date > p_batch_header_rec.plan_cmplt_date;
Line: 1389

         UPDATE gme_resource_txns
            SET end_date = p_batch_header_rec.plan_cmplt_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE doc_id = l_batch_id
            AND doc_type = l_doc_type
            AND end_date > p_batch_header_rec.plan_cmplt_date;
Line: 1399

         UPDATE gme_resource_txns
            SET trans_date = p_batch_header_rec.plan_cmplt_date
               ,last_updated_by = gme_common_pvt.g_user_ident
               ,last_update_date = gme_common_pvt.g_timestamp
               ,last_update_login = gme_common_pvt.g_login_id
          WHERE doc_id = l_batch_id
            AND doc_type = l_doc_type
            AND trans_date > p_batch_header_rec.plan_cmplt_date;