DBA Data[Home] [Help]

APPS.ARP_CORRECT_CCID SQL Statements

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

Line: 77

  /* based upon parameters coming in, we have to update specific tables
     to correct the CCID.   The tables will be determined by several
     Columns */

     /* if we are dealing with GL DIST Records */
     IF (p_source_table = 'GLD') THEN

        /* update the distribution record */
        UPDATE  RA_CUST_TRX_LINE_GL_DIST
           SET code_combination_id = nvl(p_new_ccid, code_combination_id),
               last_update_date = SYSDATE,
               last_updated_by = arp_global.last_updated_by,
               last_update_login = arp_global.last_update_login
         WHERE
               cust_trx_line_gl_dist_id = p_distribution_id
           AND code_combination_id = p_old_ccid;
Line: 97

        /* we need to update ar_distributions */

        update AR_DISTRIBUTIONS
           SET code_combination_id = NVL( p_new_ccid, code_combination_id),
               last_update_date = sysdate,
               last_updated_by = arp_global.last_updated_by,
               last_update_login = arp_global.last_update_login
         WHERE code_combination_id = p_old_ccid
               and line_id = p_distribution_id;
Line: 108

            /* We need to update the parent record if the distribution
               type is ADJ  */

           update AR_ADJUSTMENTS
              SET code_combination_id = NVL(p_new_ccid, code_combination_id),
                  last_update_date = sysdate,
                  last_updated_by = arp_global.last_updated_by,
                  last_update_login = arp_global.last_update_login
            WHERE adjustment_id = p_parent_id
            AND code_combination_id = p_old_ccid;
Line: 121

           UPDATE AR_MISC_CASH_DISTRIBUTIONS
           SET  code_combination_id = NVL(p_new_ccid, code_combination_id),
                last_update_date = SYSDATE,
                last_updated_by = arp_global.last_updated_by,
                last_update_login = arp_global.last_update_login
           where misc_cash_distribution_id = p_parent_id
             and code_combination_id = p_old_ccid;
Line: 131

          UPDATE AR_CASH_RECEIPT_HISTORY
             SET  account_code_combination_id = NVL(p_new_ccid,
                                                account_code_combination_id),
                  last_update_date = SYSDATE,
                  last_updated_by = arp_global.last_updated_by,
                  last_update_login = arp_global.last_update_login
           WHERE  account_code_combination_id = p_old_ccid
             AND  cash_Receipt_history_id = p_parent_id
             AND  current_record_flag = 'Y';
Line: 143

    /* delete from the interim table */
    DELETE FROM AR_CCID_CORRECTIONS
    WHERE code_combination_id = p_old_ccid
      AND distribution_type = p_dist_type
      AND category_type = p_category_type
      AND distribution_id = p_distribution_id
      AND source_table = p_source_table
      AND submission_id IS NULL;
Line: 167

 | PUBLIC PROCEDURE lock_and_update
 |
 | DESCRIPTION
 |      This procedure will take an invalid CCID and lock and update all
 |      rows in the ar_ccid_corrections table.
 |
 | CALLED FROM PROCEDURES/FUNCTIONS (local to this package body)
 |      This is called from the form ARXGLCOR.fmb
 |
 | CALLS PROCEDURES/FUNCTIONS (local to this package body)
 |
 | PARAMETERS
 |      p_old_ccid      IN  OLD CCID
 |      p_new_ccid_id   IN  NEW CCID to be replaced.
 |
 | KNOWN ISSUES
 |      none
 |
 | NOTES
 |
 | MODIFICATION HISTORY
 | Date                  Author            Description of Changes
 | 17-Nov-2003           Debbie Sue Jancis Created
 *=======================================================================*/
PROCEDURE lock_and_update ( p_old_ccid       IN  NUMBER,
                            p_new_ccid       IN  NUMBER,
                            p_category_type  IN  VARCHAR2,
                            p_dist_type      IN VARCHAR2,
                            p_seq_id         IN NUMBER) IS

  l_status_code  CONSTANT VARCHAR2(20) := 'IN_PROGRESS';
Line: 201

      arp_standard.debug(' ARP_CORRECT_CCID.lock_and_update()+');
Line: 213

   Update AR_CCID_CORRECTIONS
     set NEW_CODE_COMBINATION_ID = p_new_ccid,
         submission_id = p_seq_id
   WHERE
        code_combination_id = p_old_ccid and
        distribution_type = p_dist_type and
        category_type = p_category_type;
Line: 222

      arp_standard.debug(' ARP_CORRECT_CCID.lock_and_update()-');
Line: 229

        arp_standard.debug('EXCEPTION: ARP_CORRECT_CCID.lock_and_update()');
Line: 233

