DBA Data[Home] [Help]

APPS.IGF_AP_LG_COA_IMP SQL Statements

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

Line: 17

                            p_delete_flag       IN  VARCHAR2 )  IS
/*
||  Created By : masehgal
||  Created On : 28-May-2003
||  Purpose    : Logs all the Input Parameters
||  Known limitations, enhancements or remarks :
||  Change History :
||  Who             When            What
||  (reverse chronological order - newest change first)
*/

  -- cursor to get batch desc for the batch id from igf_ap_li_bat_ints
  CURSOR c_batch_desc(cp_batch_num     igf_aw_li_coa_ints.batch_num%TYPE ) IS
     SELECT batch_desc, batch_type
       FROM igf_ap_li_bat_ints
      WHERE batch_num = cp_batch_num ;
Line: 57

    l_yes_no              := igf_ap_gen.get_lookup_meaning('IGF_AP_YES_NO',p_delete_flag);
Line: 137

      SELECT DISTINCT(NVL(import_record_type,'*')) types
        FROM igf_aw_li_coa_ints
        WHERE ci_alternate_code = cp_alternate_code
          AND batch_num         = cp_batch_num
          AND person_number     = cp_person_number
          AND import_status_type IN ('R','U') ;
Line: 144

    l_update  VARCHAR2(1) ;
Line: 148

     l_update := NULL ;
Line: 154

           l_update := 'U' ;
Line: 160

     IF l_update is NOT NULL and l_others is not null THEN
        p_rec_type := 'E';
Line: 162

     ELSIF l_update is NOT NULL and l_others is null THEN
        p_rec_type := 'U';
Line: 164

     ELSIF l_others is not null and l_update is null THEN
        p_rec_type := 'I';
Line: 166

     ELSIF l_others is  null and l_update is null THEN
        p_rec_type := 'E';
Line: 193

     SELECT DISTINCT item_code
       FROM igf_aw_coa_items
      WHERE base_id = cp_base_id ;
Line: 200

     SELECT COUNT(DISTINCT (ld_sequence_number)) person_terms
       FROM igf_aw_coa_itm_terms
      WHERE base_id  =  cp_base_id ;
Line: 208

     SELECT COUNT(DISTINCT(ld_sequence_number)) coa_terms
       FROM igf_aw_coa_itm_terms
      WHERE base_id   = cp_base_id
        AND item_code = cp_item_code ;
Line: 266

      SELECT 1
        FROM igf_aw_coa_items
       WHERE base_id   = cp_base_id
         AND item_code = cp_item_code ;
Line: 315

      SELECT 1
        FROM igf_aw_coa_itm_terms
       WHERE base_id            = cp_base_id
         AND item_code          = cp_item_code
         AND ld_cal_type        = cp_ld_cal_type
         AND ld_sequence_number = cp_ld_seq_num ;
Line: 346

  PROCEDURE delete_coa_terms ( p_base_id       IN   igf_ap_fa_base_rec_all.base_id%TYPE) IS
  /*
  ||  Created By : masehgal
  ||  Created On : 28-May-2003
  ||  Purpose    : deletion of COA Terms
  ||  Known limitations, enhancements or remarks :
  ||  Change History :
  ||  Who             When            What
  ||  (reverse chronological order - newest change first)
  */

  CURSOR del_coa_terms( cp_base_id       igf_aw_coa_itm_terms.base_id%TYPE)  IS
     SELECT rowid
       FROM igf_aw_coa_itm_terms
      WHERE base_id            = cp_base_id  ;
Line: 366

        igf_aw_coa_itm_terms_pkg.delete_row( x_rowid => lv_rowid.rowid);
Line: 372

          fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_ap_lg_coa_imp.delete_coa_terms.exception','Unhandled exception in Procedure delete_coa_terms'||SQLERRM);
Line: 375

        fnd_message.set_token('NAME','IGF_AP_LG_COA_IMP.DELETE_COA_TERMS');
Line: 379

  END delete_coa_terms ;
Line: 383

  PROCEDURE delete_coa_items ( p_base_id    IN   igf_ap_fa_base_rec_all.base_id%TYPE) IS
  /*
  ||  Created By : masehgal
  ||  Created On : 28-May-2003
  ||  Purpose    : deletion of COA Items
  ||  Known limitations, enhancements or remarks :
  ||  Change History :
  ||  Who             When            What
  ||  (reverse chronological order - newest change first)
  */

  CURSOR del_coa_items( cp_base_id    igf_aw_coa_itm_terms.base_id%TYPE) IS --,
     SELECT rowid
       FROM igf_aw_coa_items
      WHERE base_id   = cp_base_id  ;
