DBA Data[Home] [Help]

APPS.GME_BATCHSTEP_RSRC_PVT SQL Statements

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

Line: 7

 * Contents INSERT RESOURCE                                      *
 *          UPDATE RESOURCE                                      *
 *          DELETE RESOURCE                                      *
 *                                                               *
 * Use      This is the private layer of the GME Batch Step      *
 *          Resources.                                           *
 *                                                               *
 * History                                                       *
 *          K.Y.Hunt                                             *
 *          Reworked for Inventory Convergence.   02-APR-2005    *
 * Pawan Kumar 	10-Oct-2005 Bug-4175041		                 *
 * Added the interdependency validation for the resource count   *
 * and resource usage in update_batchstep_resource procedure     *
 *****************************************************************
*/
/*  Global variables   */
   g_pkg_name   CONSTANT VARCHAR2 (30) := 'GME_BATCHSTEP_RSRC_PVT';
Line: 65

         SELECT bh.organization_id, bh.batch_id, bh.batch_type
           FROM gme_batch_header bh, mtl_parameters mp
          WHERE mp.organization_code = v_organization_code
            AND mp.organization_id = bh.organization_id
            AND bh.batch_no = v_batch_no
            AND batch_type = 0;
Line: 74

         SELECT batchstep_id, step_status
           FROM gme_batch_steps
          WHERE batch_id = v_batch_id AND batchstep_no = v_batchstep_no;
Line: 83

         SELECT batchstep_activity_id
           FROM gme_batch_step_activities
          WHERE batchstep_id = v_step_id
            AND batch_id = v_batch_id
            AND activity = v_activity;
Line: 91

         SELECT batchstep_resource_id
           FROM gme_batch_step_resources
          WHERE batchstep_activity_id = v_activity_id
            AND resources = v_resource;
Line: 323

      l_field_updated                BOOLEAN                         := FALSE;
Line: 334

         SELECT a.step_status, a.batch_id, a.step_qty_um
           FROM gme_batch_steps a, gme_batch_step_activities b
          WHERE b.batchstep_activity_id = v_act_id
            AND a.batch_id = b.batch_id
            AND a.batchstep_id = b.batchstep_id;
Line: 342

         SELECT DECODE (v_status
                       ,1, plan_activity_factor
                       ,actual_activity_factor)
               ,plan_start_date, plan_cmplt_date, actual_start_date
               ,actual_cmplt_date
           FROM gme_batch_step_activities
          WHERE batchstep_activity_id = v_activity_id;
Line: 352

         SELECT plan_start_date, plan_cmplt_date
           FROM gme_batch_step_activities
          WHERE batchstep_activity_id = v_activity_id;
Line: 358

         SELECT automatic_step_calculation
           FROM gme_batch_header
          WHERE batch_id = v_batch_id;
Line: 364

         SELECT 1
           FROM cm_cmpt_mst
          WHERE cost_cmpntcls_id = v_cost_cmpntcls_id;
Line: 370

         SELECT 1
           FROM cm_alys_mst
          WHERE cost_analysis_code = v_cost_analysis_code;
Line: 404

      IF p_action = 'INSERT' THEN
         /* Validations for Insert processing */
         --check analysis code
         IF g_debug <= gme_debug.g_log_procedure THEN
            gme_debug.put_line (   g_pkg_name
                                || '.'
                                || l_api_name
                                || ' validate cost analysis code '
                                || p_batchstep_resource_rec.cost_analysis_code);
Line: 899

         /* Additional Validations for action INSERT */
         IF l_batchstep_resource_rec.offset_interval IS NULL THEN
            l_batchstep_resource_rec.offset_interval := 0;
Line: 931

      ELSIF p_action = 'UPDATE' THEN
/* ============================ */
 --NULL;
Line: 997

            l_field_updated := TRUE;
Line: 1027

            l_field_updated := TRUE;
Line: 1046

            l_field_updated := TRUE;
Line: 1065

            l_field_updated := TRUE;
Line: 1098

               l_field_updated := TRUE;
Line: 1127

               l_field_updated := TRUE;
Line: 1132

         /* When the actual resource count is null in the database and we are trying to update actual resource usage without the
         actual resource count, then user will be given error message that actual resource count is required.*/
         ELSE
           IF (l_batchstep_resource_rec.actual_rsrc_count IS NULL AND p_batchstep_resource_rec.actual_rsrc_usage IS NOT NULL) THEN
             gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'actual_rsrc_count');
Line: 1160

               l_field_updated := TRUE;
Line: 1187

               l_field_updated := TRUE;
Line: 1192

         /* When the actual resource count is null in the database and we are trying to update actual resource usage without the
         actual resource count, then user will be given error message that actual resource count is required.*/
         ELSE
           IF (l_batchstep_resource_rec.actual_rsrc_count IS NULL AND p_batchstep_resource_rec.actual_rsrc_usage IS NOT NULL) THEN
             gme_common_pvt.log_message('GME_FIELD_VALUE_REQUIRED','FIELD_NAME', 'actual_rsrc_count');
