DBA Data[Home] [Help]

APPS.PAY_US_USER_CITY_UPGRADE_PKG SQL Statements

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

Line: 25

   SELECT DECODE(count(0),0,'N','Y')
     INTO l_upgrade_needed
     FROM pay_us_geo_update pugu,
          pay_patch_status pps
    WHERE pps.patch_name = 'USER_CITY_UPGRADE'
      AND pps.phase = 'TO_BE_UPDATED'
      AND pps.process_type = 'USER_CITY_UPGRADE'
      AND pps.legislation_code = 'US'
      AND pps.id = pugu.id
      AND pugu.process_date = pps.applied_date
      AND pugu.process_type = pps.process_type
      AND pugu.process_mode = pps.phase;
Line: 52

       SELECT pay_us_geo_upd_pkg.get_parameter('MODE',ppa.legislative_parameters)
         INTO l_mode
         FROM pay_payroll_actions ppa
        WHERE ppa.payroll_action_id = pactid;
Line: 57

       SELECT pay_patch_status_s.NEXTVAL
         INTO l_id FROM dual;
Line: 64

       INSERT INTO pay_patch_status
             (id,
              patch_number,
              patch_name,
              phase,
              process_type,
              applied_date,
              status,
              description,
              legislation_code)
       VALUES(l_id,
              '1111111',
              l_patch_name,
              'UPDATED',
              'USER_CITY_UPGRADE',
              l_applied_date,
              'P',
              l_mode,
              'US');
Line: 84

       INSERT INTO pay_us_modified_geocodes
             (city_name,
              state_code,
              county_code,
              new_city_code,
              old_city_code,
              primary_flag,
              process_type,
              patch_name,
              new_county_code)
         SELECT substr(pugu.description,3),
                substr(pugu.old_juri_code,1,2),
                substr(pugu.old_juri_code,4,3),
                substr(pugu.new_juri_code,8,4),
                substr(pugu.old_juri_code,8,4),
                'N',
                'D',
                l_patch_name,
                NULL
           FROM pay_us_geo_update pugu,
                pay_patch_status pps
          WHERE pps.patch_name = 'USER_CITY_UPGRADE'
            AND pps.phase = 'TO_BE_UPDATED'
            AND pps.process_type = 'USER_CITY_UPGRADE'
            AND pps.legislation_code = 'US'
            AND pps.id = pugu.id
            AND pugu.process_date = pps.applied_date
            AND pugu.process_type = pps.process_type
            AND pugu.process_mode = pps.phase
            AND NOT EXISTS
                 (SELECT NULL
                    FROM pay_us_modified_geocodes pumg
                   WHERE pumg.city_name = substr(pugu.description,3)
                     AND pumg.state_code = substr(pugu.old_juri_code,1,2)
                     AND pumg.county_code = substr(pugu.old_juri_code,4,3)
                     AND pumg.new_city_code = substr(pugu.new_juri_code,8,4)
                     AND pumg.old_city_code = substr(pugu.old_juri_code,8,4)
                     AND pumg.process_type = 'D'
                     AND pumg.patch_name = l_patch_name);
Line: 127

     sqlstr := ' SELECT DISTINCT paf.person_id
                   FROM per_all_assignments_f paf,
                        pay_us_emp_city_tax_rules_f pect,
                        pay_us_geo_update pugu,
                        pay_patch_status pps
                  WHERE pect.assignment_id = paf.assignment_id
                    AND substr(pugu.old_juri_code,1,2) = pect.state_code
                    AND substr(pugu.old_juri_code,4,3) =  pect.county_code
                    AND substr(pugu.old_juri_code,8,4) =  pect.city_code
                    AND :pactid IS NOT NULL
                    AND pugu.id = pps.id
                    AND pugu.process_date = pps.applied_date
                    AND pugu.process_type = pps.process_type
                    AND pugu.process_mode = pps.phase
                    AND pps.patch_name = ''USER_CITY_UPGRADE''
                    AND pps.phase = ''TO_BE_UPDATED''
                    AND pps.legislation_code = ''US''
                    AND pps.process_type = ''USER_CITY_UPGRADE''
                ORDER BY paf.person_id';
