DBA Data[Home] [Help]

APPS.GME_CLOSE_BATCH_PVT SQL Statements

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

Line: 82

      batch_hist_insert_err      EXCEPTION;
Line: 106

         SELECT phantom_id
           FROM gme_material_details d, gme_batch_header h
          WHERE d.batch_id = x_batch_header_rec.batch_id
            AND phantom_id IS NOT NULL
            AND h.batch_id = d.phantom_id
            AND h.batch_status <> 4;
Line: 115

         SELECT material_detail_id
                  FROM gme_material_details
                 WHERE batch_id = v_batch_id
         FOR UPDATE OF actual_qty NOWAIT;
Line: 122

         SELECT COUNT (*)
           FROM gme_batch_steps
          WHERE step_status < 4 AND batch_id = x_batch_header_rec.batch_id;
Line: 129

        SELECT *
          FROM gme_material_details
         WHERE batch_id = v_batch_id
           AND line_type = 1;
Line: 162

      IF p_batch_header_rec.delete_mark = 1 THEN
         RAISE marked_for_deletion;
Line: 169

        gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Invoking delete_prod_supply_resv for batch header' );
Line: 173

      gme_supply_res_pvt.delete_batch_prod_supply_resv (
          p_batch_header_rec     => l_batch_header_rec
         ,x_msg_count            => l_message_count
         ,x_msg_data             => l_message_list
         ,x_return_status        => x_return_status);
Line: 223

         DELETE FROM mtl_txn_request_lines l
            WHERE organization_id = x_batch_header_rec.organization_id
              AND transaction_source_type_id = gme_common_pvt.g_txn_source_type
              AND txn_source_id = x_batch_header_rec.batch_id
              AND txn_source_line_id = l_material_details_tab(i).material_detail_id
              AND line_status = 7
              AND NOT EXISTS (SELECT 1
                              FROM mtl_txn_request_headers mtrh
                              WHERE mtrh.header_id = l.header_id)
              AND NOT EXISTS (SELECT 1
                              FROM mtl_material_transactions_temp mmtt
                              where l.line_id = mmtt.move_order_line_id);
Line: 239

      IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
         IF (g_debug <= gme_debug.g_log_procedure) THEN
            gme_debug.put_line (   g_pkg_name
                                || '.'
                                || l_api_name
                                || ':'
                                || 'calling purge exceptions for batch_id='
                                || x_batch_header_rec.batch_id);
Line: 253

                                ,p_delete_reservations      => 'T'
                                ,x_return_status            => x_return_status);
Line: 262

      UPDATE MTL_TXN_REQUEST_Lines
      SET line_status = 5
      WHERE line_id in
        (SELECT mtrl.line_id
         FROM MTL_TXN_REQUEST_Lines mtrl, mtl_txn_request_headers mtrh
         WHERE mtrl.TRANSACTION_SOURCE_TYPE_ID = 5
         AND mtrl.LINE_STATUS = 7
         AND mtrl.LPN_ID IS NOT NULL
         AND mtrh.header_id = mtrl.header_id
         AND mtrh.ORGANIZATION_ID = mtrl.organization_id
         AND mtrl.txn_source_id = x_batch_header_rec.batch_id
         AND mtrl.ORGANIZATION_ID = x_batch_header_rec.organization_id
         AND mtrh.MOVE_ORDER_TYPE = 6);
Line: 293

         gme_debug.put_line ('Calling Batch Header DBL.Update Row ');
Line: 299

      /* Update the batch step to the database */
      IF NOT (gme_batch_header_dbl.update_row (x_batch_header_rec) ) THEN
         RAISE batch_header_upd_err;
Line: 304

      /* Insert the event into the batch history table */
      IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
         IF g_debug <= gme_debug.g_log_procedure THEN
            gme_debug.put_line ('Calling Create History.');
Line: 313

            RAISE batch_hist_insert_err;
Line: 316

      RAISE BATCH_HIST_INSERT_ERR;
Line: 348

         /* Now update the batch step status to close */
         gme_close_batch_pvt.fetch_batch_steps (x_batch_header_rec.batch_id
                                               ,NULL
                                               ,l_batch_steps_tab
                                               ,l_return_status);
Line: 377

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

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

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

            IF NOT gme_material_details_dbl.update_row(l_product_rec) THEN
              RAISE MATERIAL_DETAIL_UPD_ERR;
Line: 470

      WHEN batch_hist_insert_err THEN
         x_return_status := fnd_api.g_ret_sts_error;