Line: 1232

               l_field_updated := TRUE;
Line: 1257

               l_field_updated := TRUE;
Line: 1293

               l_field_updated := TRUE;
Line: 1308

               l_field_updated := TRUE;
Line: 1331

                  l_field_updated := TRUE;
Line: 1355

                  l_field_updated := TRUE;
Line: 1390

                  l_field_updated := TRUE;
Line: 1413

                  l_field_updated := TRUE;
Line: 1453

                     l_field_updated := TRUE;
Line: 1487

                     l_field_updated := TRUE;
Line: 1503

                     l_field_updated := TRUE;
Line: 1510

                     l_field_updated := TRUE;
Line: 1590

      insert_batchstep_rsrc
   Description
     Procedure is used to insert rsrc for an activity
   Parameters
     p_batchstep_resource_rec     Input  Row from GME_BATCH_STEP_RESOURCES
     x_batchstep_resource_rec     Output Row from GME_BATCH_STEP_RESOURCES
     x_return_status              reflects return status of the API
=============================================================================================*/
   PROCEDURE insert_batchstep_rsrc (
      p_batchstep_resource_rec   IN              gme_batch_step_resources%ROWTYPE
     ,x_batchstep_resource_rec   OUT NOCOPY      gme_batch_step_resources%ROWTYPE
     ,x_return_status            OUT NOCOPY      VARCHAR2)
   IS
      l_api_name            CONSTANT VARCHAR2 (30) := 'insert_batchstep_rsrc';
Line: 1616

         SELECT max_step_capacity
           FROM gme_batch_steps
          WHERE batchstep_id = v_batchstep_id;
Line: 1622

         SELECT capacity_constraint
           FROM cr_rsrc_mst
          WHERE resources = v_resources;
Line: 1627

      rsrc_insert_failure            EXCEPTION;
Line: 1657

      IF l_batch_header.update_inventory_ind = 'Y' THEN
         gme_trans_engine_util.load_rsrc_trans
                                      (p_batch_row          => l_batch_header
                                      ,x_rsc_row_count      => l_rsrc_trans_count
                                      ,x_return_status      => l_return_status);
Line: 1670

                        ,p_action_code             => 'INSERT'
                        ,p_check_prim_rsrc         => TRUE
                        ,x_step_resources_rec      => l_batchstep_resource_out_rec
                        ,x_return_status           => l_return_status);
Line: 1676

         gme_debug.put_line ('after insert ' || l_return_status);
Line: 1680

         RAISE rsrc_insert_failure;
Line: 1712

            UPDATE gme_batch_steps
               SET max_step_capacity = l_batchstep_resource_rec.max_capacity
                  ,last_update_date = gme_common_pvt.g_timestamp
                  ,last_updated_by = gme_common_pvt.g_user_ident
                  ,last_update_login = gme_common_pvt.g_login_id
             WHERE batchstep_id = l_batchstep_resource_rec.batchstep_id
               AND batch_id = l_batchstep_resource_rec.batch_id;
Line: 1731

      WHEN validation_failure OR rsrc_not_found OR rsrc_insert_failure OR error_condition THEN
         x_return_status := fnd_api.g_ret_sts_error;
Line: 1736

   END insert_batchstep_rsrc;
Line: 1740

      update_batchstep_rsrc
   Description
     Procedure to update resource for an activity
   Parameters
     p_batchstep_resource_rec     Input  Row from GME_BATCH_STEP_RESOURCES
     x_batchstep_resource_rec     Output Row from GME_BATCH_STEP_RESOURCES
     x_return_status              reflects return status of the API
   History
     Inventory Convergence Project - March 2005
=============================================================================================*/
   PROCEDURE update_batchstep_rsrc (
      p_batchstep_resource_rec   IN              gme_batch_step_resources%ROWTYPE
     ,x_batchstep_resource_rec   OUT NOCOPY      gme_batch_step_resources%ROWTYPE
     ,x_return_status            OUT NOCOPY      VARCHAR2)
   IS
      l_api_name            CONSTANT VARCHAR2 (30) := 'update_batchstep_rsrc';
Line: 1767

      l_field_updated                BOOLEAN                         := FALSE;
Line: 1783

         SELECT a.batchstep_id, a.step_status, b.batchstep_activity_id
               ,a.batch_id, b.resources
           FROM gme_batch_steps a, gme_batch_step_resources b
          WHERE b.batchstep_resource_id = v_resource_id
            AND a.batch_id = b.batch_id
            AND a.batchstep_id = b.batchstep_id;
Line: 1792

         SELECT max_step_capacity
           FROM gme_batch_steps;