Line: 155

     sqlstr := ' SELECT distinct paf.person_id
                   FROM per_all_assignments_f paf
                  WHERE 1=2
                    AND :pactid IS NOT NULL';
Line: 187

  SELECT DISTINCT ectr.assignment_id
   FROM   per_all_assignments_f paf,
          pay_us_emp_city_tax_rules_f ectr,
          pay_us_geo_update pugu,
          pay_patch_status pps
   WHERE  pps.patch_name = 'USER_CITY_UPGRADE'
     AND  pps.phase = 'TO_BE_UPDATED'
     AND  pps.process_type = 'USER_CITY_UPGRADE'
     AND  pps.legislation_code = 'US'
     AND  pps.id = pugu.id
     AND  pugu.process_date = pps.applied_date
     AND  pugu.process_type = pps.process_type
     AND  pugu.process_mode = pps.phase
     AND  ectr.state_code = substr(pugu.old_juri_code,1,2)
     AND  ectr.county_code = substr(pugu.old_juri_code,4,3)
     AND  ectr.city_code = substr(pugu.old_juri_code,8,4)
     AND  ectr.assignment_id = paf.assignment_id
     AND  paf.person_id BETWEEN p_stperson AND p_endperson
    ORDER BY ectr.assignment_id;
Line: 226

         SELECT pay_assignment_actions_s.nextval
           INTO l_assignment_action_id
           FROM DUAL;
Line: 262

      SELECT paa.payroll_action_id,
             paa.object_id
        FROM pay_temp_object_actions  paa
       WHERE paa.object_action_id = p_assignment_action_id;
Line: 268

      SELECT pps.id,pps.patch_name
        FROM pay_patch_status pps
       WHERE pps.patch_name LIKE 'USER_CITY_UPGRADE%'
         AND pps.legislation_code = 'US'
         AND pps.status = 'P'
         AND pps.description = p_mode
         AND NOT EXISTS
             (SELECT NULL
                FROM pay_patch_status pps1
               WHERE pps1.id > pps.id
                 AND pps1.patch_name LIKE 'USER_CITY_UPGRADE%'
                 AND pps.legislation_code = 'US')
      ORDER BY pps.id DESC;
Line: 283

    SELECT pay_us_geo_upd_pkg.get_parameter('MODE',PPa.legislative_parameters)
      FROM pay_payroll_actions ppa
     WHERE ppa.payroll_action_id = p_payroll_action_id;
Line: 337

   SELECT COUNT(0)
     FROM (SELECT DISTINCT assignment_id
             FROM pay_us_geo_update pugu
            WHERE pugu.id = p_id
              AND pugu.process_type = p_process_type
              AND pugu.process_mode = p_mode
              AND pugu.table_name is null
              AND pugu.table_value_id is null
              AND DECODE(pugu.status,'C','C','E')
                     = DECODE(p_status,'ALL',DECODE(pugu.status,'C','C','E'),p_status));
Line: 349

    SELECT pay_us_geo_upd_pkg.get_parameter('MODE',PPa.legislative_parameters)
      FROM pay_payroll_actions ppa
     WHERE ppa.payroll_action_id = p_payroll_action_id;
Line: 353

   CURSOR get_user_city_update_details IS
    SELECT pugu.old_juri_code,
           pugu.new_juri_code,
           substr(pugu.description,3) city_name,
           substr(pugu.description,1,1) primary_flag
      FROM pay_us_geo_update pugu,
           pay_patch_status pps
     WHERE pps.patch_name = 'USER_CITY_UPGRADE'
       AND pps.phase = 'TO_BE_UPDATED'
       AND pps.process_type = 'USER_CITY_UPGRADE'
       AND pps.legislation_code = 'US'
       AND pps.id = pugu.id
       AND pugu.process_date = pps.applied_date
       AND pugu.process_type = pps.process_type
       AND pugu.process_mode = pps.phase;
Line: 372

   l_process_type                pay_us_geo_update.process_type%TYPE;