Line: 403

        igf_aw_coa_items_pkg.delete_row( x_rowid => lv_rowid.rowid);
Line: 409

          fnd_log.string(fnd_log.level_exception,'igf.plsql.igf_ap_lg_coa_imp.delete_coa_items.exception','Unhandled exception in Procedure delete_coa_items'||SQLERRM);
Line: 412

        fnd_message.set_token('NAME','IGF_AP_LG_COA_IMP.DELETE_COA_ITEMS');
Line: 416

  END delete_coa_items ;
Line: 423

                   p_delete_flag     IN         VARCHAR2 ) IS
  /*
  ||  Created By : masehgal
  ||  Created On : 28-May-2003
  ||  Purpose    : Main - called from submitted request
  ||  Known limitations, enhancements or remarks :
  ||  Change History :
  ||  Who             When            What
  ||  tsailaja		  13/Jan/2006     Bug 4947880 Added invocation of igf_aw_gen.set_org_id(NULL);
Line: 439

    g_skip_item_insert     BOOLEAN  := FALSE ;
Line: 464

    l_recs_deleted         BOOLEAN ;
Line: 477

       SELECT award_year_status_code, sys_award_year
         FROM igf_ap_batch_aw_map   map
        WHERE map.ci_cal_type         = g_ci_cal_type
          AND map.ci_sequence_number  = g_ci_sequence_number ;
Line: 485

       SELECT  batch_num,
               coaint_id,
               ci_alternate_code,
               person_number,
               item_code,
               pell_coa_amt,
               alt_pell_expense_amt,
               NVL(fixed_cost_flag,'N') fixed_cost_flag,
               ld_alternate_code,
               term_amt,
               import_status_type,
               import_record_type
         FROM igf_aw_li_coa_ints
        WHERE ci_alternate_code = cp_alternate_code
          AND batch_num         = cp_batch_num
          AND import_status_type IN ('R','U')
     ORDER BY person_number , item_code, ld_alternate_code;
Line: 508

       SELECT alternate_code
         FROM igs_ca_inst
        WHERE cal_type        = cp_ci_cal_type
          AND sequence_number = cp_ci_sequence_number ;
Line: 515

       SELECT 1
         FROM igf_aw_item
        WHERE item_code = NVL(p_item_code, item_code)
          AND rownum = 1;
Line: 524

       SELECT items.rowid,items.*
         FROM igf_aw_coa_items items
        WHERE base_id   = cp_base_id
          AND item_code = cp_item_code ;
Line: 531

       SELECT cal_type, sequence_number
         FROM igs_ca_inst
        WHERE alternate_code = cp_alternate_code ;
Line: 568

         log_input_params( p_batch_num, l_alternate_code , p_delete_flag);
Line: 650

                     IF l_per_item_count > 0 THEN  -- only if some inserts have happened for the person

                        -- masehgal   latest ...
                        -- as soon as 1 record for a person is marked as error record, we need to skip the whole person
                        -- using person_all_skip flag for the same
                        -- from here  ....
                        IF g_person_all_skip THEN

                           ROLLBACK TO coa_person_recs ;
Line: 661

                           UPDATE igf_aw_li_coa_ints
                              SET import_status_type = 'E'
                            WHERE batch_num     = p_batch_num
                              AND person_number = l_last_person_number ;
Line: 690

                                 UPDATE igf_aw_li_coa_ints
                                    SET import_status_type = 'E'
                                  WHERE batch_num     = p_batch_num
                                    AND person_number = l_last_person_number ;
Line: 722

                  l_recs_deleted := FALSE ;
Line: 775

                  UPDATE igf_aw_li_coa_ints
                     SET import_status_type = 'E'
                   WHERE batch_num = p_batch_num
                     AND person_number = person_rec.person_number ;
Line: 835

                     g_skip_item_insert := TRUE ;
Line: 850

                     g_skip_item_insert := TRUE ;
Line: 858

                     g_skip_item_insert := TRUE ;
Line: 862

                     g_skip_item_insert := FALSE ;
Line: 866

                  IF (NOT l_dup_coa_found) AND (NOT l_recs_deleted) AND l_rec_type = 'U'  THEN

                     -- log a message for duplicate
                     FND_MESSAGE.SET_NAME('IGF','IGF_AP_ORIG_REC_NOT_FOUND');
Line: 879

                     g_skip_item_insert := TRUE ;
Line: 904

                     IF (NOT l_dup_item_found) AND (NOT l_recs_deleted) AND l_rec_type = 'U'  THEN

                        -- log a message for duplicate
                        FND_MESSAGE.SET_NAME('IGF','IGF_AP_ORIG_REC_NOT_FOUND');
Line: 928

                     UPDATE igf_aw_li_coa_ints
                        SET import_status_type = 'E'
                      WHERE coaint_id = person_rec.coaint_id ;
Line: 936

                     IF l_rec_type = 'U' AND (NOT l_recs_deleted) THEN

                        -- records exist
                        -- have to be deleted

                        delete_coa_terms ( l_fa_base_id );
Line: 943

                        delete_coa_items ( l_fa_base_id );
Line: 945

                        l_recs_deleted := TRUE ;
Line: 956

                        IF NOT g_skip_item_insert THEN

                           -- new item ... add item and then add terms
                           l_item_amount := 0 ;
Line: 963

                           igf_aw_coa_items_pkg.insert_row(
                              x_rowid              =>  lv_rowid,
                              x_base_id            =>  l_fa_base_id,
                              x_item_code          =>  person_rec.item_code,
                              x_amount             =>  l_item_amount,
                              x_pell_coa_amount    =>  person_rec.pell_coa_amt,
                              x_alt_pell_amount    =>  person_rec.alt_pell_expense_amt,
                              x_fixed_cost         =>  person_rec.fixed_cost_flag,
                              x_legacy_record_flag => 'Y',
                              x_lock_flag          => 'N',
                              x_mode               =>  'R');
Line: 988

                        END IF ; -- item insertion skip check
Line: 997

                        igf_aw_coa_itm_terms_pkg.insert_row(
                               x_rowid                => lv_term_rowid,
                               x_base_id              => l_fa_base_id,
                               x_item_code            => person_rec.item_code,
                               x_amount               => person_rec.term_amt,
                               x_ld_cal_type          => l_load_cal_type,
                               x_ld_sequence_number   => l_load_seq_num,
                               x_lock_flag            => 'N',
                               x_mode                 => 'R');
Line: 1030

                     igf_aw_coa_items_pkg.update_row (
                            x_rowid                => l_item_rec.rowid,
                            x_base_id              => l_fa_base_id,
                            x_item_code            => l_item_rec.item_code,
                            x_amount               => l_item_amount,
                            x_pell_coa_amount      => l_item_rec.pell_coa_amount,
                            x_alt_pell_amount      => l_item_rec.alt_pell_amount,
                            x_fixed_cost           => l_item_rec.fixed_cost,
                            x_legacy_record_flag   => 'Y',
                            x_lock_flag            => 'N',
                            x_mode                 => 'R' );
Line: 1044

                       fnd_log.string(fnd_log.level_statement,'igf.plsql.igf_ap_lg_coa_imp.main.debug','Inserted COA record in Procedure main');
Line: 1048

                     IF p_delete_flag = 'Y' THEN
                        DELETE FROM igf_aw_li_coa_ints
                         WHERE coaint_id = person_rec.coaint_id ;
Line: 1055

                        UPDATE igf_aw_li_coa_ints
                           SET import_status_type = 'I'
                         WHERE coaint_id = person_rec.coaint_id ;
Line: 1076

            END LOOP ; -- person selection loop
Line: 1083

              IF l_per_item_count > 0 THEN  -- only if some inserts have happened for the person

                 -- masehgal   latest ...
                 -- as soon as 1 record for a person is marked as error record, we need to skip the whole person
                 -- using person_all_skip flag for the same
                 -- from here  ....
                 IF g_person_all_skip THEN

                    ROLLBACK TO coa_person_recs ;
Line: 1094

                    UPDATE igf_aw_li_coa_ints
                       SET import_status_type = 'E'
                     WHERE batch_num     = p_batch_num
                       AND person_number = l_last_person_number ;
Line: 1125

                          UPDATE igf_aw_li_coa_ints
                             SET import_status_type = 'E'
                           WHERE batch_num     = p_batch_num
                             AND person_number = l_last_person_number ;