Line: 1797

         SELECT capacity_constraint
           FROM cr_rsrc_dtl
          WHERE resources = v_resources AND orgn_code = v_orgn_code;
Line: 1803

         SELECT capacity_constraint
           FROM cr_rsrc_mst
          WHERE resources = v_resources;
Line: 1809

         SELECT 1
           FROM gme_batch_header a, gme_batch_step_resources b
          WHERE a.batch_id = b.batch_id
            AND b.batchstep_resource_id = v_rsrc_id
            AND a.batch_type = 10;
Line: 1815

      rsrc_update_failure            EXCEPTION;
Line: 1882

      IF l_batch_header.update_inventory_ind = 'Y' THEN
         gme_trans_engine_util.load_rsrc_trans
                                      (p_batch_row          => l_batch_header
                                      ,x_rsc_row_count      => l_rsrc_trans_count
                                      ,x_return_status      => l_return_status);
Line: 1895

                        ,p_action_code             => 'UPDATE'
                        ,p_check_prim_rsrc         => TRUE
                        ,x_step_resources_rec      => l_batchstep_resource_out_rec
                        ,x_return_status           => l_return_status);
Line: 1905

         RAISE rsrc_update_failure;
Line: 1950

            UPDATE gme_batch_steps
               SET max_step_capacity =
                                     l_batchstep_resource_out_rec.max_capacity
             WHERE batchstep_id = l_batchstep_id AND batch_id = l_batch_id;
Line: 1968

      WHEN rsrc_not_valid OR rsrc_update_failure OR input_param_missing THEN
         x_return_status := fnd_api.g_ret_sts_error;
Line: 1975

   END update_batchstep_rsrc;
Line: 1979

      delete_batchstep_rsrc
   Description
     Procedure to delete batchstep resource
   Parameters
     p_batchstep_resource_rec     batchstep resource row targetted for deletion
     x_return_status              reflects return status of the API
=============================================================================================*/
   PROCEDURE delete_batchstep_rsrc (
      p_batchstep_resource_rec   IN              gme_batch_step_resources%ROWTYPE
     ,x_return_status            OUT NOCOPY      VARCHAR2)
   IS
      l_api_name        CONSTANT VARCHAR2 (30)     := 'delete_batchstep_rsrc';
Line: 2014

      IF l_batch_header.update_inventory_ind = 'Y' THEN
         gme_trans_engine_util.load_rsrc_trans
                                      (p_batch_row          => l_batch_header
                                      ,x_rsc_row_count      => l_rsrc_trans_count
                                      ,x_return_status      => l_return_status);
Line: 2027

                            ,p_action_code             => 'DELETE'
                            ,p_check_prim_rsrc         => TRUE
                            ,x_step_resources_rec      => l_batchstep_resource_rec
                            ,x_return_status           => l_return_status);
Line: 2033

         gme_debug.put_line (   'delete batchsetp resource returns '
                             || l_return_status);
Line: 2053

   END delete_batchstep_rsrc;
Line: 2069

         SELECT plan_start_date, plan_cmplt_date, actual_start_date
               ,actual_cmplt_date
           FROM gme_batch_step_activities
          WHERE batchstep_activity_id = p_batchstep_activity_id;
Line: 2134

         SELECT 1
           FROM gem_lookups
          WHERE lookup_type = p_lookup_type AND lookup_code = p_lookup_code;
Line: 2164

     Move input attribute values into the output record structure prior to validation or update
     processing.
     If p_validate_flexfield is TRUE, just move the value. The validation processing will
     do the rest.
     If flexfield validation is FALSE, then interpret the input values according to these rules
       NULL        means update value not supplied so retain the original (old) value
       G_MISS_???  means update with a NULL value
       NOT NULL    update with the supplied value
   Parameters
     p_new_batchstep_resource_rec   input record with values to be applied as updates
     p_old_batchstep_resource_rec   original record retrieved from the database
     p_validate_flexfield           indicates whethere validation required or not
     x_batchstep_resource_rec       Consolidation of the inputs above
     x_return_status                Return status
=============================================================================================*/
   PROCEDURE consolidate_flexfields (
      p_new_batchstep_resource_rec   IN              gme_batch_step_resources%ROWTYPE
     ,p_old_batchstep_resource_rec   IN              gme_batch_step_resources%ROWTYPE
     ,p_validate_flexfield           IN              VARCHAR2
            DEFAULT fnd_api.g_false
     ,x_batchstep_resource_rec       OUT NOCOPY      gme_batch_step_resources%ROWTYPE
     ,x_return_status                OUT NOCOPY      VARCHAR2)
   IS
      l_api_name        CONSTANT VARCHAR2 (30)    := 'consolidate_flexfields';
Line: 2490

         /* On this basis, retain the new update values                                       */
         l_batchstep_resource_rec.attribute_category :=
                              p_new_batchstep_resource_rec.attribute_category;