Line: 377

   l_assignments_to_be_updated   NUMBER;
Line: 378

   l_old_juri_code               pay_us_geo_update.old_juri_code%TYPE;
Line: 379

   l_new_juri_code               pay_us_geo_update.new_juri_code%TYPE;
Line: 395

   SELECT DECODE(count(0),0,'N','Y')
     INTO l_upgrade_needed
     FROM pay_us_geo_update pugu,
          pay_patch_status pps
    WHERE pps.patch_name = 'USER_CITY_UPGRADE'
      AND pps.phase = 'TO_BE_UPDATED'
      AND pps.process_type = 'USER_CITY_UPGRADE'
      AND pps.legislation_code = 'US'
      AND pps.id = pugu.id
      AND pugu.process_date = pps.applied_date
      AND pugu.process_type = pps.process_type
      AND pugu.process_mode = pps.phase;
Line: 410

      SELECT id,applied_date
        INTO l_id,l_applied_date
        FROM pay_patch_status pps
       WHERE pps.patch_name LIKE 'USER_CITY_UPGRADE%'
         AND pps.legislation_code = 'US'
         AND pps.status = 'P'
         AND pps.description = l_mode
         AND NOT EXISTS
              (SELECT NULL
                 FROM pay_patch_status pps1
                WHERE pps1.id > pps.id
                  AND pps1.patch_name LIKE 'USER_CITY_UPGRADE%'
                  AND pps1.legislation_code = 'US');
Line: 428

        UPDATE pay_patch_status
           SET status = 'C'
         WHERE legislation_code = 'US'
           AND id = l_id
           AND status = 'P'
           AND description = l_mode;
Line: 456

        SELECT count(DISTINCT paf.assignment_id)
          INTO l_assignments_to_be_updated
          FROM per_all_assignments_f paf,
               pay_us_emp_city_tax_rules_f pect,
               pay_us_geo_update pugu,
               pay_patch_status pps
         WHERE pect.assignment_id = paf.assignment_id
           AND substr(pugu.old_juri_code,1,2) = pect.state_code
           AND substr(pugu.old_juri_code,4,3) =  pect.county_code
           AND substr(pugu.old_juri_code,8,4) =  pect.city_code
           AND pugu.id = pps.id
           AND pugu.process_date = pps.applied_date
           AND pugu.process_type = pps.process_type
           AND pugu.process_mode = pps.phase
           AND pps.patch_name = 'USER_CITY_UPGRADE'
           AND pps.phase = 'TO_BE_UPDATED'
           AND pps.legislation_code = 'US'
           AND pps.process_type = 'USER_CITY_UPGRADE';
Line: 476

         AND l_assignments_to_be_updated = 0
         AND l_error_assignments = 0 THEN

            OPEN get_user_city_update_details;
Line: 480

            FETCH get_user_city_update_details
             INTO l_old_juri_code,l_new_juri_code,l_city_name,l_primary_flag;
Line: 483

            WHILE (get_user_city_update_details%FOUND)
            LOOP

              /*Update the City Code and Primary Flag as shipped by Oracle*/

              UPDATE pay_us_city_names
                 SET city_code = substr(l_new_juri_code,8,4),
                     primary_flag = l_primary_flag
               WHERE state_code = substr(l_old_juri_code,1,2)
                 AND county_code = substr(l_old_juri_code,4,3)
                 AND city_code = substr(l_old_juri_code,8,4)
                 AND city_name = l_city_name;
Line: 502

              DELETE FROM pay_us_zip_codes puzc
               WHERE state_code = substr(l_old_juri_code,1,2)
                 AND county_code = substr(l_old_juri_code,4,3)
                 AND city_code = substr(l_old_juri_code,8,4)
                 AND EXISTS
                     ( SELECT NULL
                         FROM pay_us_zip_codes puzc1
                        WHERE puzc1.state_code = puzc.state_code
                          AND puzc1.county_code = puzc.county_code
                          AND puzc1.city_code = substr(l_new_juri_code,8,4)
                          AND puzc1.zip_start <= puzc.zip_start
                          AND puzc1.zip_end >= puzc.zip_end);