Line: 483

            gme_debug.put_line ('Terminating due to error deleteing reservations against this batch supply.');
Line: 536

      IF NOT (gme_batch_history_dbl.insert_row (l_ins_history, l_ins_history) ) THEN
         RETURN FALSE;
Line: 566

         SELECT step_close_date
           FROM gme_batch_steps
          WHERE batch_id IN (
                            SELECT DISTINCT batch_id
                                       FROM gme_material_details
                                 START WITH batch_id =
                                                  p_batch_header_rec.batch_id
                                 CONNECT BY batch_id = PRIOR phantom_id)
            AND NVL (step_close_date, p_batch_header_rec.batch_close_date) >
                                           p_batch_header_rec.batch_close_date;
Line: 579

         SELECT DISTINCT batch_id
                    FROM gme_material_details
              START WITH batch_id = v_batch_id
              CONNECT BY batch_id = PRIOR phantom_id;
Line: 597

         SELECT trans_date
           FROM gme_resource_txns_gtmp
          WHERE doc_type = 'PROD'
            AND doc_id = v_batch_id
            AND completed_ind = 1
            AND delete_mark = 0
            AND action_code NOT IN ('DEL', 'REVS', 'REVL')
            AND NVL (trans_date, p_batch_header_rec.batch_close_date) >
                                           p_batch_header_rec.batch_close_date
             AND ROWNUM = 1;
Line: 610

         SELECT trans_date
           FROM gme_inventory_txns_gtmp
          WHERE doc_type = 'PROD'
            AND doc_id = v_batch_id
            AND completed_ind = 1
            AND transaction_no <> 2
            AND action_code NOT IN ('DELP', 'DELC')
            AND NVL (trans_date, p_batch_header_rec.batch_close_date) >
                                           p_batch_header_rec.batch_close_date; */
Line: 623

        SELECT material_detail_id
        from gme_material_details
        WHERE batch_id = v_batch_id;
Line: 631

      SELECT transaction_date
           FROM mtl_material_transactions mmt
          WHERE trx_source_line_id = v_mat_det_id
            AND transaction_source_id = v_batch_id
            AND transaction_source_type_id = v_txn_source_type
            AND NOT EXISTS ( SELECT /*+ no_unnest */
                        transaction_id1
                     FROM gme_transaction_pairs
                    WHERE transaction_id1 = mmt.transaction_id
                      AND pair_type = v_pairs_reversal_type)
          AND NVL (transaction_date, p_batch_header_rec.batch_close_date) >
                                           p_batch_header_rec.batch_close_date
          AND ROWNUM = 1;
Line: 648

         SELECT actual_cmplt_date
           FROM gme_batch_header
          WHERE batch_id IN (
                             SELECT DISTINCT batch_id
                                        FROM gme_material_details
                                  START WITH batch_id =
                                                   p_batch_header_rec.batch_id
                                  CONNECT BY batch_id = PRIOR phantom_id)
            AND NVL (actual_cmplt_date, p_batch_header_rec.batch_close_date) >
                                           p_batch_header_rec.batch_close_date;
Line: 676

      IF (p_batch_header_rec.update_inventory_ind = 'Y') THEN
         OPEN cur_get_batches (p_batch_header_rec.batch_id);
Line: 782

         SELECT routing_id
           FROM gme_batch_header
          WHERE batch_id = v_batch_id;
Line: 788

         SELECT     d.dep_step_id
               FROM gme_batch_step_dependencies d
              WHERE d.batch_id = v_batch_id
         START WITH (     (d.batch_id = v_batch_id)
                     AND (    (v_batchstep_id IS NULL)
                          OR (batchstep_id = v_batchstep_id) ) )
         CONNECT BY d.batch_id = PRIOR d.batch_id
                AND d.batchstep_id = PRIOR d.dep_step_id
           GROUP BY d.dep_step_id
           ORDER BY MAX (LEVEL) DESC;
Line: 801

         SELECT *
           FROM gme_batch_steps
          WHERE batch_id = v_batch_id AND batchstep_id = v_step_id;
Line: 807

         SELECT   *
             FROM gme_batch_steps s
            WHERE s.batch_id = v_batch_id
              AND s.batchstep_id NOT IN (SELECT dep_step_id
                                           FROM gme_batch_step_dependencies
                                          WHERE batch_id = v_batch_id)
         ORDER BY batchstep_no;