END lock_and_update;
Line: 278

   UPDATE RA_CUST_TRX_LINE_GL_DIST gld
   SET last_update_date = SYSDATE,
       last_updated_by = arp_global.last_updated_by,
       last_update_login = arp_global.last_update_login,
       code_combination_id = (
     SELECT nvl(new_code_combination_id, code_combination_id)
     FROM   ar_ccid_corrections acc
     WHERE  acc.submission_id = p_submission_id
     AND    acc.source_table = 'GLD'
     AND    acc.distribution_type = gld.account_class
     AND    acc.distribution_id   = gld.cust_trx_line_gl_dist_id)
   WHERE  gld.cust_trx_line_gl_dist_id in (
     SELECT distribution_id
     FROM   ar_ccid_corrections
     WHERE  submission_id = p_submission_id
     AND    source_table = 'GLD');
Line: 296

      arp_standard.debug(' ra_cust_trx_line_gl_dist rows updated: ' ||
              SQL%ROWCOUNT);
Line: 301

   UPDATE AR_DISTRIBUTIONS ard
   SET  last_update_date = SYSDATE,
        last_updated_by = arp_global.last_updated_by,
        last_update_login = arp_global.last_update_login,
        code_combination_id = (
     SELECT nvl(new_code_combination_id, code_combination_id)
     FROM   ar_ccid_corrections acc
     WHERE  acc.submission_id = p_submission_id
     AND    acc.distribution_id = ard.line_id
     AND    acc.source_table = ard.source_table
     AND    acc.distribution_type = ard.source_type)
   WHERE  ard.line_id in (
     SELECT distribution_id
     FROM   ar_ccid_corrections
     WHERE  submission_id = p_submission_id
     AND    source_table IN ('ADJ','CRH','RA','MCD','TH'));
Line: 319

      arp_standard.debug(' ar_distribution rows updated: ' ||
              SQL%ROWCOUNT);
Line: 324

   UPDATE AR_ADJUSTMENTS adj
   SET      last_update_date = SYSDATE,
            last_updated_by = arp_global.last_updated_by,
            last_update_login = arp_global.last_update_login,
            code_combination_id = (
     SELECT nvl(new_code_combination_id, code_combination_id)
     FROM   ar_ccid_corrections acc
     WHERE  acc.submission_id = p_submission_id
     AND    acc.source_table = 'ADJ'
     AND    acc.distribution_type = 'ADJ'
     AND    acc.parent_id = adj.adjustment_id)
   WHERE adj.adjustment_id in (
     SELECT parent_id
     FROM   ar_ccid_corrections
     WHERE  submission_id = p_submission_id
     AND    source_table = 'ADJ'
     AND    distribution_type = 'ADJ');
Line: 343

      arp_standard.debug('   ar_adjustments rows updated: ' ||
              SQL%ROWCOUNT);
Line: 348

   UPDATE AR_CASH_RECEIPT_HISTORY crh
   SET      last_update_date = SYSDATE,
            last_updated_by = arp_global.last_updated_by,
            last_update_login = arp_global.last_update_login,
            account_code_combination_id = (
     SELECT nvl(new_code_combination_id, account_code_combination_id)
     FROM   ar_ccid_corrections acc
     WHERE  acc.submission_id = p_submission_id
     AND    acc.source_table = 'CRH'
     AND    acc.distribution_type = 'CASH'
     AND    acc.parent_id = crh.cash_receipt_history_id)
   WHERE crh.cash_receipt_history_id in (
     SELECT parent_id
     FROM   ar_ccid_corrections
     WHERE  submission_id = p_submission_id
     AND    source_table = 'CRH'
     AND    distribution_type = 'CASH');
Line: 367

      arp_standard.debug('   ar_cash_receipt_history rows updated: ' ||
              SQL%ROWCOUNT);
Line: 372

   UPDATE AR_MISC_CASH_DISTRIBUTIONS mcd
   SET      last_update_date = SYSDATE,
            last_updated_by = arp_global.last_updated_by,
            last_update_login = arp_global.last_update_login,
            code_combination_id = (
     SELECT nvl(new_code_combination_id, code_combination_id)
     FROM   ar_ccid_corrections acc
     WHERE  acc.submission_id = p_submission_id
     AND    acc.source_table = 'MCD'
     AND    acc.distribution_type = 'MISCCASH'
     AND    acc.parent_id = mcd.misc_cash_distribution_id)
   WHERE misc_cash_distribution_id in (
     SELECT parent_id
     FROM   ar_ccid_corrections
     WHERE  submission_id = p_submission_id
     AND    source_table = 'MCD'
     AND    distribution_type = 'MISCCASH');
Line: 391

      arp_standard.debug('   ar_misc_cash_distributions rows updated: ' ||
              SQL%ROWCOUNT);