Line: 515

              UPDATE pay_us_zip_codes
                 SET city_code = substr(l_new_juri_code,8,4)
               WHERE state_code = substr(l_old_juri_code,1,2)
                 AND county_code = substr(l_old_juri_code,4,3)
                 AND city_code = substr(l_old_juri_code,8,4);
Line: 521

              /*Below delete statement was executed earlier. But need to execute
                this again as User might have created a Zip Code which overlaps
                the Oracle delivered Zip Codes.
                For Example, User maintained 20000-20050. Oracle delivered 20000-20010.
                Earlier delete statement was used to delete records from User Maintained
                Zip Codes. 20000-20050 will not be deleted. Now as the zip codes are
                merged, the below statement will remove the 20000-20010*/

              DELETE FROM pay_us_zip_codes puzc
               WHERE state_code = substr(l_new_juri_code,1,2)
                 AND county_code = substr(l_new_juri_code,4,3)
                 AND city_code = substr(l_new_juri_code,8,4)
                 AND EXISTS
                     ( SELECT NULL
                         FROM pay_us_zip_codes puzc1
                        WHERE puzc1.state_code = puzc.state_code
                          AND puzc1.county_code = puzc.county_code
                          AND puzc1.city_code = puzc.city_code
                          AND puzc1.zip_start <= puzc.zip_start
                          AND puzc1.zip_end >= puzc.zip_end
                          AND puzc1.rowid <> puzc.rowid);
Line: 545

              UPDATE pay_us_zip_codes puzc
                 SET zip_start = (SELECT LPAD(TO_CHAR(MAX(puzc2.zip_end) + 1),5,'0')
                                    FROM pay_us_zip_codes puzc2
                                   WHERE puzc2.state_code = puzc.state_code
                                     AND puzc2.county_code = puzc.county_code
                                     AND puzc2.city_code = puzc.city_code
                                     AND puzc2.zip_start < puzc.zip_start
                                     AND puzc2.zip_end < puzc.zip_end
                                     AND puzc2.zip_end >= puzc.zip_start)
               WHERE state_code = substr(l_new_juri_code,1,2)
                 AND county_code = substr(l_new_juri_code,4,3)
                 AND city_code = substr(l_new_juri_code,8,4)
                 AND EXISTS
                     ( SELECT NULL
                         FROM pay_us_zip_codes puzc1
                        WHERE puzc1.state_code = puzc.state_code
                          AND puzc1.county_code = puzc.county_code
                          AND puzc1.city_code = puzc.city_code
                          AND puzc1.zip_start < puzc.zip_start
                          AND puzc1.zip_end < puzc.zip_end
                          AND puzc1.zip_end >= puzc.zip_start);
Line: 567

              FETCH get_user_city_update_details
               INTO l_old_juri_code,l_new_juri_code,l_city_name,l_primary_flag;
Line: 572

            CLOSE get_user_city_update_details;
Line: 574

            UPDATE pay_us_geo_update pugu
               SET process_mode = 'UPDATED'
             WHERE EXISTS
                 (SELECT NULL
                    FROM pay_patch_status pps
                   WHERE pps.patch_name = 'USER_CITY_UPGRADE'
                     AND pps.phase = 'TO_BE_UPDATED'
                     AND pps.process_type = 'USER_CITY_UPGRADE'
                     AND pps.legislation_code = 'US'
                     AND pps.id = pugu.id
                     AND pugu.process_date = pps.applied_date
                     AND pugu.process_type = pps.process_type
                     AND pugu.process_mode = pps.phase);
Line: 588

            UPDATE pay_patch_status pps
               SET phase = 'UPDATED'
             WHERE pps.patch_name = 'USER_CITY_UPGRADE'
               AND pps.phase = 'TO_BE_UPDATED'
               AND pps.process_type = 'USER_CITY_UPGRADE'
               AND pps.legislation_code = 'US';
Line: 595

            UPDATE pay_patch_status
               SET status = 'C'
             WHERE legislation_code = 'US'
               AND id = l_id
               AND status = 'P'
               AND description = l_mode;
Line: 604

            UPDATE pay_patch_status
               SET status = 'E'
             WHERE legislation_code = 'US'
               AND id = l_id
               AND status = 'P'
               AND description = l_mode;
Line: 639

CURSOR get_user_city_update_details IS
    SELECT pus.state_name,
           pus.state_abbrev,
           puc.county_name,
           substr(pugu.description,3) city_name,
           pugu.old_juri_code,
           pugu.new_juri_code
      FROM pay_us_geo_update pugu,
           pay_patch_status pps,
           pay_us_states pus,
           pay_us_counties puc
     WHERE pps.patch_name = 'USER_CITY_UPGRADE'
       AND pps.phase = 'TO_BE_UPDATED'
       AND pps.process_type = 'USER_CITY_UPGRADE'
       AND pps.legislation_code = 'US'
       AND pps.id = pugu.id
       AND pugu.process_date = pps.applied_date
       AND pugu.process_type = pps.process_type
       AND pugu.process_mode = pps.phase
       AND pus.state_code = substr(pugu.old_juri_code,1,2)
       AND pus.state_code = puc.state_code
       AND puc.county_code = substr(pugu.old_juri_code,4,3)
     ORDER BY pugu.old_juri_code;
Line: 665

    SELECT pugu.person_id,
           pugu.assignment_id,
           pugu.old_juri_code,
           pugu.new_juri_code,
           COUNT(DISTINCT pugu.table_name)
      FROM pay_us_geo_update pugu
     WHERE pugu.id = p_id
       AND pugu.process_type = 'D'
       AND pugu.process_mode = p_mode
       AND pugu.table_name IS NOT NULL
       AND EXISTS
             (SELECT NULL
                FROM pay_us_geo_update pugu1
               WHERE pugu1.id = p_id
                 AND pugu1.process_type = 'D'
                 AND pugu1.process_mode = p_mode
                 AND pugu1.person_id = pugu.person_id
                 AND pugu1.assignment_id = pugu.assignment_id
                 AND pugu1.table_name IS NULL
                 AND pugu1.table_value_id IS NULL
                 AND NVL(pugu1.status,'X') = 'C')
     GROUP BY pugu.person_id,pugu.assignment_id,
              pugu.old_juri_code,pugu.new_juri_code
     HAVING COUNT(*) > 0
     ORDER BY pugu.person_id,pugu.assignment_id,
              pugu.old_juri_code,pugu.new_juri_code;
Line: 693

    SELECT substr(ppf.full_name,1,100)
      FROM per_all_people_f ppf
     WHERE ppf.person_id = p_person_id
       AND NOT EXISTS
               (
                  SELECT NULL
                    FROM per_all_people_f ppf1
                   WHERE ppf1.person_id =ppf.person_id
                     AND ppf1.effective_end_date > ppf.effective_end_date
               );
Line: 704

CURSOR get_updated_tables (p_id            NUMBER,
                           p_mode          VARCHAR2,
                           p_person_id     NUMBER,
                           p_assignment_id NUMBER,
                           p_old_juri_code VARCHAR2,
                           p_new_juri_code VARCHAR2) IS
  SELECT DISTINCT pugu.table_name
    FROM pay_us_geo_update pugu
   WHERE pugu.id = p_id
     AND pugu.process_type = 'D'
     AND pugu.process_mode = p_mode
     AND pugu.person_id = p_person_id
     AND pugu.assignment_id = p_assignment_id
     AND pugu.table_name IS NOT NULL
     AND pugu.old_juri_code = p_old_juri_code
     AND pugu.new_juri_code = p_new_juri_code
   ORDER BY pugu.table_name;
Line: 723

  SELECT DISTINCT
         substr(ppf.full_name,1,100),
         pugu.assignment_id
    FROM pay_us_geo_update pugu,
         per_all_people_f ppf
   WHERE pugu.id = p_id
     AND pugu.process_type = 'D'
     AND pugu.process_mode = p_mode
     AND pugu.person_id = ppf.person_id
     AND pugu.table_name IS NULL
     AND pugu.table_value_id IS NULL
     AND NVL(pugu.status,'E') <>'C'
     AND NOT EXISTS (
                      SELECT NULL
                        FROM per_all_people_f ppf1
                       WHERE ppf1.person_id =ppf.person_id
                         AND ppf1.effective_end_date > ppf.effective_end_date
                    )
   GROUP BY ppf.full_name,pugu.assignment_id
   ORDER BY pugu.assignment_id;
Line: 748

   SELECT COUNT(0)
     FROM (SELECT DISTINCT assignment_id
             FROM pay_us_geo_update pugu
            WHERE pugu.id = p_id
              AND pugu.process_type = p_process_type
              AND pugu.process_mode = p_mode
              AND pugu.table_name is null
              AND pugu.table_value_id is null
              AND DECODE(pugu.status,'C','C','E')
                     = DECODE(p_status,'ALL',DECODE(pugu.status,'C','C','E'),p_status));
Line: 765

  l_old_juri_code               pay_us_geo_update.old_juri_code%TYPE;
Line: 766

  l_new_juri_code               pay_us_geo_update.new_juri_code%TYPE;
Line: 768

  l_assignment_id               pay_us_geo_update.assignment_id%TYPE;
Line: 769

  l_person_id                   pay_us_geo_update.person_id%TYPE;
Line: 770

  l_table_name                  pay_us_geo_update.table_name%TYPE;
Line: 787

      SELECT id,applied_date
        INTO l_id,l_applied_date
        FROM pay_patch_status pps
       WHERE pps.patch_name LIKE 'USER_CITY_UPGRADE%'
         AND pps.legislation_code = 'US'
         AND pps.status = 'P'
         AND pps.description = p_mode
         AND NOT EXISTS
              (SELECT NULL
                 FROM pay_patch_status pps1
                WHERE pps1.id > pps.id
                  AND pps1.patch_name LIKE 'USER_CITY_UPGRADE%'
                  AND pps1.legislation_code = 'US');
Line: 801

        /* Start of Employee Update related details printing*/

      fnd_file.put_line(fnd_file.output,'

Process Date : '||to_char(l_applied_date,'DD-MON-YYYY HH:MM:SS')||'

');
Line: 814

      OPEN get_user_city_update_details;
Line: 815

      FETCH get_user_city_update_details INTO
             l_state_name,l_state_abbrev,l_county_name,
             l_city_name,l_old_juri_code,l_new_juri_code;
Line: 819

      WHILE (get_user_city_update_details%FOUND)
       LOOP

        fnd_file.put_line(fnd_file.output,''||l_state_name||''||l_state_abbrev||
                                          ''||l_county_name||''||l_city_name||
                                          ''||l_old_juri_code||''||l_new_juri_code||'');
Line: 826

        FETCH get_user_city_update_details INTO
               l_state_name,l_state_abbrev,l_county_name,
               l_city_name,l_old_juri_code,l_new_juri_code;
Line: 832

      CLOSE get_user_city_update_details;
Line: 839

          fnd_file.put_line(fnd_file.output,'

List down employees for whom Jurisdiction code and relevant tables are to be updated

');
Line: 841

          fnd_file.put_line(fnd_file.output,'

List down employees for whom Jurisdiction code and relevant tables were updated

');
Line: 844

      fnd_file.put_line(fnd_file.output,'

Update Details

');
Line: 846

      fnd_file.put_line(fnd_file.output,'Employee DetailsJurisdiction DetailsTables Updated');
Line: 864

          OPEN get_updated_tables(l_id,p_mode,l_person_id,
                                  l_assignment_id,l_old_juri_code,l_new_juri_code);
Line: 866

          FETCH get_updated_tables INTO l_table_name;
Line: 873

          WHILE (get_updated_tables%FOUND)
           LOOP

             fnd_file.put_line(fnd_file.output,''||l_table_name||'');
Line: 877

             FETCH get_updated_tables INTO l_table_name;
Line: 879

           END LOOP; /* get_updated_tables LOOP */
Line: 881

          CLOSE get_updated_tables;