DBA Data[Home] [Help]

APPS.IGS_SV_BATCH_PROCESS_PKG SQL Statements

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

Line: 48

g_block_mode       CONSTANT NUMBER(1)    := 1; --Insert mode 0:1. If 1 - inserts only changed optional info in the block. , if 0 - all parts of the block
Line: 51

g_update_login     NUMBER(15);
Line: 52

g_update_by        NUMBER(15);
Line: 55

g_update_count    NUMBER(15) := 0;     -- prbhardw CP enhancement
Line: 57

g_running_update_batch NUMBER(15);     -- prbhardw CP enhancement
Line: 141

PROCEDURE Insert_Summary_Info(
   p_batch_id  IN  igs_sv_btch_summary.batch_id%TYPE,
   p_person_id  IN  igs_sv_btch_summary.person_id%TYPE,
   p_action_code  IN  igs_sv_btch_summary.action_code%TYPE,
   p_tag_code  IN  igs_sv_btch_summary.tag_code%TYPE,
   p_adm_action IN  igs_sv_btch_summary.adm_action_code%TYPE,
   p_owner_table_name IN igs_sv_btch_summary.owner_table_name%TYPE,
   p_owner_table_id  IN  igs_sv_btch_summary.OWNER_TABLE_IDENTIFIER%TYPE
);
Line: 172

   SELECT party_id,
          party_site_id
     FROM ecx_tp_headers
    WHERE tp_header_id IN
          ( SELECT tp_header_id
              FROM ecx_tp_details
             WHERE ext_process_id IN
             ( SELECT ext_process_id
                 FROM ecx_ext_processes
                WHERE direction = 'OUT'
                      AND transaction_id IN
                ( SELECT transaction_id
                    FROM ecx_transactions
                   WHERE transaction_type=l_trans_type
                     AND transaction_subtype =l_trans_subtype
                )
              )
           );
Line: 192

     SELECT sevis_user_id
     FROM igs_sv_batches
     WHERE batch_id = p_batch_id;
Line: 277

  l_parameter_list.DELETE;
Line: 355

                                        Modified the query to select the Active local institution. Added closed_ind = 'N'
                                        while selecting the ORG_ALTERNATE_ID_TYPE
                        9-DEC-2003      Bug No: 2908378 (Used the profile for local Institution)
------------------------------------------------------------------------


FUNCTION Get_School_Sevis_Id (
  p_batch_type IN VARCHAR2
) RETURN VARCHAR2
IS

   CURSOR c_alt_id (cp_local_inst hz_parties.party_number%TYPE)
   IS
     SELECT org_alternate_id
       FROM igs_or_org_alt_ids
       WHERE org_structure_id = cp_local_inst
       AND sysdate BETWEEN NVL(start_date,sysdate-1) and NVL(end_date,sysdate+1)
       AND ( ( org_alternate_id_type =
                     ( SELECT org_alternate_id_type
                       FROM igs_or_org_alt_idtyp
                       WHERE system_id_type = g_school_sevis_id AND
                             close_ind = 'N' AND
                             inst_flag = 'Y'
                      ) AND p_batch_type ='I')
                    OR  ( org_alternate_id_type =
                         ( SELECT org_alternate_id_type
                           FROM igs_or_org_alt_idtyp
                           WHERE system_id_type = g_sch_p_sevis_id AND
                                 close_ind = 'N' AND
                                 inst_flag = 'Y'
                        )
                        AND p_batch_type ='E')
                  );
Line: 535

     SELECT meaning
      FROM fnd_lookup_values
      WHERE lookup_code = p_code
        AND view_application_id = 8405
        AND enabled_flag='Y'
        AND language = USERENV('LANG')
        AND lookup_type = p_type
        AND SYSDATE BETWEEN NVL(start_date_active,SYSDATE-1) AND NVL(end_date_active, SYSDATE + 1);
Line: 590

     SELECT SUBSTR(meaning,5,2)
      FROM fnd_lookup_values
     WHERE lookup_type = 'PQP_US_COUNTRY_TRANSLATE'
       AND view_application_id = 3
       AND lookup_code=p_code
       AND SYSDATE BETWEEN  NVL(start_date_active,SYSDATE-1)  AND NVL(end_date_active, SYSDATE + 1);
Line: 598

     SELECT alternate_territory_code
     FROM   fnd_territories_vl
     WHERE  territory_code = cp_cntry_code;
Line: 689

     SELECT lv.lookup_code
       FROM fnd_lookup_values   lv
      WHERE lv.lookup_type = 'SV_MAP_HR_VISA_TYPES'
        AND lv.meaning     = p_visa_meaning
        AND SYSDATE BETWEEN  NVL(start_date_active,SYSDATE-1)  AND NVL(end_date_active, SYSDATE + 1);
Line: 743

      SELECT tag
        FROM fnd_lookup_values
       WHERE lookup_code         = p_code
         AND view_application_id = 8405
         AND enabled_flag        = 'Y'
         AND language            = USERENV('LANG')
         AND lookup_type         = p_type
         AND SYSDATE BETWEEN  NVL(start_date_active,SYSDATE-1)  AND NVL(end_date_active, SYSDATE + 1);
Line: 838

    SELECT api_person_id
      FROM igs_pe_alt_pers_id
     WHERE pe_person_id = p_person_id
           AND person_id_type
               IN (SELECT person_id_type
                     FROM igs_pe_person_id_typ
                    WHERE s_person_id_type = g_person_sevis_id)
           AND start_dt <= trunc(sysdate)
           AND NVL(end_dt,sysdate+1) >= trunc(sysdate);
Line: 894

      SELECT tag
        FROM fnd_lookup_values
       WHERE lookup_code         = p_code
         AND view_application_id = 8405
         AND enabled_flag        = 'Y'
         AND language            = USERENV('LANG')
         AND lookup_type         = 'SV_US_TERRITORY_CODES'
         AND SYSDATE BETWEEN  NVL(start_date_active,SYSDATE-1)  AND NVL(end_date_active, SYSDATE + 1);
Line: 969

    SELECT COUNT('X')
      FROM igs_sv_depdnt_info
     WHERE person_id = p_person_id
           AND depdnt_id = p_depdnt_id
	   AND batch_id < p_batch_id;
Line: 1020

      SELECT 1
       FROM igs_pe_addr_v adr,
            igs_pe_partysiteuse_v usg
      WHERE person_id = cp_person_id
        AND ( adr.status = 'A' AND SYSDATE BETWEEN NVL(start_dt,SYSDATE) AND NVL(end_dt, SYSDATE + 1) )
        AND usg.party_site_id  = adr.party_site_id
	AND adr.party_site_id = cp_party_site_id
        AND usg.site_use_type  = g_f_addr_usage
        AND usg.active         = 'A';
Line: 1032

      SELECT 1
       FROM igs_pe_addr_v adr,
            igs_pe_partysiteuse_v usg
      WHERE person_id = cp_person_id
	    AND ( adr.status = 'A' AND SYSDATE BETWEEN NVL(start_dt,SYSDATE) AND NVL(end_dt, SYSDATE + 1) )
            AND usg.party_site_id  = adr.party_site_id
            AND adr.party_site_id = cp_party_site_id
            AND usg.site_use_type  = g_us_addr_usage
            AND usg.active         = 'A';
Line: 1044

      SELECT 1
      FROM hz_locations loc,
	  hz_party_sites ps,
	  igs_pe_hz_pty_sites igsps,
	  hz_party_site_uses usg
      WHERE
         ps.location_id = loc.location_id
         AND ps.party_site_id = igsps.party_site_id (+)
	 AND ps.party_site_id = cp_party_site_id
         AND ps.party_id = cp_person_id
         AND ( ps.status = 'A' AND SYSDATE BETWEEN NVL(IGSPS.start_date,SYSDATE) AND NVL(IGSPS.end_date, SYSDATE + 1))
         AND usg.party_site_id  = ps.party_site_id
         AND usg.site_use_type  = g_site_addr_usage
         AND usg.status = 'A'
    UNION
      SELECT 1
      FROM  hz_locations adr,
            igs_pe_act_site usg
      WHERE usg.person_id = cp_person_id
        AND SYSDATE BETWEEN nvl(ADDRESS_EFFECTIVE_DATE,sysdate-1) AND NVL(ADDRESS_EXPIRATION_DATE, SYSDATE + 1)
        AND usg.location_id = adr.location_id
	AND adr.location_id = cp_party_site_id
        AND sysdate BETWEEN usg.start_date AND NVL(usg.end_date,sysdate+1);
Line: 1172

     SELECT issue_reason   ,
            curr_session_end_date ,
            next_session_start_date ,
            other_reason,
            transfer_from_school,
            prgm_start_date,
	    last_session_flag,
	    adjudicated_flag
       FROM igs_pe_nonimg_form
      WHERE nonimg_form_id = p_person_rec.form_id ;
Line: 1184

     SELECT create_reason   ,
            prgm_start_date ,
            prgm_end_date  ,
            ev_form_number ,
            init_prgm_start_date ,
	    no_show_flag
       FROM igs_pe_ev_form
      WHERE ev_form_id = p_person_rec.form_id ;
Line: 1225

       p_data_rec.created_by := g_update_by;
Line: 1226

       p_data_rec.last_updated_by := g_update_by;
Line: 1227

       p_data_rec.last_update_date  := sysdate;
Line: 1228

       p_data_rec.last_update_login := g_update_login;
Line: 1263

       p_data_rec.created_by := g_update_by;
Line: 1264

       p_data_rec.last_updated_by := g_update_by;
Line: 1265

       p_data_rec.last_update_date  := sysdate;
Line: 1266

       p_data_rec.last_update_login := g_update_login;
Line: 1495

      SELECT hzpp.person_last_name,
             hzpp.person_middle_name,
             hzpp.person_first_name,
             hzpp.person_name_suffix,
             hzpp.date_of_birth,
             hzpp.gender,
             prt.birth_country,
             hzc.country_code,
             prt.birth_city
        FROM hz_person_profiles    hzpp,
             hz_citizenship        hzc,
             igs_pe_hz_parties     prt
       WHERE hzpp.party_id = p_person_rec.person_id
         AND prt.party_id = hzpp.party_id
         AND hzc.party_id (+)  = hzpp.party_id
         AND sysdate between hzpp.effective_start_date AND NVL(hzpp.effective_end_date,sysdate+1);
Line: 1513

      SELECT peva.visa_type
        FROM igs_pe_visa   peva
       WHERE peva.person_id = p_person_rec.person_id
         AND SYSDATE BETWEEN peva.visa_issue_date AND peva.visa_expiry_date;
Line: 1519

      SELECT decode(commuter_ind,'Y','1','0') commuter
        FROM igs_pe_nonimg_form
       WHERE nonimg_form_id  = p_person_rec.form_id;
Line: 1524

   SELECT perm_res_cntry
   FROM igs_pe_eit_perm_res_v
   WHERE person_id  = p_person_rec.person_id;
Line: 1529

      SELECT pevf.position_code,
             pevf.category_code,
             pevf.position_remarks
        FROM igs_pe_ev_form        pevf
       WHERE pevf.person_id = p_person_rec.person_id
         AND ev_form_id     = p_person_rec.form_id;
Line: 1537

	SELECT psd.birth_cntry_resn_code
        FROM igs_pe_stat_details  psd
        WHERE psd.person_id = cp_person_id;
Line: 1662

      p_data_rec.created_by := g_update_by;
Line: 1663

      p_data_rec.last_updated_by := g_update_by;
Line: 1664

      p_data_rec.last_update_date  := sysdate;
Line: 1665

      p_data_rec.last_update_login := g_update_login;
Line: 1862

     SELECT palt.api_person_id_uf,
            palt.region_cd
       FROM igs_pe_alt_pers_id       palt,
            igs_pe_person_id_typ     typv
      WHERE typv.s_person_id_type        = cp_system_person_id_type
        AND palt.person_id_type          = typv.person_id_type
        AND palt.pe_person_id            = p_person_rec.person_id
        AND SYSDATE BETWEEN palt.start_dt AND NVL(palt.end_dt,SYSDATE);
Line: 1986

      p_data_rec.created_by        := g_update_by;
Line: 1987

      p_data_rec.last_updated_by   := g_update_by;
Line: 1988

      p_data_rec.last_update_date  := sysdate;
Line: 1989

      p_data_rec.last_update_login := g_update_login;
Line: 2084

     SELECT adr.party_site_id,
            addr_line_1,
            addr_line_2,
            addr_line_3,
            addr_line_4,
            city,
            state,
            province,
            country_cd,
            postal_code,
	    identifying_address_flag
       FROM igs_pe_addr_v adr,
            igs_pe_partysiteuse_v usg
      WHERE person_id = p_person_rec.person_id
        AND ( adr.status = 'A' AND SYSDATE BETWEEN NVL(start_dt,SYSDATE) AND NVL(end_dt, SYSDATE + 1) )
        AND usg.party_site_id  = adr.party_site_id
        AND usg.site_use_type  = g_f_addr_usage
        AND usg.active         = 'A';
Line: 2133

       p_data_rec(l_counter).created_by := g_update_by;
Line: 2134

       p_data_rec(l_counter).last_updated_by := g_update_by;
Line: 2135

       p_data_rec(l_counter).last_update_date  := sysdate;
Line: 2136

       p_data_rec(l_counter).last_update_login := g_update_login;
Line: 2253

   gmaheswa            12-Nov-2003    Modified c_addr cursor to select active address records,
                                      as part of address related changes .
------------------------------------------------------------------------

******************************************************************/
FUNCTION Validate_Us_Addr_Info (
   p_person_rec IN t_student_rec,
   p_data_rec  IN OUT NOCOPY  g_address_rec_type ,  -- Data record
   p_records  IN  NUMBER   -- number of addressees found
) RETURN VARCHAR2
IS

   l_api_name CONSTANT VARCHAR(30) := 'Validate_Us_Addr_Info';
Line: 2268

     SELECT adr.party_site_id,
            addr_line_1,
            addr_line_2,
            addr_line_3,
            addr_line_4,
            city,
            state,
            province,
            country_cd,
            postal_code,
	    adr.identifying_address_flag
       FROM igs_pe_addr_v adr,
            igs_pe_partysiteuse_v usg
      WHERE person_id = p_person_rec.person_id
        AND ( adr.status = 'A' AND SYSDATE BETWEEN NVL(start_dt,SYSDATE) AND NVL(end_dt, SYSDATE + 1) )
        AND usg.party_site_id  = adr.party_site_id
        AND usg.site_use_type  = g_us_addr_usage
        AND usg.active         = 'A';
Line: 2319

       p_data_rec(l_counter).created_by := g_update_by;
Line: 2320

       p_data_rec(l_counter).last_updated_by := g_update_by;
Line: 2321

       p_data_rec(l_counter).last_update_date  := sysdate;
Line: 2322

       p_data_rec(l_counter).last_update_login := g_update_login;
Line: 2435

                                        Selected LOCATION_ID instead of PARTY_SITE_ID for these cases.
                                        Added p_data_rec(l_counter).party_site_id := c_addr_rec.party_site_id
   gmaheswa             12-Nov-2003     Modified c_addr cursor to select active address records,
                                        as part of address related changes .
   pkpatel              4-Dec-2003      Bug 3227107 (Used the status column for address)
------------------------------------------------------------------------

******************************************************************/
FUNCTION Validate_Site_Info (
   p_person_rec IN      t_student_rec,
   p_data_rec   IN OUT NOCOPY  g_address_rec_type ,  -- Data record
   p_records    OUT NOCOPY     NUMBER                -- number of addressees found
) RETURN VARCHAR2
IS


   l_api_name CONSTANT VARCHAR(30) := 'Validate_Site_Info';
Line: 2455

  SELECT 'A' action_type, -- Add site action type
            ps.party_site_id,
            loc.ADDRESS1 addr_line_1 ,
            loc.ADDRESS2 addr_line_2,
            loc.ADDRESS3 addr_line_3,
            loc.ADDRESS4 addr_line_4,
            loc.city,
            loc.state,
            loc.province,
            loc.country country_code,
            loc.postal_code,
	    ps.identifying_address_flag  primary_site,
	    to_char(usg.party_site_id) activity_site_cd,
	    null remarks
       FROM	HZ_LOCATIONS loc,
	        HZ_PARTY_SITES ps,
                IGS_PE_HZ_PTY_SITES IGSPS,
		hz_party_site_uses usg
      WHERE
        PS.LOCATION_ID = Loc.LOCATION_ID
        AND PS.PARTY_SITE_ID = IGSPS.PARTY_SITE_ID (+)
        and ps.party_id = p_person_rec.person_id
        AND ( ps.status = 'A' AND SYSDATE BETWEEN NVL(IGSPS.start_date,SYSDATE) AND NVL(IGSPS.end_date, SYSDATE + 1))
        AND usg.party_site_id  = ps.party_site_id
        AND usg.site_use_type  = g_site_addr_usage
        AND usg.status = 'A'
   UNION
     -- All institution sites assigned as to a person. here location id is selected which
     -- will be stored as party_site id in IGS_SV_ADDRESSES table
     SELECT 'A' action_type, -- Add site action type
            adr.location_id party_site_id, -- this will be passed to party_site_id of IGS_SV_ADDRESSES
            ADDRESS1 addr_line_1,
            ADDRESS2 addr_line_2,
            ADDRESS3 addr_line_3,
            ADDRESS4 addr_line_4,
            city,
            state,
            province,
            country country_code,
            postal_code,
	    usg.primary_flag primary_site,
	    usg.activity_site_cd activity_site_cd,
	    usg.remarks remarks
       FROM  HZ_LOCATIONS adr,
            igs_pe_act_site usg
     WHERE usg.person_id = p_person_rec.person_id
        AND SYSDATE BETWEEN nvl(ADDRESS_EFFECTIVE_DATE,sysdate-1) AND NVL(ADDRESS_EXPIRATION_DATE, SYSDATE + 1)
        AND usg.location_id = adr.location_id
        AND sysdate BETWEEN usg.start_date AND NVL(usg.end_date,sysdate+1);
Line: 2505

	--All deleted and previously submited sites
  CURSOR c_data_del IS
     select 'D' action_type,
            ps.party_site_id,
            loc.ADDRESS1 addr_line_1 ,
            loc.ADDRESS2 addr_line_2,
            loc.ADDRESS3 addr_line_3,
            loc.ADDRESS4 addr_line_4,
            loc.city,
            loc.state,
            loc.province,
            loc.country country_code,
            loc.postal_code,
     ps.identifying_address_flag  primary_site,
     to_char(usg.party_site_id) activity_site_cd ,
     null remarks
       from HZ_LOCATIONS loc,
     HZ_PARTY_SITES ps,
     IGS_PE_HZ_PTY_SITES IGSPS,
            hz_party_site_uses usg
      where
        PS.LOCATION_ID = Loc.LOCATION_ID
        AND PS.PARTY_SITE_ID = IGSPS.PARTY_SITE_ID (+)
        and ps.party_id = p_person_rec.person_id
        and ( (IGSPS.end_date is not null and trunc(sysdate) >= IGSPS.end_date )
              or ps.status         <> 'A'
              or usg.status         <> 'A'
             )
        and usg.party_site_id  = ps.party_site_id
        and usg.site_use_type  = g_site_addr_usage
        and usg.party_site_id in
            ( select ad.party_site_id
                from igs_sv_addresses ad,
                     igs_sv_persons pr
               where ad.person_id = pr.person_id
                     and ad.batch_id = pr.batch_id
                     and pr.record_status <> 'E'
                     and ad.person_id = p_person_rec.person_id and ad.address_type not in ('F','U')
            )
   union
     -- all institution sites assigned as to a person
     select 'D' action_type, -- delete site action type
            loc.location_id party_site_id,
            loc.ADDRESS1,
            loc.ADDRESS2,
            loc.ADDRESS3,
            loc.ADDRESS4,
            loc.city,
            loc.state,
            loc.province,
            loc.country country_code,
            loc.postal_code,
     usg.primary_flag primary_site,
     usg.activity_site_cd activity_site_cd,
     usg.remarks remarks
       from HZ_LOCATIONS loc,
            igs_pe_act_site usg
      where
        usg.person_id = p_person_rec.person_id
        and (loc.ADDRESS_EXPIRATION_DATE is not null and loc.ADDRESS_EXPIRATION_DATE <= trunc(sysdate) )
        and usg.location_id = loc.location_id
        and sysdate between usg.start_date and nvl(usg.end_date,sysdate+1)
        and usg.location_id in
            ( select adr1.location_id
              from igs_sv_addresses ad,
                   HZ_LOCATIONS  adr1,
                   igs_sv_persons pr
              where ad.person_id = pr.person_id
                     and ad.batch_id = pr.batch_id
                     and pr.record_status <> 'E'
                     and adr1.location_id = ad.party_site_id  -- in the party_side_id field of igs_sv_addresses location_id is stored for activity sites
                     and ad.person_id = p_person_rec.person_id and ad.address_type not in ('F','U')
            );
Line: 2580

	SELECT COUNT('X')
	FROM
	(
	   SELECT a.location_id
	   FROM igs_pe_act_site a
	   WHERE a.person_id = p_person_rec.person_id AND
	       a.primary_flag = 'Y' /*AND
	       (a.end_date IS NULL OR sysdate between a.start_date and a.end_date)*/
	 UNION
	    SELECT adr.party_site_id
	     FROM igs_pe_addr_v adr,
		hz_party_site_uses usg
	     WHERE person_id = p_person_rec.person_id
		AND ( adr.status = 'A' AND SYSDATE BETWEEN NVL(adr.start_dt,SYSDATE) AND NVL(adr.end_dt, SYSDATE + 1))
		AND usg.party_site_id  = adr.party_site_id
		AND usg.site_use_type  = 'SEVIS_SITE_OF_ACTIVITY'
		AND usg.status = 'A'
		AND adr.identifying_address_flag = 'Y'
        )
    ;
Line: 2602

	 SELECT COUNT(a.activity_site_cd)
	 FROM igs_pe_act_site a
	 WHERE a.person_id = p_person_rec.person_id AND
	       (a.end_date IS NULL OR sysdate between a.start_date and a.end_date);
Line: 2667

       p_data_rec(l_counter).created_by := g_update_by;
Line: 2668

       p_data_rec(l_counter).last_updated_by := g_update_by;
Line: 2669

       p_data_rec(l_counter).last_update_date  := sysdate;
Line: 2670

       p_data_rec(l_counter).last_update_login := g_update_login;
Line: 2728

       p_data_rec(l_counter).created_by := g_update_by;
Line: 2729

       p_data_rec(l_counter).last_updated_by := g_update_by;
Line: 2730

       p_data_rec(l_counter).last_update_date  := sysdate;
Line: 2731

       p_data_rec(l_counter).last_update_login := g_update_login;
Line: 2851

     SELECT penf.education_level,
            penf.primary_major,
            penf.secondary_major,
            penf.minor,
            penf.length_of_study,
            penf.prgm_start_date,
            penf.prgm_end_date,
            decode(penf.english_reqd,'Y','1','0')  english_reqd,
            decode(penf.english_reqd_met,'Y','1','0')  english_reqd_met,
            penf.not_reqd_reason,
            penf.educ_lvl_remarks
       FROM igs_pe_nonimg_form     penf
      WHERE penf.person_id = p_person_rec.person_id
        AND penf.nonimg_form_id = p_person_rec.form_id;
Line: 2867

     SELECT peev.position_code,
            peev.subject_field_code,
            peev.subject_field_remarks,
	    prgm_start_date,
	    prgm_end_date
       FROM igs_pe_ev_form   peev
      WHERE peev.person_id  = p_person_rec.person_id
        AND peev.ev_form_id = p_person_rec.form_id;
Line: 2933

         p_data_rec.created_by        := g_update_by;
Line: 2934

         p_data_rec.last_updated_by   := g_update_by;
Line: 2935

         p_data_rec.last_update_date  := sysdate;
Line: 2936

         p_data_rec.last_update_login := g_update_login;
Line: 2973

         p_data_rec.created_by           := g_update_by;
Line: 2974

         p_data_rec.last_updated_by      := g_update_by;
Line: 2975

         p_data_rec.last_update_date     := sysdate;
Line: 2976

         p_data_rec.last_update_login    := g_update_login;
Line: 3140

     SELECT penf.education_level,
            penf.primary_major,
            penf.secondary_major,
            penf.minor,
            penf.length_of_study,
            penf.prgm_start_date,
            penf.prgm_end_date,
            decode(penf.english_reqd,'Y','1','0')  english_reqd,
            decode(penf.english_reqd_met,'Y','1','0')  english_reqd_met,
            penf.not_reqd_reason,
            penf.educ_lvl_remarks
       FROM igs_pe_nonimg_form     penf
      WHERE penf.person_id = p_data_rec.person_id
        AND penf.nonimg_form_id = g_nonimg_form_id;
Line: 3156

     SELECT peev.position_code,
            peev.subject_field_code,
            peev.subject_field_remarks,
	    prgm_start_date,
	    prgm_end_date
       FROM igs_pe_ev_form   peev
      WHERE peev.person_id  = p_data_rec.person_id
        AND peev.ev_form_id = g_nonimg_form_id;
Line: 3275

   Purpose            : Insert authorization codes of the student
                        (IGS_SV_PRGMS_INFO).

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
PROCEDURE Insert_Auth_Code (
   p_auth_drp_data_rec IN IGS_SV_PRGMS_INFO%ROWTYPE
)
IS

   l_api_name CONSTANT VARCHAR(30) := 'Insert_Auth_Code';
Line: 3320

	l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Auth_Code';
Line: 3321

	l_debug_str := 'Entering Insert_Edu_Info. person_id is '||p_auth_drp_data_rec.person_id|| ' and batch_id is '||p_auth_drp_data_rec.batch_id;
Line: 3332

	l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Auth_Code';
Line: 3352

		Insert_Summary_Info(l_btch_id,
				       p_auth_drp_data_rec.person_id,
				       l_action,
				       l_tag_code,
				       'SEND',
				       'IGS_SV_PRGMS_INFO',
				       p_auth_drp_data_rec.sevis_auth_id);
Line: 3378

		l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Auth_Code';
Line: 3385

	   INSERT INTO igs_sv_prgms_info (
		batch_id               ,
		person_id              ,
		prgm_action_type       ,
		position_code          ,
		subject_field_code     ,
		education_level        ,
		primary_major          ,
		secondary_major        ,
		educ_lvl_remarks       ,
		minor                  ,
		length_of_study        ,
		prgm_start_date        ,
		prgm_end_date          ,
		english_reqd           ,
		english_reqd_met       ,
		not_reqd_reason        ,
		authorization_reason   ,
		remarks                ,
		creation_date          ,
		created_by             ,
		last_updated_by        ,
		last_update_date       ,
		last_update_login      ,
		auth_action_code       ,
		sevis_auth_id	       ,
		print_form
	      ) VALUES
	      ( l_btch_id                        ,
	       p_auth_drp_data_rec.person_id              ,
	       p_auth_drp_data_rec.prgm_action_type       ,
	       l_position_code				  ,
	       l_subject_field_code			  ,
	       l_education_level			  ,
	       l_primary_major				  ,
	       l_secondary_major			  ,
	       l_educ_lvl_remarks			  ,
	       l_minor					  ,
	       l_length_of_study			  ,
	       p_auth_drp_data_rec.prgm_start_date        ,
	       p_auth_drp_data_rec.prgm_end_date          ,
	       l_english_reqd				  ,
	       l_english_reqd_met			  ,
	       l_not_reqd_reason			  ,
	       p_auth_drp_data_rec.authorization_reason   ,
	       p_auth_drp_data_rec.remarks                ,
	       p_auth_drp_data_rec.creation_date          ,
	       p_auth_drp_data_rec.created_by             ,
	       p_auth_drp_data_rec.last_updated_by        ,
	       p_auth_drp_data_rec.last_update_date       ,
	       p_auth_drp_data_rec.last_update_login      ,
	       p_auth_drp_data_rec.auth_action_code       ,
	       p_auth_drp_data_rec.sevis_auth_id	  ,
	       '0'
	      );
Line: 3442

	l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Auth_Code';
Line: 3443

	l_debug_str := 'Record inserted';
Line: 3456

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Auth_Code';
Line: 3457

   l_debug_str := 'EXCEPTION in Insert_Auth_Code. '||SQLERRM;
Line: 3464

END Insert_Auth_Code;
Line: 3477

     SELECT nonimg_stat_id,
            nonimg_form_id,
            to_char(action_date,'YYYY-MM-DD') action_date,
            action_type,
            to_char(prgm_start_date,'YYYY-MM-DD') prgm_start_date,
            to_char(prgm_end_date,'YYYY-MM-DD') prgm_end_date,
            remarks,
            termination_reason,
	    print_flag, --prbhardw
	    cancel_flag
       FROM igs_pe_nonimg_stat
      WHERE nonimg_form_id = p_person_rec.form_id
            AND nonimg_stat_id NOT IN
            ( SELECT NVL(form_status_id,0)
                FROM igs_sv_prgms_info prg,
                     igs_sv_persons pr
               WHERE prg.person_id = pr.person_id
                     AND prg.batch_id = pr.batch_id
                     AND pr.record_status <> 'E'
                     AND prg.person_id = p_person_rec.person_id
               )
   ORDER BY action_date;
Line: 3501

     SELECT ev_form_stat_id    ,
            ev_form_id         ,
            to_char(action_date,'YYYY-MM-DD') action_date,
            action_type        ,
            to_char(prgm_start_date,'YYYY-MM-DD') prgm_start_date,
            to_char(prgm_end_date,'YYYY-MM-DD') prgm_end_date,
            remarks            ,
            termination_reason ,
            end_program_reason
       FROM igs_pe_ev_form_stat
      WHERE ev_form_id = p_person_rec.form_id
            AND ev_form_stat_id NOT IN
            ( SELECT NVL(form_status_id,0)
                FROM igs_sv_prgms_info prg,
                     igs_sv_persons pr
               WHERE prg.person_id = pr.person_id
                     AND pr.record_status <> 'E'
                     AND prg.batch_id = pr.batch_id
                     AND prg.person_id = p_person_rec.person_id)
   ORDER BY action_date;
Line: 3523

     SELECT category_code,
            prgm_start_date,
            prgm_end_date
       FROM igs_pe_ev_form
      WHERE ev_form_id = p_person_rec.form_id;
Line: 3530

   SELECT prgms.authorization_reason,
          prgms.prgm_start_date,
          prgms.prgm_end_date,
          prgms.remarks,
	  prgms.auth_action_code
     FROM igs_sv_prgms_info  prgms,
          igs_sv_persons pr
    WHERE prgms.person_id = pr.person_id
          AND pr.record_status <> 'E'
          AND prgms.person_id  = p_person_rec.person_id
          AND prgms.prgm_action_type  = 'DB'
	  AND prgms.sevis_auth_id = cp_sevis_auth_id
	  AND prgms.batch_id IN
	      ( SELECT max(prs.batch_id)
		 FROM igs_sv_prgms_info prs,
		      igs_sv_persons pr
	       WHERE prs.person_id = pr.person_id
		     AND prs.batch_id = pr.batch_id
		     AND pr.record_status <> 'E'
		     AND prs.person_id = p_person_rec.person_id
		     AND prs.prgm_action_type = 'DB'
		     AND prs.sevis_auth_id = cp_sevis_auth_id
	      );
Line: 3555

   SELECT prgms.prgm_start_date,
          prgms.prgm_end_date,
          prgms.remarks
     FROM igs_sv_prgms_info   prgms,
          igs_sv_persons pr
    WHERE prgms.person_id = pr.person_id
          AND prgms.batch_id = pr.batch_id
          AND pr.record_status <> 'E'
          AND prgms.person_id         = p_person_rec.person_id
          AND prgms.prgm_action_type  = 'RF';
Line: 3568

    SELECT visa_type
    FROM IGS_PE_NONIMG_FORM
    WHERE nonimg_form_id = p_person_rec.form_id;
Line: 3573

      SELECT COUNT(1)
      FROM igs_pe_nonimg_stat
      WHERE nonimg_form_id = p_person_rec.form_id
            AND p_term_reason NOT IN
            ( SELECT lookup_code FROM igs_lookup_values
	      WHERE lookup_type ='PE_SV_TERMINATE_REASON' AND
		    enabled_flag ='Y' AND
		    (tag= p_visa OR tag= 'FM')
	     );
Line: 3585

     SELECT
          PRGM_END_DATE
     FROM
          IGS_PE_NONIMG_FORM_V
     WHERE
          nonimg_form_id = p_person_rec.form_id;
Line: 3594

       SELECT sevis_auth_id, sevis_authorization_code, start_dt, end_dt, comments, cancel_flag
       FROM igs_en_svs_auth
       WHERE person_id = cp_person_id;
Line: 3600

       SELECT prgm_start_date, prgm_end_date, visa_type
       FROM igs_pe_nonimg_form
       WHERE person_id = cp_person_id
             AND nonimg_form_id = p_person_rec.form_id;
Line: 3717

		 p_auth_drp_data_rec(l_auth_rec_count).created_by := g_update_by;
Line: 3718

		 p_auth_drp_data_rec(l_auth_rec_count).last_updated_by := g_update_by;
Line: 3719

		 p_auth_drp_data_rec(l_auth_rec_count).last_update_date  := sysdate;
Line: 3720

		 p_auth_drp_data_rec(l_auth_rec_count).last_update_login := g_update_login;
Line: 3845

         p_data_rec(l_counter).created_by := g_update_by;
Line: 3846

         p_data_rec(l_counter).last_updated_by := g_update_by;
Line: 3847

         p_data_rec(l_counter).last_update_date  := sysdate;
Line: 3848

         p_data_rec(l_counter).last_update_login := g_update_login;
Line: 3973

       p_data_rec(l_counter).created_by := g_update_by;
Line: 3974

       p_data_rec(l_counter).last_updated_by := g_update_by;
Line: 3975

       p_data_rec(l_counter).last_update_date  := sysdate;
Line: 3976

       p_data_rec(l_counter).last_update_login := g_update_login;
Line: 4178

     SELECT acad_term_length,
            tuition_amt,
            living_exp_amt,
            depdnt_exp_amt  dependent_exp_amt,
            other_exp_amt,
            other_exp_desc,
            personal_funds_amt,
            school_funds_amt,
            school_funds_desc,
            other_funds_amt,
            other_funds_desc,
            empl_funds_amt,
            remarks
       FROM igs_pe_nonimg_form     penf
      WHERE penf.person_id      = p_person_rec.person_id
        AND penf.nonimg_form_id = p_person_rec.form_id;
Line: 4196

     SELECT prgm_sponsor_amt program_sponsor,
            govt_org1_amt,
            govt_org2_amt,
            govt_org1_code,
            govt_org2_code,
            intl_org1_amt,
            intl_org2_amt,
            intl_org1_code,
            intl_org2_code,
            ev_govt_amt,
            bi_natnl_com_amt,
            other_govt_amt,
            personal_funds_amt,
            remarks,
            NVL(NVL(govt_org2_amt,govt_org1_amt),'0') recvd_us_gvt_funds_ind,
	    govt_org1_othr_name    ,
	    govt_org2_othr_name    ,
            intl_org1_othr_name    ,
            intl_org2_othr_name    ,
	    other_govt_name
       FROM igs_pe_ev_form     evf
      WHERE evf.person_id  = p_person_rec.person_id
        AND evf.ev_form_id = p_person_rec.form_id;
Line: 4293

         p_data_rec.created_by        := g_update_by;
Line: 4294

         p_data_rec.last_updated_by   := g_update_by;
Line: 4295

         p_data_rec.last_update_date  := sysdate;
Line: 4296

         p_data_rec.last_update_login := g_update_login;
Line: 4353

         p_data_rec.created_by        := g_update_by;
Line: 4354

         p_data_rec.last_updated_by   := g_update_by;
Line: 4355

         p_data_rec.last_update_login := g_update_login;
Line: 4356

         p_data_rec.last_update_date  := sysdate;
Line: 4563

     SELECT dep.relationship_id,
            rel.object_id depdnt_id,
            action_code,
            to_char(effective_date,'YYYY-MM-DD') effective_date ,
            reason_code,
            dep.REMARKS comments,
            rel.COMMENTS rel_remarks,
            decode (RELATIONSHIP_CODE,'PARENT_OF','02','SPOUSE_OF','01','XX' ) relationship
       FROM igs_pe_depd_active dep,
            HZ_RELATIONSHIPS rel
      WHERE subject_id = p_person_rec.person_id
            AND rel.relationship_id =  dep.relationship_id
            AND (p_person_rec.record_status = 'C' OR dep.action_code ='A')  --In the new mode report only about active dependents
            AND RELATIONSHIP_CODE IN ('PARENT_OF','SPOUSE_OF' )
            AND (dep.relationship_id, dep.last_update_date) IN
            ( SELECT dep1.relationship_id,
                     MAX(dep1.last_update_date)
                FROM igs_pe_depd_active dep1
		WHERE dep1.relationship_id = rel.relationship_id
		GROUP BY  dep1.relationship_id)
            AND rel.status = 'A';
Line: 4586

    SELECT person_number
      FROM igs_pe_person
     WHERE person_id = p_id;
Line: 4591

          SELECT COUNT(1)
	 FROM igs_pe_hz_rel_v hz
	 WHERE hz.subject_id = p_person_rec.person_id AND
	 hz.relationship_code= 'SPOUSE_OF' and
	 sysdate BETWEEN hz.start_date AND NVL(hz.end_date, sysdate+1)
         AND EXISTS (SELECT 1 FROM igs_pe_depd_active pdep
                     WHERE pdep.relationship_id = hz.relationship_id AND
                           pdep.action_code <> 'T' AND
                           pdep.last_update_date = (SELECT MAX(last_update_date)
				      FROM igs_pe_depd_active
				      WHERE relationship_id =hz.relationship_id)
                     );
Line: 4606

          SELECT alt.api_person_id
	  FROM  igs_pe_alt_pers_id alt
	  WHERE
	       alt.pe_person_id = c_dep_id AND
	       alt.person_id_type IN (SELECT person_id_type FROM igs_pe_person_id_typ
				    WHERE s_person_id_type = 'SEVIS_ID') AND
               sysdate between alt.start_dt and nvl(alt.end_dt, sysdate+1);
Line: 4646

	       p_data_rec(l_counter).created_by := g_update_by;
Line: 4647

	       p_data_rec(l_counter).last_updated_by := g_update_by;
Line: 4648

	       p_data_rec(l_counter).last_update_date  := sysdate;
Line: 4649

	       p_data_rec(l_counter).last_update_login := g_update_login;
Line: 4745

	       --  EXIT; -- Just one dependent in the update mode per batch	prbhardw CP enhancement
Line: 4832

     SELECT felony_details_id conviction_id,
            disp_action_info criminal_remarks
       FROM igs_pe_felony_dtls
      WHERE person_id = p_person_rec.person_id
            AND convict_ind ='Y'
            AND felony_details_id NOT IN
            ( SELECT conviction_id
                FROM igs_sv_convictions  prg,
                     igs_sv_persons pr
               WHERE prg.person_id = pr.person_id
                     AND prg.batch_id = pr.batch_id
                     AND pr.record_status <> 'E'
                     AND prg.person_id = p_person_rec.person_id )
    ORDER BY crime_date;
Line: 4866

       p_data_rec.created_by := g_update_by;
Line: 4867

       p_data_rec.last_updated_by := g_update_by;
Line: 4868

       p_data_rec.last_update_date  := sysdate;
Line: 4869

       p_data_rec.last_update_login := g_update_login;
Line: 4987

     SELECT peva.visa_number,
            peva.visa_issuing_post,
            peva.visa_expiry_date,
            pevv.cntry_entry_form_num,
            pevv.port_of_entry,
            pevv.visit_start_date,
            pevv.remarks,
            pspt.passport_number,
            pspt.passport_cntry_code,
            pspt.passport_expiry_date,
            peva.visa_issuing_country,
	    peva.visa_issue_date
       FROM igs_pe_visa           peva,
            igs_pe_visit_histry   pevv,
            igs_pe_passport       pspt
      WHERE peva.person_id         = p_person_rec.person_id
        AND peva.visa_type         IN ('F-1', 'F-2','M-1','M-2')
        AND peva.visa_id           = pevv.visa_id (+)
        AND pspt.passport_id (+)   = peva.passport_id
        AND peva.visa_expiry_date  >= trunc(sysdate);
Line: 5058

      p_data_rec.created_by                 := g_update_by;
Line: 5059

      p_data_rec.last_updated_by            := g_update_by;
Line: 5060

      p_data_rec.last_update_date           := sysdate;
Line: 5061

      p_data_rec.last_update_login          := g_update_login;
Line: 5137

     SELECT peva.visa_number,
            peva.visa_issuing_post,
            peva.visa_expiry_date,
            pevv.cntry_entry_form_num,
            pevv.port_of_entry,
            pevv.visit_start_date,
            pevv.remarks,
            pspt.passport_number,
            pspt.passport_cntry_code,
            pspt.passport_expiry_date,
            peva.visa_issuing_country,
	    peva.visa_issue_date
       FROM igs_pe_visa           peva,
            igs_pe_visit_histry   pevv,
            igs_pe_passport       pspt
      WHERE peva.person_id         = p_person_rec.person_id
        AND peva.visa_type         IN ('J-1', 'J-2')
        AND peva.visa_id           = pevv.visa_id (+)
        AND pspt.passport_id (+)   = peva.passport_id
        AND peva.visa_expiry_date  >= trunc(sysdate);
Line: 5208

      p_data_rec.created_by                 := g_update_by;
Line: 5209

      p_data_rec.last_updated_by            := g_update_by;
Line: 5210

      p_data_rec.last_update_date           := sysdate;
Line: 5211

      p_data_rec.last_update_login          := g_update_login;
Line: 5267

     SELECT nonimg_empl_id,
            empl_rec_type,
            empl_type,
            recommend_empl,
            rescind_empl,
            remarks,
            empl_start_date ,
            empl_end_date,
            course_relevance,
            empl_time,
            empl_name,
	    action_code
      FROM igs_sv_empl_info
      WHERE
            person_id = p_data_rec.person_id and
            nonimg_empl_id = p_data_rec.nonimg_empl_id and
	    batch_id IN
            (  SELECT max(emp.batch_id)
                 FROM igs_sv_empl_info emp,
                      igs_sv_persons pr
                WHERE emp.person_id = pr.person_id
                      AND emp.batch_id = pr.batch_id
                      AND pr.record_status <> 'E'
                      AND emp.person_id = p_data_rec.person_id
		      AND emp.nonimg_empl_id = p_data_rec.nonimg_empl_id
            )
    ORDER BY nonimg_empl_id;
Line: 5405

     SELECT visa_type
     FROM igs_pe_nonimg_form
     WHERE person_id =  p_person_rec.person_id
           AND nonimg_form_id =  p_person_rec.form_id;
Line: 5520

     SELECT nonimg_empl_id,
            frm.nonimg_form_id,
            decode ( empl_type,'01','O','02','C','F')  empl_rec_type,
            empl_type,
            recommend_empl,
            rescind_empl,
            em.remarks,
            to_char(empl_start_date, 'YYYY-MM-DD') empl_start_date,
            to_char(empl_end_date, 'YYYY-MM-DD') empl_end_date,
            course_relevance,
            empl_time,
            empl_party_id,
	    action_code,
	    NVL(em.print_flag, 'N') print_flag
       FROM igs_pe_nonimg_empl em,
            igs_pe_nonimg_form frm
      WHERE frm.person_id = cp_person_id
            AND frm.nonimg_form_id = em.nonimg_form_id
    ORDER BY nonimg_empl_id;
Line: 5542

     SELECT party_name
       FROM hz_parties
      WHERE party_id = l_party_id;
Line: 5547

     SELECT SUBSTR(address1||address2||address3||address4,1,60) addr_line1,
            SUBSTR(address1||address2||address3||address4,1,60) addr_line2,
            SUBSTR(city,1,60) city    ,
            SUBSTR(state,1,2) state   ,
            postal_code
       FROM hz_locations lc, hz_party_sites st
      WHERE party_id = l_party_id
            AND lc.location_id = st.location_id
            AND identifying_address_flag  ='Y';
Line: 5581

       p_data_rec(l_counter).created_by := g_update_by;
Line: 5582

       p_data_rec(l_counter).last_updated_by := g_update_by;
Line: 5583

       p_data_rec(l_counter).last_update_date  := sysdate;
Line: 5584

       p_data_rec(l_counter).last_update_login := g_update_login;
Line: 5702

     SELECT cr.batch_id               ,
            cr.person_id              ,
            cr.record_number          ,
            cr.form_id                ,
            decode(cr.print_form,'Y','1','0') print_form,
            cr.record_status          ,
            cr.person_number          ,
            cr.sevis_user_id          ,
            cr.issuing_reason         ,
            cr.curr_session_end_date  ,
            cr.next_session_start_date,
            cr.other_reason           ,
            cr.transfer_from_school   ,
            cr.ev_create_reason       ,
            cr.ev_form_number	      ,
	    cr.no_show_flag	      ,
	    cr.last_session_flag
       FROM igs_sv_persons cr
      WHERE cr.person_id = p_data_rec.person_id
        AND cr.batch_id IN
            (  SELECT max(mx.batch_id)
                 FROM igs_sv_persons mx
                WHERE mx.person_id = p_data_rec.person_id
                      AND mx.record_status <> 'E'
            );
Line: 5840

     SELECT birth_date             ,
            birth_cntry_code       ,
            citizen_cntry_code     ,
            last_name              ,
            middle_name            ,
            first_name             ,
            suffix                 ,
            gender                 ,
            legal_res_cntry_code   ,
            position_code          ,
            commuter               ,
            remarks		   ,
	    birth_cntry_resn_code  ,
	    birth_city
       FROM igs_sv_bio_info  cr
      WHERE cr.person_id = p_data_rec.person_id
        AND cr.batch_id IN
            (  SELECT max(prs.batch_id)
                 FROM igs_sv_bio_info prs,
                      igs_sv_persons pr
                WHERE prs.person_id = pr.person_id
                      AND prs.batch_id = pr.batch_id
                      AND pr.record_status <> 'E'
                      AND prs.person_id = p_data_rec.person_id
            );
Line: 5974

     SELECT drivers_license        ,
            drivers_license_state  ,
            ssn                    ,
            tax_id
       FROM igs_sv_oth_info cr
      WHERE cr.person_id = p_data_rec.person_id
        AND cr.batch_id IN
            (  SELECT max(prs.batch_id)
                 FROM igs_sv_oth_info prs,
                     igs_sv_persons pr
               WHERE prs.person_id = pr.person_id
                     AND prs.batch_id = pr.batch_id
                     AND pr.record_status <> 'E'
                     AND prs.person_id = p_data_rec.person_id
            );
Line: 6090

     SELECT action_type            ,
            address_type           ,
            address_line1          ,
            address_line2          ,
            city                   ,
            state                  ,
            postal_code            ,
            postal_routing_code    ,
            country_code           ,
            province               ,
            stdnt_valid_flag	   ,
	    primary_flag           ,
	    activity_site_cd   ,
		remarks
       FROM igs_sv_addresses cr
      WHERE cr.person_id = p_data_rec.person_id
        AND cr.party_site_id = p_data_rec.party_site_id
        AND cr.batch_id IN
            (  SELECT max(prs.batch_id)
                 FROM igs_sv_addresses prs,
                      igs_sv_persons pr
                WHERE prs.person_id = pr.person_id
                     AND prs.batch_id = pr.batch_id
                     AND pr.record_status <> 'E'
                     AND prs.person_id = p_data_rec.person_id
                     AND prs.party_site_id = p_data_rec.party_site_id
            );
Line: 6227

     SELECT position_code          ,
            subject_field_code     ,
            education_level        ,
            primary_major          ,
            secondary_major        ,
            minor                  ,
            length_of_study        ,
            prgm_start_date        ,
            prgm_end_date          ,
            english_reqd           ,
            english_reqd_met       ,
            not_reqd_reason        ,
            educ_lvl_remarks	   ,
	    remarks
       FROM igs_sv_prgms_info cr
      WHERE cr.person_id = p_data_rec.person_id
        AND cr.prgm_action_type='EP'
        AND cr.batch_id IN
            (  SELECT max(prs.batch_id)
                 FROM igs_sv_prgms_info prs,
                      igs_sv_persons pr
               WHERE prs.person_id = pr.person_id
                     AND prs.batch_id = pr.batch_id
                     AND pr.record_status <> 'E'
                     AND prs.person_id        = p_data_rec.person_id
                     AND prs.prgm_action_type = 'EP'
            );
Line: 6364

     SELECT acad_term_length       ,
            tuition                ,
            living_exp             ,
            personal_funds         ,
            dependent_exp          ,
            other_exp              ,
            other_exp_desc         ,
            school_funds           ,
            school_funds_desc      ,
            other_funds            ,
            other_funds_desc       ,
            program_sponsor        ,
            govt_org1              ,
            govt_org2              ,
            govt_org1_code         ,
            govt_org2_code         ,
            intl_org1              ,
            intl_org2              ,
            intl_org1_code         ,
            intl_org2_code         ,
            ev_govt                ,
            bi_natnl_com           ,
            other_org              ,
            remarks		   ,
	    govt_org1_othr_name    ,
	    govt_org2_othr_name    ,
            intl_org1_othr_name    ,
            intl_org2_othr_name    ,
	    other_govt_name	   ,
	    empl_funds
       FROM igs_sv_finance_info cr
      WHERE cr.person_id = p_data_rec.person_id
        AND cr.batch_id IN
            (  SELECT max(prs.batch_id)
                 FROM igs_sv_finance_info prs,
                     igs_sv_persons pr
               WHERE prs.person_id = pr.person_id
                     AND prs.batch_id = pr.batch_id
                     AND pr.record_status <> 'E'
                     AND prs.person_id = p_data_rec.person_id
            );
Line: 6528

     SELECT depdnt_action_type       ,
            depdnt_sevis_id        ,
            last_name              ,
            first_name             ,
            middle_name            ,
            suffix                 ,
            birth_date             ,
            gender                 ,
            birth_cntry_code       ,
            citizen_cntry_code     ,
            relationship           ,
            termination_reason     ,
            relationship_remarks   ,
            perm_res_cntry_code    ,
            termination_effect_date,
            remarks		   ,
	    birth_cntry_resn_code  ,
	    VISA_TYPE
       FROM igs_sv_depdnt_info cr
      WHERE cr.person_id = p_data_rec.person_id
        AND cr.depdnt_id = p_data_rec.depdnt_id
        AND cr.batch_id IN
            (  SELECT max(prs.batch_id)
                 FROM igs_sv_depdnt_info prs,
                     igs_sv_persons pr
               WHERE prs.person_id = pr.person_id
                     AND prs.batch_id = pr.batch_id
                     AND pr.record_status <> 'E'
                     AND prs.person_id = p_data_rec.person_id
                     AND prs.depdnt_id = p_data_rec.depdnt_id
            );
Line: 6667

     SELECT psprt_number           ,
            psprt_issuing_cntry_code,
            psprt_exp_date         ,
            visa_number            ,
            visa_issuing_post      ,
            visa_issuing_cntry_code,
            visa_expiration_date   ,
            i94_number             ,
            port_of_entry          ,
            date_of_entry          ,
            remarks		   ,
	    visa_issue_date
       FROM igs_sv_legal_info cr
      WHERE cr.person_id = p_data_rec.person_id
        AND cr.batch_id IN
            (  SELECT max(prs.batch_id)
                 FROM igs_sv_legal_info prs,
                     igs_sv_persons pr
               WHERE prs.person_id = pr.person_id
                     AND prs.batch_id = pr.batch_id
                     AND pr.record_status <> 'E'
                     AND prs.person_id = p_data_rec.person_id
            );
Line: 6789

PROCEDURE Update_Issue_Info (
   p_data_rec  IN IGS_SV_PERSONS%ROWTYPE   -- Data record
)
IS

   l_api_name CONSTANT VARCHAR(30) := 'Update_Issue_Info';
Line: 6799

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Issue_Info';
Line: 6800

   l_debug_str := 'Entering Update_Issue_Info. p_data_rec.person_id is '||p_data_rec.person_id|| ' and p_data_rec.batch_id is '||p_data_rec.batch_id;
Line: 6804

   UPDATE IGS_SV_PERSONS
      SET issuing_reason         = p_data_rec.issuing_reason,
          curr_session_end_date  = p_data_rec.curr_session_end_date ,
          next_session_start_date= p_data_rec.next_session_start_date ,
          other_reason           = p_data_rec.other_reason ,
          transfer_from_school   = p_data_rec.transfer_from_school ,
          ev_create_reason       = p_data_rec.ev_create_reason ,
          ev_form_number         = p_data_rec.ev_form_number,
          init_prgm_start_date   = p_data_rec.init_prgm_start_date,
	  no_show_flag		 = p_data_rec.no_show_flag,
	  last_session_flag	 = p_data_rec.last_session_flag,
	  adjudicated_flag       = p_data_rec.adjudicated_flag
    WHERE batch_id = p_data_rec.batch_id
      AND person_id = p_data_rec.person_id
      AND record_number = p_data_rec.record_number;
Line: 6829

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Issue_Info';
Line: 6830

	   l_debug_str := 'EXCEPTION in Update_Issue_Info. '||SQLERRM;
Line: 6837

END Update_Issue_Info;
Line: 6846

   Purpose            : Insert Bio information block.
                        (IGS_SV_BIO_INFO).

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
PROCEDURE Insert_Bio_Info(
   p_data_rec  IN  IGS_SV_BIO_INFO%ROWTYPE    -- Data record
)
IS
   l_api_name CONSTANT VARCHAR(30) := 'Insert_Bio_Info';
Line: 6865

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Bio_Info';
Line: 6866

   l_debug_str := 'Entering Insert_Bio_Info. p_data_rec.person_id is '||p_data_rec.person_id|| ' and p_data_rec.batch_id is '||p_data_rec.batch_id;
Line: 6869

    Insert_Summary_Info(p_data_rec.batch_id,
		       p_data_rec.person_id,
		       g_person_status,
		       'SV_BIO',
		       'SEND',
		       'IGS_SV_BIO_INFO',
		       '');
Line: 6876

   INSERT INTO IGS_SV_BIO_INFO (
       batch_id               ,
       person_id              ,
       print_form             ,
       birth_date             ,
       birth_cntry_code       ,
       birth_city             ,
       citizen_cntry_code     ,
       last_name              ,
       middle_name            ,
       first_name             ,
       suffix                 ,
       gender                 ,
       legal_res_cntry_code   ,
       position_code          ,
       category_code          ,
       remarks                ,
       commuter               ,
       visa_type              ,
       creation_date          ,
       created_by             ,
       last_updated_by        ,
       last_update_date       ,
       last_update_login      ,
       birth_cntry_resn_code
     ) VALUES
     (
       p_data_rec.batch_id               ,
       p_data_rec.person_id              ,
       p_data_rec.print_form             ,
       p_data_rec.birth_date             ,
       p_data_rec.birth_cntry_code       ,
       p_data_rec.birth_city             ,
       p_data_rec.citizen_cntry_code     ,
       p_data_rec.last_name              ,
       p_data_rec.middle_name            ,
       p_data_rec.first_name             ,
       p_data_rec.suffix                 ,
       p_data_rec.gender                 ,
       p_data_rec.legal_res_cntry_code   ,
       p_data_rec.position_code          ,
       p_data_rec.category_code          ,
       p_data_rec.remarks                ,
       p_data_rec.commuter               ,
       p_data_rec.visa_type              ,
       p_data_rec.creation_date          ,
       p_data_rec.created_by             ,
       p_data_rec.last_updated_by        ,
       p_data_rec.last_update_date       ,
       p_data_rec.last_update_login      ,
       p_data_rec.birth_cntry_resn_code
     );
Line: 6937

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Bio_Info';
Line: 6938

	   l_debug_str := 'EXCEPTION in Insert_Bio_Info. '||SQLERRM;
Line: 6944

END Insert_Bio_Info;
Line: 6953

   Purpose            : Insert Other information block
                        (IGS_SV_OTH_INFO)

   remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
PROCEDURE Insert_Other_Info (
   p_data_rec  IN IGS_SV_OTH_INFO%ROWTYPE    -- Data record
)
IS

   l_api_name CONSTANT VARCHAR(30) := 'Insert_Other_Info';
Line: 6973

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Other_Info';
Line: 6974

   l_debug_str := 'Entering Insert_Other_Info. p_data_rec.person_id is '||p_data_rec.person_id|| ' and p_data_rec.batch_id is '||p_data_rec.batch_id;
Line: 6977

   Insert_Summary_Info(p_data_rec.batch_id,
		       p_data_rec.person_id,
		       g_person_status,
		       'SV_OTHER',
		       'SEND',
		       'IGS_SV_OTH_INFO',
		       '');
Line: 6985

   INSERT INTO IGS_SV_OTH_INFO (
       batch_id               ,
       person_id              ,
       print_form             ,
       drivers_license        ,
       drivers_license_state  ,
       ssn                    ,
       tax_id                 ,
       creation_date          ,
       created_by             ,
       last_updated_by        ,
       last_update_date       ,
       last_update_login
      ) VALUES
      (p_data_rec.batch_id               ,
       p_data_rec.person_id              ,
       p_data_rec.print_form             ,
       p_data_rec.drivers_license        ,
       p_data_rec.drivers_license_state  ,
       p_data_rec.ssn                    ,
       p_data_rec.tax_id                 ,
       p_data_rec.creation_date          ,
       p_data_rec.created_by             ,
       p_data_rec.last_updated_by        ,
       p_data_rec.last_update_date       ,
       p_data_rec.last_update_login
      );
Line: 7022

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Other_Info';
Line: 7023

   l_debug_str := 'EXCEPTION in Insert_Other_Info. '||SQLERRM;
Line: 7030

END Insert_Other_Info;
Line: 7039

   Purpose            : Insert site of activity information.
                        (IGS_SV_ADDRESSES).

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
PROCEDURE Insert_Address_Info (
   p_addr_type IN VARCHAR,  -- Address type bein inserted- US, Foreign, Site of Activity
   p_data_rec  IN  g_address_rec_type ,  -- Data record
   p_records  IN  NUMBER   -- number of addressees found
)
IS
   l_api_name CONSTANT VARCHAR(30) := 'Insert_Address_Info';
Line: 7063

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Address_Info';
Line: 7064

   l_debug_str := 'Entering Insert_Address_Info. Number of records: '||p_records;
Line: 7077

	         l_action := 'DELETE';
Line: 7087

	   Insert_Summary_Info(l_btch_id,
				       p_data_rec(l_count).person_id,
				       l_action,
				       'SV_SOA',
				       'SEND',
				       'IGS_SV_ADDRESSES',
				       p_data_rec(l_count).party_site_id);
Line: 7098

		Insert_Summary_Info(l_btch_id,
		       p_data_rec(l_count).person_id,
		       g_person_status,
		       'SV_US_ADDR',
		       'SEND',
		       'IGS_SV_ADDRESSES',
		       p_data_rec(l_count).party_site_id);
Line: 7106

	         Insert_Summary_Info(l_btch_id,
		       p_data_rec(l_count).person_id,
		       g_person_status,
		       'SV_F_ADDR',
		       'SEND',
		       'IGS_SV_ADDRESSES',
		       p_data_rec(l_count).party_site_id);
Line: 7116

       INSERT INTO igs_sv_addresses (
       batch_id               ,
       person_id              ,
       party_site_id          ,
       print_form             ,
       address_type           ,
       address_line1          ,
       address_line2          ,
       city                   ,
       state                  ,
       postal_code            ,
       postal_routing_code    ,
       country_code           ,
       province               ,
       stdnt_valid_flag       ,
       creation_date          ,
       created_by             ,
       last_updated_by        ,
       last_update_date       ,
       last_update_login      ,
       action_type	      ,
       primary_flag           ,
       activity_site_cd       ,
       remarks
     ) VALUES (
       l_btch_id              ,
       p_data_rec(l_count).person_id              ,
       p_data_rec(l_count).party_site_id          ,
       p_data_rec(l_count).print_form             ,
       p_data_rec(l_count).address_type           ,
       p_data_rec(l_count).address_line1          ,
       p_data_rec(l_count).address_line2          ,
       p_data_rec(l_count).city                   ,
       p_data_rec(l_count).state                  ,
       p_data_rec(l_count).postal_code            ,
       p_data_rec(l_count).postal_routing_code    ,
       p_data_rec(l_count).country_code           ,
       p_data_rec(l_count).province               ,
       p_data_rec(l_count).stdnt_valid_flag       ,
       p_data_rec(l_count).creation_date          ,
       p_data_rec(l_count).created_by             ,
       p_data_rec(l_count).last_updated_by        ,
       p_data_rec(l_count).last_update_date       ,
       p_data_rec(l_count).last_update_login	  ,
       p_data_rec(l_count).action_type		  ,
       p_data_rec(l_count).primary_flag           ,
       p_data_rec(l_count).activity_site_cd       ,
       l_remarks
     );
Line: 7178

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Address_Info';
Line: 7179

	   l_debug_str := 'EXCEPTION in Insert_Address_Info. '||SQLERRM;
Line: 7185

END Insert_Address_Info;
Line: 7194

   Purpose            : Insert education information on the student
                        (IGS_SV_PRGMS_INFO).

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
PROCEDURE Insert_Edu_Info (
   p_edu_type  IN VARCHAR2,
   p_data_rec  IN IGS_SV_PRGMS_INFO%ROWTYPE,
   p_auth_drp_data_rec IN IGS_SV_PRGMS_INFO%ROWTYPE
)
IS

   l_api_name CONSTANT VARCHAR(30) := 'Insert_Edu_Info';
Line: 7237

	l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Edu_Info';
Line: 7238

	l_debug_str := 'Entering Insert_Edu_Info. p_data_rec.person_id is '||p_data_rec.person_id|| ' and p_data_rec.batch_id is '||p_data_rec.batch_id;
Line: 7258

	l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Edu_Info';
Line: 7335

	   Insert_Summary_Info(l_btch_id,
			       p_data_rec.person_id,
			       l_action,
			       l_tag_code,
			       'SEND',
			       'IGS_SV_PRGMS_INFO',
			       p_data_rec.prgm_action_type);
Line: 7368

		l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Edu_Info';
Line: 7383

	  Insert_Summary_Info(l_btch_id,
			       p_data_rec.person_id,
			       l_action,
			       'SV_PRGMS',
			       'SEND',
			       'IGS_SV_PRGMS_INFO',
			       p_data_rec.prgm_action_type);
Line: 7391

	   INSERT INTO igs_sv_prgms_info (
		batch_id               ,
		person_id              ,
		prgm_action_type       ,
		print_form             ,
		form_status_id         ,
		position_code          ,
		subject_field_code     ,
		education_level        ,
		primary_major          ,
		secondary_major        ,
		educ_lvl_remarks       ,
		minor                  ,
		length_of_study        ,
		prgm_start_date        ,
		prgm_end_date          ,
		english_reqd           ,
		english_reqd_met       ,
		not_reqd_reason        ,
		matriculation          ,
		effective_date         ,
		authorization_reason   ,
		termination_reason     ,
		end_prgm_reason        ,
		reprint_reason         ,
		submit_update          ,
		remarks                ,
		creation_date          ,
		created_by             ,
		last_updated_by        ,
		last_update_date       ,
		last_update_login      ,
		auth_action_code
	      ) VALUES
	      ( l_btch_id                        ,
	       p_data_rec.person_id              ,
	       p_data_rec.prgm_action_type       ,
	       p_data_rec.print_form             ,
	       p_data_rec.form_status_id         ,
	       l_position_code          ,
	       l_subject_field_code     ,
	       l_education_level        ,
	       l_primary_major          ,
	       l_secondary_major        ,
	       l_educ_lvl_remarks       ,
	       l_minor                  ,
	       l_length_of_study        ,
	       l_prgm_start_date        ,
	       l_prgm_end_date          ,
	       l_english_reqd           ,
	       l_english_reqd_met       ,
	       l_not_reqd_reason        ,
	       p_data_rec.matriculation          ,
	       p_data_rec.effective_date         ,
	       p_data_rec.authorization_reason   ,
	       p_data_rec.termination_reason     ,
	       p_data_rec.end_prgm_reason        ,
	       p_data_rec.reprint_reason         ,
	       p_data_rec.submit_update          ,
	       l_remarks                ,
	       p_data_rec.creation_date          ,
	       p_data_rec.created_by             ,
	       p_data_rec.last_updated_by        ,
	       p_data_rec.last_update_date       ,
	       p_data_rec.last_update_login      ,
	       p_data_rec.auth_action_code
	      );
Line: 7461

	l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Edu_Info';
Line: 7462

	l_debug_str := 'Record inserted';
Line: 7475

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Edu_Info';
Line: 7476

   l_debug_str := 'EXCEPTION in Insert_Edu_Info. '||SQLERRM;
Line: 7483

END Insert_Edu_Info;
Line: 7491

   Purpose            : Insert Finance information on the student
                        (IGS_SV_FINANCE_INFO)

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
PROCEDURE Insert_Finance_Info (
   p_data_rec  IN IGS_SV_FINANCE_INFO %ROWTYPE    -- Data record
)
IS

   l_api_name CONSTANT VARCHAR(30) := 'Insert_Finance_Info';
Line: 7511

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Finance_Info';
Line: 7512

   l_debug_str := 'Entering Insert_Finance_Info. p_data_rec.person_id is '||p_data_rec.person_id|| ' and p_data_rec.batch_id is '||p_data_rec.batch_id;
Line: 7515

   Insert_Summary_Info(p_data_rec.batch_id,
		       p_data_rec.person_id,
		       g_person_status,
		       'SV_FINANCIAL',
		       'SEND',
		       'IGS_SV_FINANCE_INFO',
		       '');
Line: 7522

   INSERT INTO igs_sv_finance_info (
       batch_id               ,
       person_id              ,
       print_form             ,
       acad_term_length       ,
       tuition                ,
       living_exp             ,
       personal_funds         ,
       dependent_exp          ,
       other_exp              ,
       other_exp_desc         ,
       school_funds           ,
       school_funds_desc      ,
       other_funds            ,
       other_funds_desc       ,
       program_sponsor        ,
       govt_org1              ,
       govt_org2              ,
       govt_org1_code         ,
       govt_org2_code         ,
       intl_org1              ,
       intl_org2              ,
       intl_org1_code         ,
       intl_org2_code         ,
       ev_govt                ,
       bi_natnl_com           ,
       other_org              ,
       recvd_us_gvt_funds     ,
       remarks                ,
       creation_date          ,
       created_by             ,
       last_updated_by        ,
       last_update_date       ,
       last_update_login      ,
       govt_org1_othr_name    ,
       govt_org2_othr_name    ,
       intl_org1_othr_name    ,
       intl_org2_othr_name    ,
       other_govt_name	      ,
       empl_funds
      ) VALUES
      (p_data_rec.batch_id               ,
       p_data_rec.person_id              ,
       p_data_rec.print_form             ,
       p_data_rec.acad_term_length       ,
       p_data_rec.tuition                ,
       p_data_rec.living_exp             ,
       p_data_rec.personal_funds         ,
       p_data_rec.dependent_exp          ,
       p_data_rec.other_exp              ,
       p_data_rec.other_exp_desc         ,
       p_data_rec.school_funds           ,
       p_data_rec.school_funds_desc      ,
       p_data_rec.other_funds            ,
       p_data_rec.other_funds_desc       ,
       p_data_rec.program_sponsor        ,
       p_data_rec.govt_org1              ,
       p_data_rec.govt_org2              ,
       p_data_rec.govt_org1_code         ,
       p_data_rec.govt_org2_code         ,
       p_data_rec.intl_org1              ,
       p_data_rec.intl_org2              ,
       p_data_rec.intl_org1_code         ,
       p_data_rec.intl_org2_code         ,
       p_data_rec.ev_govt                ,
       p_data_rec.bi_natnl_com           ,
       p_data_rec.other_org              ,
       p_data_rec.recvd_us_gvt_funds     ,
       p_data_rec.remarks                ,
       p_data_rec.creation_date          ,
       p_data_rec.created_by             ,
       p_data_rec.last_updated_by        ,
       p_data_rec.last_update_date       ,
       p_data_rec.last_update_login	 ,
       p_data_rec.govt_org1_othr_name    ,
       p_data_rec.govt_org2_othr_name    ,
       p_data_rec.intl_org1_othr_name    ,
       p_data_rec.intl_org2_othr_name    ,
       p_data_rec.other_govt_name	 ,
       p_data_rec.empl_funds
      );
Line: 7613

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Finance_Info';
Line: 7614

   l_debug_str := 'EXCEPTION in Insert_Finance_Info. '||SQLERRM;
Line: 7621

END Insert_Finance_Info;
Line: 7630

   Purpose            : Insert dependent information on the student
                        (IGS_SV_DEPDNT_INFO).

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
PROCEDURE Insert_Dependent_Info (
   p_data_rec  IN g_dependent_rec_type,    -- Data record
   p_records   IN NUMBER    --Number  of dependents found
)
IS

   l_api_name CONSTANT VARCHAR(30) := 'Insert_Dependent_Info';
Line: 7654

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Dependent_Info';
Line: 7655

   l_debug_str := 'Entering Insert_Dependent_Info.Number of records being inserted: '||p_records;
Line: 7678

	      l_action := 'DELETE';
Line: 7685

	   Insert_Summary_Info(l_btch_id,
				       p_data_rec(l_count).person_id,
				       l_action,
				       'SV_DEPDNT',
				       'SEND',
				       'IGS_SV_DEPDNT_INFO',
				       p_data_rec(l_count).depdnt_id);
Line: 7693

       INSERT INTO igs_sv_depdnt_info (
          batch_id               ,
          person_id              ,
          depdnt_id              ,
          print_form             ,
          person_number          ,
          depdnt_action_type     ,
          depdnt_sevis_id        ,
          visa_type              ,
          last_name              ,
          first_name             ,
          middle_name            ,
          suffix                 ,
          birth_date             ,
          gender                 ,
          birth_cntry_code       ,
          citizen_cntry_code     ,
          relationship           ,
          termination_reason     ,
          relationship_remarks   ,
          perm_res_cntry_code    ,
          termination_effect_date,
          remarks                ,
          creation_date          ,
          created_by             ,
          last_updated_by        ,
          last_update_date       ,
          last_update_login	 ,
	  birth_cntry_resn_code
         ) VALUES
         (l_btch_id              ,  -- prbhardw CP enhancement
          p_data_rec(l_count).person_id              ,
          p_data_rec(l_count).depdnt_id              ,
          p_data_rec(l_count).print_form             ,
          p_data_rec(l_count).person_number          ,
          p_data_rec(l_count).depdnt_action_type     ,
          p_data_rec(l_count).depdnt_sevis_id        ,
          p_data_rec(l_count).visa_type              ,
          p_data_rec(l_count).last_name              ,
          p_data_rec(l_count).first_name             ,
          p_data_rec(l_count).middle_name            ,
          p_data_rec(l_count).suffix                 ,
          p_data_rec(l_count).birth_date             ,
          p_data_rec(l_count).gender                 ,
          p_data_rec(l_count).birth_cntry_code       ,
          p_data_rec(l_count).citizen_cntry_code     ,
          p_data_rec(l_count).relationship           ,
          p_data_rec(l_count).termination_reason     ,
          p_data_rec(l_count).relationship_remarks   ,
          p_data_rec(l_count).perm_res_cntry_code    ,
          p_data_rec(l_count).termination_effect_date,
          p_data_rec(l_count).remarks                ,
          p_data_rec(l_count).creation_date          ,
          p_data_rec(l_count).created_by             ,
          p_data_rec(l_count).last_updated_by        ,
          p_data_rec(l_count).last_update_date       ,
          p_data_rec(l_count).last_update_login	     ,
	  p_data_rec(l_count).birth_cntry_resn_code
         );
Line: 7763

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Dependent_Info';
Line: 7764

	   l_debug_str := 'EXCEPTION in Insert_Dependent_Info. '||SQLERRM;
Line: 7771

END Insert_Dependent_Info;
Line: 7774

PROCEDURE Insert_Dependent_Info (
   p_data_rec  IN IGS_SV_DEPDNT_INFO%ROWTYPE --g_dependent_rec_type,    -- Data record
  -- p_records   IN NUMBER    --Number  of dependents found
)
IS

   l_api_name CONSTANT VARCHAR(30) := 'Insert_Dependent_Info';
Line: 7788

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Dependent_Info';
Line: 7789

   l_debug_str := 'Entering Insert_Dependent_Info.';
Line: 7811

	      l_action := 'DELETE';
Line: 7818

	   Insert_Summary_Info(l_btch_id,
				       p_data_rec.person_id,
				       l_action,
				       'SV_DEPDNT',
				       'SEND',
				       'IGS_SV_DEPDNT_INFO',
				       p_data_rec.depdnt_id);
Line: 7826

       INSERT INTO igs_sv_depdnt_info (
          batch_id               ,
          person_id              ,
          depdnt_id              ,
          print_form             ,
          person_number          ,
          depdnt_action_type     ,
          depdnt_sevis_id        ,
          visa_type              ,
          last_name              ,
          first_name             ,
          middle_name            ,
          suffix                 ,
          birth_date             ,
          gender                 ,
          birth_cntry_code       ,
          citizen_cntry_code     ,
          relationship           ,
          termination_reason     ,
          relationship_remarks   ,
          perm_res_cntry_code    ,
          termination_effect_date,
          remarks                ,
          creation_date          ,
          created_by             ,
          last_updated_by        ,
          last_update_date       ,
          last_update_login	 ,
	  birth_cntry_resn_code
         ) VALUES
         (l_btch_id              ,  -- prbhardw CP enhancement
          p_data_rec.person_id              ,
          p_data_rec.depdnt_id              ,
          p_data_rec.print_form             ,
          p_data_rec.person_number          ,
          p_data_rec.depdnt_action_type     ,
          p_data_rec.depdnt_sevis_id        ,
          p_data_rec.visa_type              ,
          p_data_rec.last_name              ,
          p_data_rec.first_name             ,
          p_data_rec.middle_name            ,
          p_data_rec.suffix                 ,
          p_data_rec.birth_date             ,
          p_data_rec.gender                 ,
          p_data_rec.birth_cntry_code       ,
          p_data_rec.citizen_cntry_code     ,
          p_data_rec.relationship           ,
          p_data_rec.termination_reason     ,
          p_data_rec.relationship_remarks   ,
          p_data_rec.perm_res_cntry_code    ,
          p_data_rec.termination_effect_date,
          p_data_rec.remarks                ,
          p_data_rec.creation_date          ,
          p_data_rec.created_by             ,
          p_data_rec.last_updated_by        ,
          p_data_rec.last_update_date       ,
          p_data_rec.last_update_login	     ,
	  p_data_rec.birth_cntry_resn_code
         );
Line: 7895

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Dependent_Info';
Line: 7896

	   l_debug_str := 'EXCEPTION in Insert_Dependent_Info. '||SQLERRM;
Line: 7903

END Insert_Dependent_Info;
Line: 7910

   Purpose            : Insert Conviction information on the student.
                        (IGS_SV_CONVICTIONS).

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
PROCEDURE Insert_Convictions_Info (
   p_data_rec  IN IGS_SV_CONVICTIONS%ROWTYPE
) IS

   l_api_name CONSTANT VARCHAR(30) := 'Insert_Convictions_Info';
Line: 7930

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Convictions_Info';
Line: 7931

	   l_debug_str := 'Entering Insert_Convictions_Info. p_data_rec.person_id is '||p_data_rec.person_id|| ' and p_data_rec.batch_id is '||p_data_rec.batch_id;
Line: 7934

       Insert_Summary_Info(p_data_rec.batch_id,
		       p_data_rec.person_id,
		       g_person_status,
		       'SV_CONVICTION',
		       'SEND',
		       'IGS_SV_CONVICTIONS',
		       '');
Line: 7941

       INSERT INTO igs_sv_convictions (
        batch_id               ,
        person_id              ,
        conviction_id          ,
        print_form             ,
        criminal_conviction    ,
        remarks                ,
        creation_date          ,
        created_by             ,
        last_updated_by        ,
        last_update_date       ,
        last_update_login
       ) VALUES
       (p_data_rec.batch_id               ,
        p_data_rec.person_id              ,
        p_data_rec.conviction_id          ,
        p_data_rec.print_form             ,
        p_data_rec.criminal_conviction    ,
        p_data_rec.remarks                ,
        p_data_rec.creation_date          ,
        p_data_rec.created_by             ,
        p_data_rec.last_updated_by        ,
        p_data_rec.last_update_date       ,
        p_data_rec.last_update_login
       );
Line: 7976

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Convictions_Info';
Line: 7977

	   l_debug_str := 'EXCEPTION in Insert_Convictions_Info. '||SQLERRM;
Line: 7984

END Insert_Convictions_Info;
Line: 7991

   Purpose            : Insert Legal information on the student.
                        (IGS_SV_LEGAL_INFO).

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
PROCEDURE Insert_Legal_Info (
   p_data_rec   IN IGS_SV_LEGAL_INFO%ROWTYPE    -- Data record
)
IS
   l_api_name CONSTANT VARCHAR(30) := 'Insert_Legal_Info';
Line: 8010

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Legal_Info';
Line: 8011

	   l_debug_str := 'Entering Insert_Legal_Info. p_data_rec.person_id is '||p_data_rec.person_id|| ' and p_data_rec.batch_id is '||p_data_rec.batch_id;
Line: 8014

   Insert_Summary_Info(p_data_rec.batch_id,
		       p_data_rec.person_id,
		       g_legal_status, --g_person_status, commented for bug 5253779
		       'SV_LEGAL',
		       'SEND',
		       'IGS_SV_LEGAL_INFO',
		       '');
Line: 8021

   INSERT INTO igs_sv_legal_info (
       batch_id               ,
       person_id              ,
       print_form             ,
       psprt_number           ,
       psprt_issuing_cntry_code,
       psprt_exp_date         ,
       visa_number            ,
       visa_issuing_post      ,
       visa_issuing_cntry_code,
       visa_expiration_date   ,
       i94_number             ,
       port_of_entry          ,
       date_of_entry          ,
       remarks                ,
       creation_date          ,
       created_by             ,
       last_updated_by        ,
       last_update_date       ,
       last_update_login      ,
       VISA_ISSUE_DATE
      ) VALUES
      (p_data_rec.batch_id               ,
       p_data_rec.person_id              ,
       p_data_rec.print_form             ,
       p_data_rec.psprt_number           ,
       p_data_rec.psprt_issuing_cntry_code,
       p_data_rec.psprt_exp_date         ,
       p_data_rec.visa_number            ,
       p_data_rec.visa_issuing_post      ,
       p_data_rec.visa_issuing_cntry_code,
       p_data_rec.visa_expiration_date   ,
       p_data_rec.i94_number             ,
       p_data_rec.port_of_entry          ,
       p_data_rec.date_of_entry          ,
       p_data_rec.remarks                ,
       p_data_rec.creation_date          ,
       p_data_rec.created_by             ,
       p_data_rec.last_updated_by        ,
       p_data_rec.last_update_date       ,
       p_data_rec.last_update_login      ,
       p_data_rec.VISA_ISSUE_DATE
      );
Line: 8074

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Legal_Info';
Line: 8075

   l_debug_str := 'EXCEPTION in Insert_Legal_Info. '||SQLERRM;
Line: 8082

END Insert_Legal_Info;
Line: 8089

   Purpose            : Insert employment information on the student
                        (IGS_SV_EMPL_INFO).

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
PROCEDURE Insert_Empl_Info (
   p_data_rec      IN IGS_SV_EMPL_INFO%ROWTYPE     --Data record
)
IS
   l_api_name CONSTANT VARCHAR(30) := 'Insert_Empl_Info';
Line: 8110

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Empl_Info';
Line: 8111

   l_debug_str := 'Entering Insert_Empl_Info. p_data_rec.person_id is '||p_data_rec.person_id|| ' and p_data_rec.batch_id is '||p_data_rec.batch_id;
Line: 8135

   Insert_Summary_Info(l_btch_id,
			       p_data_rec.person_id,
			       l_action,
			       l_tag_code,
			       'SEND',
			       'IGS_SV_EMPL_INFO',
			       p_data_rec.nonimg_empl_id);
Line: 8144

          l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Employment_Info';
Line: 8149

   INSERT INTO igs_sv_empl_info (
       batch_id               ,
       person_id              ,
       nonimg_empl_id         ,
       empl_rec_type          ,
       print_form             ,
       empl_type              ,
       recommend_empl         ,
       rescind_empl           ,
       remarks                ,
       empl_start_date        ,
       empl_end_date          ,
       empl_name              ,
       empl_time              ,
       course_relevance       ,
       empl_addr_line1        ,
       empl_addr_line2        ,
       city                   ,
       state                  ,
       postal_code            ,
       creation_date          ,
       created_by             ,
       last_updated_by        ,
       last_update_date       ,
       last_update_login      ,
       action_code
      ) VALUES
      (l_btch_id               ,    --- prbhardw CP enhancement
       p_data_rec.person_id              ,
       p_data_rec.nonimg_empl_id         ,
       p_data_rec.empl_rec_type          ,
       p_data_rec.print_form             ,
       p_data_rec.empl_type              ,
       p_data_rec.recommend_empl         ,
       p_data_rec.rescind_empl           ,
       p_data_rec.remarks                ,
       p_data_rec.empl_start_date        ,
       p_data_rec.empl_end_date          ,
       p_data_rec.empl_name              ,
       p_data_rec.empl_time              ,
       p_data_rec.course_relevance       ,
       p_data_rec.empl_addr_line1        ,
       p_data_rec.empl_addr_line2        ,
       p_data_rec.city                   ,
       p_data_rec.state                  ,
       p_data_rec.postal_code            ,
       p_data_rec.creation_date          ,
       p_data_rec.created_by             ,
       p_data_rec.last_updated_by        ,
       p_data_rec.last_update_date       ,
       p_data_rec.last_update_login	 ,
       p_data_rec.action_code
      );
Line: 8211

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Empl_Info';
Line: 8212

   l_debug_str := 'EXCEPTION in Insert_Empl_Info. '||SQLERRM;
Line: 8219

END Insert_Empl_Info;
Line: 8228

   Purpose            : Update registration block information.

   remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
FUNCTION Update_Registration_Info (
   p_person_rec      IN OUT NOCOPY t_student_rec    --Person record
) RETURN VARCHAR2
IS

   l_api_name    CONSTANT VARCHAR2(30)   := 'Update_Registration_Info';
Line: 8252

     SELECT pr.curr_session_end_date,
            pr.next_session_start_date,
	    pr.last_session_flag
       FROM igs_sv_persons pr
      WHERE pr.person_id = p_person_rec.person_id
        AND pr.batch_id IN
            ( SELECT max(btch.batch_id)
                FROM igs_sv_persons prs,
                     igs_sv_batches btch,
                     igs_sv_persons pr
               WHERE prs.person_id = pr.person_id
                     AND prs.batch_id = pr.batch_id
                     AND pr.record_status <> 'E'
                     AND prs.batch_id = btch.batch_id
                     AND btch.batch_type = p_person_rec.batch_type
                     AND prs.person_id = p_person_rec.person_id
                     AND pr.curr_session_end_date  IS NOT NULL
            );
Line: 8273

     SELECT to_char(curr_session_end_date,'YYYY-MM-DD') ,
            to_char(next_session_start_date ,'YYYY-MM-DD'),
	    last_session_flag
       FROM igs_pe_nonimg_form
      WHERE nonimg_form_id = p_person_rec.form_id;
Line: 8293

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Registration_Info';
Line: 8294

   l_debug_str := 'Entering Update_Registration_Info. p_person_rec.person_id is '||p_person_rec.person_id|| ' and p_person_rec.batch_type is '||p_person_rec.batch_type;
Line: 8331

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Registration_Info';
Line: 8332

	   l_debug_str := 'Returning S from Update_Registration_Info.';
Line: 8343

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Registration_Info';
Line: 8344

	   l_debug_str := 'Unexpected error in Update_Registration_Info.';
Line: 8361

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Registration_Info';
Line: 8362

	   l_debug_str := 'RAISE FND_API.G_EXC_ERROR in Update_Registration_Info.';
Line: 8403

          Insert_Legal_Info ( p_data_rec  => l_cur_rec);
Line: 8431

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Registration_Info';
Line: 8432

	   l_debug_str := 'Returning S from Update_Registration_Info.';
Line: 8441

      UPDATE igs_sv_persons
         SET curr_session_end_date = l_start_date,
             next_session_start_date = l_end_date,
	     last_session_flag = l_last_session_flag		---prbhardw
       WHERE person_id = p_person_rec.person_id and
             batch_id  = p_person_rec.batch_id;
Line: 8468

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Registration_Info';
Line: 8469

	   l_debug_str := 'Returning S from Update_Registration_Info.';
Line: 8492

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Registration_Info';
Line: 8493

	   l_debug_str := 'Returning S from Update_Registration_Info.';
Line: 8514

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Registration_Info';
Line: 8515

	   l_debug_str := 'FND_API.G_EXC_ERROR: Returning U from Update_Registration_Info. '||SQLERRM;
Line: 8529

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Registration_Info';
Line: 8530

	   l_debug_str := 'EXCEPTION: Returning U from Update_Registration_Info. '||SQLERRM;
Line: 8535

END Update_Registration_Info;
Line: 8538

FUNCTION Update_ev_Legal_Info (
   p_person_rec      IN OUT NOCOPY t_student_rec    --Person record
) RETURN VARCHAR2
IS

   l_api_name    CONSTANT VARCHAR2(30)   := 'Update_ev_Legal_Info';
Line: 8557

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_ev_Legal_Info';
Line: 8558

   l_debug_str := 'Entering Update_ev_Legal_Info. p_person_rec.person_id is '||p_person_rec.person_id|| ' and p_person_rec.batch_type is '||p_person_rec.batch_type;
Line: 8576

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_ev_Legal_Info';
Line: 8577

	   l_debug_str := 'Returning S from Update_ev_Legal_Info.';
Line: 8588

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_ev_Legal_Info';
Line: 8589

	   l_debug_str := 'Unexpected error in Update_ev_Legal_Info.';
Line: 8605

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_ev_Legal_Info';
Line: 8606

	   l_debug_str := 'RAISE FND_API.G_EXC_ERROR in Update_ev_Legal_Info.';
Line: 8679

          Insert_Legal_Info ( p_data_rec  => l_cur_rec);
Line: 8699

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_ev_Legal_Info';
Line: 8700

	   l_debug_str := 'FND_API.G_EXC_ERROR: Returning U from Update_ev_Legal_Info. '||SQLERRM;
Line: 8714

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_ev_Legal_Info';
Line: 8715

	   l_debug_str := 'EXCEPTION: Returning U from Update_ev_Legal_Info. '||SQLERRM;
Line: 8720

END Update_ev_Legal_Info;
Line: 8727

   Purpose            : Update registration block information.

   remarks            :

   Change History
   Who                  When            What
   pkpatel              30-JUN-2003     Bug 2908378
                                        Checked the status of Get_Address_Info properly.
------------------------------------------------------------------------

******************************************************************/
FUNCTION Update_EV_Address_Info (
   p_person_rec      IN OUT NOCOPY t_student_rec    --Person record
) RETURN VARCHAR2
IS

   l_api_name    CONSTANT VARCHAR2(30)   := 'Update_EV_Address_Info';
Line: 8749

     SELECT is_valid
       FROM igs_pe_ev_form
      WHERE ev_form_id = p_person_rec.form_id;
Line: 8773

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Address_Info';
Line: 8774

   l_debug_str := 'Entering Update_EV_Address_Info. p_person_rec.form_id is '||p_person_rec.form_id;
Line: 8799

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Address_Info';
Line: 8800

	   l_debug_str := 'Returning S from Update_EV_Address_Info.';
Line: 8811

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Address_Info';
Line: 8812

	   l_debug_str := 'Unexpected error in Update_EV_Address_Info.';
Line: 8828

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Address_Info';
Line: 8829

	   l_debug_str := 'Returning S from Update_EV_Address_Info.';
Line: 8887

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Address_Info';
Line: 8888

	   l_debug_str := 'RAISE FND_API.G_EXC_ERROR in Update_EV_Address_Info.';
Line: 8896

      Insert_Address_Info ('US', p_data_rec  => l_us_addr_rec,p_records => 1);
Line: 8912

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Address_Info';
Line: 8913

	   l_debug_str := 'Returning S from Update_EV_Address_Info. us_addr_status is E';
Line: 8924

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Address_Info';
Line: 8925

	   l_debug_str := 'ERROR in Update_EV_Address_Info. us_addr_status is U';
Line: 8936

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Address_Info';
Line: 8937

	   l_debug_str := 'Returning S from Update_EV_Address_Info. us_addr_status is N';
Line: 9046

		    l_site_addr_rec(l_cur).batch_id :=NULL;  -- delete from insert
Line: 9054

		   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Address_Info';
Line: 9055

		   l_debug_str := 'RAISE FND_API.G_EXC_ERROR in Update_EV_Address_Info.';
Line: 9067

		   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Address_Info';
Line: 9068

		   l_debug_str := 'changes_found is Y. Exiting Update_EV_Address_Info.';
Line: 9079

        Insert_Address_Info ('SOA', p_data_rec  => l_site_addr_rec,p_records => l_count);
Line: 9088

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Address_Info';
Line: 9089

   l_debug_str := 'Returning S from Update_EV_Address_Info.';
Line: 9102

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Address_Info';
Line: 9103

	   l_debug_str := 'FND_API.G_EXC_ERROR: Returning U from Update_EV_Address_Info. '||SQLERRM;
Line: 9117

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Address_Info';
Line: 9118

	   l_debug_str := 'EXCEPTION: Returning U from Update_EV_Address_Info. '||SQLERRM;
Line: 9124

END Update_EV_Address_Info;
Line: 9133

   Purpose            : Update Personal information block.

   Remarks            : 'S' - success
                        'U' - Unexpected error

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
FUNCTION Update_Personal_Info (
   p_person_rec      IN OUT NOCOPY  t_student_rec    --Person record
) RETURN VARCHAR2
IS

   l_api_name    CONSTANT VARCHAR2(30)   := 'Update_Personal_Info';
Line: 9166

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Personal_Info';
Line: 9167

   l_debug_str := 'Entering Update_Personal_Info. p_person_rec.person_id is '||p_person_rec.person_id;
Line: 9216

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Personal_Info';
Line: 9217

	   l_debug_str := 'Returning S from Update_Personal_Info.';
Line: 9233

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Personal_Info';
Line: 9234

	   l_debug_str := 'RAISE FND_API.G_EXC_ERROR in Update_Personal_Info.';
Line: 9247

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Personal_Info';
Line: 9248

	   l_debug_str := 'IGS_SV_UNEXP_EXCPT_ERR in Update_Personal_Info. bio_status is N';
Line: 9270

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Personal_Info';
Line: 9271

	   l_debug_str := 'FND_API.G_EXC_ERROR in Update_Personal_Info. l_status is U';
Line: 9312

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Personal_Info';
Line: 9356

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Personal_Info';
Line: 9357

	   l_debug_str := 'FND_API.G_EXC_ERROR in Update_Personal_Info.';
Line: 9419

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Personal_Info';
Line: 9420

	   l_debug_str := 'FND_API.G_EXC_ERROR in Update_Personal_Info. f_addr_status is S';
Line: 9480

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Personal_Info';
Line: 9481

	   l_debug_str := 'FND_API.G_EXC_ERROR in Update_Personal_Info. us_addr_status is S';
Line: 9499

      Put_Log_Msg('Info is chnaged for the block - do insert',0);
Line: 9503

          Insert_Bio_Info ( p_data_rec  => l_bio_rec);
Line: 9508

         Insert_Other_Info ( p_data_rec  => l_oth_rec);
Line: 9514

         Insert_Address_Info ('F', p_data_rec  => l_f_addr_rec,p_records => 1);   --- prbhardw CP enhancement
Line: 9520

         Insert_Address_Info ( 'US',p_data_rec  => l_us_addr_rec,p_records => 1);   --- prbhardw CP enhancement
Line: 9529

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Personal_Info';
Line: 9530

   l_debug_str := 'Returning S from Update_Personal_Info.';
Line: 9543

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Personal_Info';
Line: 9544

	   l_debug_str := 'FND_API.G_EXC_ERROR: Returning U from Update_Personal_Info. '||SQLERRM;
Line: 9558

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Personal_Info';
Line: 9559

	   l_debug_str := 'EXCEPTION: Returning U from Update_Personal_Info. '||SQLERRM;
Line: 9564

END Update_Personal_Info;
Line: 9574

     SELECT  prgm_action_type,
	   prgm_start_date,
	   prgm_end_date ,
	   effective_date,
	   termination_reason,
	   end_prgm_reason,
	   remarks
     FROM igs_sv_prgms_info
     WHERE person_id = p_data_rec.person_id AND
            batch_id IN
            (  SELECT max(prg.batch_id)
                 FROM igs_sv_prgms_info prg,
                      igs_sv_persons pr
                WHERE prg.person_id = pr.person_id
                      AND prg.batch_id = pr.batch_id
                      AND pr.record_status <> 'E'
                      AND prg.person_id = p_data_rec.person_id
            )
     ORDER BY effective_date;
Line: 9675

     SELECT effective_date,
	   prgm_action_type,
	   prgm_start_date,
	   prgm_end_date,
	   remarks,
	   termination_reason,
	   print_form
     FROM igs_sv_prgms_info
     WHERE person_id = p_data_rec.person_id AND
            batch_id IN
            (  SELECT max(prg.batch_id)
                 FROM igs_sv_prgms_info prg,
                      igs_sv_persons pr
                WHERE prg.person_id = pr.person_id
                      AND prg.batch_id = pr.batch_id
                      AND pr.record_status <> 'E'
                      AND prg.person_id = p_data_rec.person_id
            )
     ORDER BY effective_date;
Line: 9772

   Purpose            : Update program information block

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
FUNCTION Update_Program_Info (
   p_person_rec      IN OUT NOCOPY  t_student_rec    --Person record
) RETURN VARCHAR2
IS

   l_api_name   CONSTANT VARCHAR2(30)   := 'Update_Program_Info';
Line: 9799

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Program_Info';
Line: 9800

   l_debug_str := 'Entering Update_Program_Info. p_person_rec.person_id is '||p_person_rec.person_id;
Line: 9816

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Program_Info';
Line: 9817

	   l_debug_str := 'Returning S from Update_Program_Info. p_person_rec.edu_status is E';
Line: 9830

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Program_Info';
Line: 9831

	   l_debug_str := 'RAISE FND_API.G_EXC_ERROR in Update_Program_Info. p_person_rec.edu_status is U';
Line: 9844

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Program_Info';
Line: 9845

	   l_debug_str := 'RAISE FND_API.G_EXC_ERROR in Update_Program_Info. p_person_rec.edu_status is N.';
Line: 9866

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Program_Info';
Line: 9867

	   l_debug_str := 'RAISE FND_API.G_EXC_ERROR in Update_Program_Info. l_status is U or N.';
Line: 9911

        Insert_Edu_Info ( 'EDU', p_data_rec  => l_cur_rec, p_auth_drp_data_rec => NULL);
Line: 9927

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Program_Info';
Line: 9928

	   l_debug_str := 'Returning S from Update_Program_Info.';
Line: 9939

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Program_Info';
Line: 9940

	   l_debug_str := 'RAISE FND_API.G_EXC_ERROR in Update_Program_Info.';
Line: 9960

          l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Employment_Info';
Line: 9961

          l_debug_str := 'Unexpected error in Update_Employment_Info. l_status is U.';
Line: 9991

      ELSE   --Remove current person from the insert list
        l_cur_prgm_rec(l_current).person_id := NULL;
Line: 9996

	Insert_Edu_Info ('PRGM', p_data_rec  => l_cur_prgm_rec(l_current), p_auth_drp_data_rec => NULL);  -- prbhardw EN change
Line: 10004

	    Put_Log_Msg('validating Authorization. going to insert record',0);
Line: 10008

	     Insert_Auth_Code (p_auth_drp_data_rec => l_cur_authdrp_rec(l_current));
Line: 10015

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Program_Info';
Line: 10016

	   l_debug_str := 'Final Return S from Update_Program_Info.';
Line: 10029

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Program_Info';
Line: 10030

	   l_debug_str := 'FND_API.G_EXC_ERROR: Returning U from Update_Program_Info. '||SQLERRM;
Line: 10044

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Program_Info';
Line: 10045

	   l_debug_str := 'EXCEPTION: Returning U from Update_Program_Info. '||SQLERRM;
Line: 10051

END Update_Program_Info;
Line: 10060

   Purpose            : Update EV program information block

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
FUNCTION Update_EV_Program_Info (
   p_person_rec      IN OUT NOCOPY  t_student_rec    --Person record
) RETURN VARCHAR2
IS

   l_api_name   CONSTANT VARCHAR2(30)   := 'Update_EV_Program_Info';
Line: 10087

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Program_Info';
Line: 10088

   l_debug_str := 'Entering Update_EV_Program_Info. p_person_rec.person_id is '||p_person_rec.person_id;
Line: 10103

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Program_Info';
Line: 10104

	   l_debug_str := 'Returning S from Update_Program_Info. p_person_rec.edu_status is E';
Line: 10117

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Program_Info';
Line: 10118

	   l_debug_str := 'RAISE FND_API.G_EXC_ERROR in Update_Program_Info. p_person_rec.edu_status is U';
Line: 10131

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Program_Info';
Line: 10132

	   l_debug_str := 'RAISE FND_API.G_EXC_ERROR in Update_Program_Info. p_person_rec.edu_status is N.';
Line: 10153

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Program_Info';
Line: 10154

	   l_debug_str := 'RAISE FND_API.G_EXC_ERROR in Update_Program_Info. l_status is U or N.';
Line: 10176

        Insert_Edu_Info ( 'EDU', p_data_rec  => l_cur_rec, p_auth_drp_data_rec => l_cur_authdrp_rec);
Line: 10192

        Insert_Edu_Info ( 'PRGM', p_data_rec  => l_cur_rec, p_auth_drp_data_rec => NULL);
Line: 10212

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Program_Info';
Line: 10213

	   l_debug_str := 'Returning S from Update_EV_Program_Info. p_person_rec.edu_status is E.';
Line: 10224

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Program_Info';
Line: 10225

	   l_debug_str := 'RAISE FND_API.G_EXC_ERROR in Update_EV_Program_Info. p_person_rec.edu_status is U.';
Line: 10246

          l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Employment_Info';
Line: 10247

          l_debug_str := 'Unexpected error in Update_Employment_Info. l_status is U.';
Line: 10277

      ELSE   --Remove current person from the insert list
        l_cur_prgm_rec(l_current).person_id := NULL;
Line: 10284

		   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Program_Info';
Line: 10285

		   l_debug_str := 'inserting prgm info.';
Line: 10288

	Insert_Edu_Info ('PRGM', p_data_rec  => l_cur_prgm_rec(l_current), p_auth_drp_data_rec => NULL);
Line: 10295

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Program_Info';
Line: 10296

	   l_debug_str := 'Returning S from Update_EV_Program_Info.';
Line: 10309

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Program_Info';
Line: 10310

	   l_debug_str := 'FND_API.G_EXC_ERROR: Returning U from Update_EV_Program_Info. '||SQLERRM;
Line: 10325

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_EV_Program_Info';
Line: 10326

	   l_debug_str := 'EXCEPTION: Returning U from Update_EV_Program_Info. '||SQLERRM;
Line: 10333

END Update_EV_Program_Info;
Line: 10341

   Purpose            : Update Finance Information block on student

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
FUNCTION Update_Finance_Info (
   p_person_rec      IN OUT NOCOPY  t_student_rec    --Person record
) RETURN VARCHAR2
IS

   l_api_name    CONSTANT VARCHAR2(30)   := 'Update_Finance_Info';
Line: 10366

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Finance_Info';
Line: 10367

	   l_debug_str := 'Entering Update_Finance_Info. p_person_rec.person_id is '||p_person_rec.person_id;
Line: 10381

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Finance_Info';
Line: 10382

	   l_debug_str := 'Returning S from Update_Finance_Info. p_person_rec.fin_status is E';
Line: 10393

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Finance_Info';
Line: 10394

	   l_debug_str := 'Raise FND_API.G_EXC_ERROR in Update_Finance_Info. fin_status is U';
Line: 10407

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Finance_Info';
Line: 10408

	   l_debug_str := 'Raise FND_API.G_EXC_ERROR in Update_Finance_Info. fin_status is N';
Line: 10430

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Finance_Info';
Line: 10431

	   l_debug_str := 'Raise FND_API.G_EXC_ERROR in Update_Finance_Info. l_status is U or N';
Line: 10509

        Insert_Finance_Info ( p_data_rec  => l_cur_rec);
Line: 10516

      l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Finance_Info';
Line: 10517

      l_debug_str := 'Returning S from Update_Finance_Info.';
Line: 10530

      l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Finance_Info';
Line: 10531

      l_debug_str := 'FND_API.G_EXC_ERROR: Returning U from Update_Finance_Info. '||SQLERRM;
Line: 10545

      l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Finance_Info';
Line: 10546

      l_debug_str := 'EXCEPTION: Returning U from Update_Finance_Info. '||SQLERRM;
Line: 10552

END Update_Finance_Info;
Line: 10561

   Purpose            : Update Dependent block information on the student

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
FUNCTION Update_Dependent_Info (
   p_person_rec      IN OUT NOCOPY  t_student_rec    --Person record
) RETURN VARCHAR2
IS

   l_api_name   CONSTANT VARCHAR2(30)   := 'Update_Dependent_Info';
Line: 10584

         SELECT COUNT(1)
	 FROM igs_pe_hz_rel_v hz, igs_pe_depd_active pdep
	 WHERE hz.subject_id = p_person_rec.person_id AND
	 hz.relationship_code= 'SPOUSE_OF' and
	 pdep.relationship_id = hz.relationship_id
	 and pdep.action_code <> 'T'
	 and pdep.last_update_date = (SELECT MAX(last_update_date)
				      FROM igs_pe_depd_active
				      WHERE relationship_id =hz.relationship_id)
	 AND sysdate BETWEEN hz.start_date AND NVL(hz.end_date, sysdate+1);
Line: 10601

      l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Dependent_Info';
Line: 10602

      l_debug_str := 'Entering Update_Dependent_Info. p_person_rec.person_id is '||p_person_rec.person_id;
Line: 10619

        l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Dependent_Info';
Line: 10620

        l_debug_str := 'Returning S from Update_Dependent_Info. dep_status is E.';
Line: 10630

        l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Dependent_Info';
Line: 10631

        l_debug_str := 'Raise FND_API.G_EXC_ERROR in Update_Dependent_Info. dep_status is U.';
Line: 10642

        l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Dependent_Info';
Line: 10643

        l_debug_str := 'Returning S from Update_Dependent_Info. dep_status is N.';
Line: 10713

		l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Dependent_Info';
Line: 10714

		l_debug_str := 'Raise FND_API.G_EXC_ERROR in Update_Dependent_Info. l_status is U.';
Line: 10734

          l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Dependent_Info';
Line: 10735

          l_debug_str := 'Returning S from Update_Dependent_Info. l_status is S.';
Line: 10812

	  l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Dependent_Info';
Line: 10813

	  l_debug_str := 'Update_Dependent_Info. l_prev_rec.depdnt_action_type: '||l_prev_rec.depdnt_action_type||'cur dep action type: '||l_cur_rec(l_current).depdnt_action_type;
Line: 10817

	        l_cur_rec(l_current).depdnt_action_type := 'U';  --update mode for the person
Line: 10823

      ELSE   --Remove current dependent from the insert list
        l_cur_rec(l_current).depdnt_id := NULL;
Line: 10831

          l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Dependent_Info';
Line: 10832

          l_debug_str := 'Exiting Update_Dependent_Info. dep_status and record_status is C.';
Line: 10840

	Insert_Dependent_Info ( p_data_rec  => l_cur_rec(l_current));
Line: 10844

	Insert_Dependent_Info ( p_data_rec  => l_cur_rec(l_current),p_records => l_count );
Line: 10849

       l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Dependent_Info';
Line: 10850

       l_debug_str := 'Returning S from Update_Dependent_Info.';
Line: 10862

          l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Dependent_Info';
Line: 10863

          l_debug_str := 'FND_API.G_EXC_ERROR: Returning U from Update_Dependent_Info. '||SQLERRM;
Line: 10876

          l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Dependent_Info';
Line: 10877

          l_debug_str := 'EXCEPTION: Returning U from Update_Dependent_Info. '||SQLERRM;
Line: 10883

END Update_Dependent_Info;
Line: 10892

   Purpose            : Update Employment information block

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
FUNCTION Update_Employment_Info (
   p_person_rec      IN OUT NOCOPY  t_student_rec    -- Person record
) RETURN VARCHAR2
IS

   l_api_name    CONSTANT VARCHAR2(30)   := 'Update_Employment_Info';
Line: 10919

     l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Employment_Info';
Line: 10920

     l_debug_str := 'Entering Update_Employment_Info. p_person_rec.person_id is '||p_person_rec.person_id;
Line: 10935

        l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Employment_Info';
Line: 10936

        l_debug_str := 'Returning S from Update_Employment_Info. empl_status is E.';
Line: 10944

        l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Employment_Info';
Line: 10945

        l_debug_str := 'Unexpected error in Update_Employment_Info. empl_status is U.';
Line: 10953

        l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Employment_Info';
Line: 10954

        l_debug_str := 'Returning S from Update_Employment_Info. empl_status is N.';
Line: 11007

          l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Employment_Info';
Line: 11014

          l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Employment_Info';
Line: 11015

          l_debug_str := 'Unexpected error in Update_Employment_Info. l_status is U.';
Line: 11069

      ELSE   --Remove current person from the insert list
        l_cur_rec(l_current).person_id := NULL;
Line: 11074

	Insert_Empl_Info ( p_data_rec  => l_cur_rec(l_current));
Line: 11083

          l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Employment_Info';
Line: 11084

          l_debug_str := 'Returning S from Update_Employment_Info.';
Line: 11096

          l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Employment_Info';
Line: 11097

          l_debug_str := 'ND_API.G_EXC_ERROR: Returning U from Update_Employment_Info. '||SQLERRM;
Line: 11111

          l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Employment_Info';
Line: 11112

          l_debug_str := 'EXCEPTION: Returning U from Update_Employment_Info. '||SQLERRM;
Line: 11117

END Update_Employment_Info;
Line: 11126

   Purpose            : Update Conviction block information.

   Remarks            :

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
FUNCTION Update_Conviction_Info (
   p_person_rec      IN OUT NOCOPY  t_student_rec    --Person record
) RETURN VARCHAR2

IS

   l_api_name    CONSTANT VARCHAR2(30)   := 'Update_Conviction_Info';
Line: 11151

     l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Conviction_Info';
Line: 11152

     l_debug_str := 'Entering Update_Conviction_Info. p_person_rec.person_id is '||p_person_rec.person_id;
Line: 11169

        l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Conviction_Info';
Line: 11170

        l_debug_str := 'Returning S from Update_Conviction_Info. conv_status is E.';
Line: 11181

        l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Conviction_Info';
Line: 11182

        l_debug_str := 'Unexpected error in Update_Conviction_Info. conv_status is U.';
Line: 11193

        l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Conviction_Info';
Line: 11194

        l_debug_str := 'Returning S from Update_Conviction_Info. conv_status is N.';
Line: 11210

     Insert_Convictions_Info ( p_data_rec  => l_cur_rec);
Line: 11217

        l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Conviction_Info';
Line: 11218

        l_debug_str := 'Returning S from Update_Conviction_Info.';
Line: 11231

        l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Conviction_Info';
Line: 11232

        l_debug_str := 'FND_API.G_EXC_ERROR: Returning U from Update_Conviction_Info. '||SQLERRM;
Line: 11246

        l_label := 'igs.plsql.igs_sv_batch_process_pkg.Update_Conviction_Info';
Line: 11247

        l_debug_str := 'EXCEPTION: Returning U from Update_Conviction_Info. '||SQLERRM;
Line: 11253

END Update_Conviction_Info;
Line: 11286

   DELETE FROM igs_sv_addresses WHERE batch_id = p_batch_id AND ( person_id = p_person_id OR p_person_id IS NULL );
Line: 11288

   DELETE FROM igs_sv_bio_info WHERE batch_id = p_batch_id AND ( person_id = p_person_id OR p_person_id IS NULL ) ;
Line: 11290

   DELETE FROM igs_sv_convictions WHERE batch_id = p_batch_id AND ( person_id = p_person_id OR p_person_id IS NULL ) ;
Line: 11292

   DELETE FROM igs_sv_depdnt_info WHERE batch_id = p_batch_id AND ( person_id = p_person_id OR p_person_id IS NULL ) ;
Line: 11294

   DELETE FROM igs_sv_empl_info WHERE batch_id = p_batch_id AND ( person_id = p_person_id OR p_person_id IS NULL ) ;
Line: 11296

   DELETE FROM igs_sv_finance_info WHERE batch_id = p_batch_id AND ( person_id = p_person_id OR p_person_id IS NULL ) ;
Line: 11298

   DELETE FROM igs_sv_legal_info WHERE batch_id = p_batch_id AND ( person_id = p_person_id OR p_person_id IS NULL ) ;
Line: 11300

   DELETE FROM igs_sv_oth_info WHERE batch_id = p_batch_id AND ( person_id = p_person_id OR p_person_id IS NULL ) ;
Line: 11302

   DELETE FROM igs_sv_prgms_info WHERE batch_id = p_batch_id AND ( person_id = p_person_id OR p_person_id IS NULL ) ;
Line: 11304

   DELETE FROM igs_sv_persons WHERE batch_id = p_batch_id AND ( person_id = p_person_id OR p_person_id IS NULL );
Line: 11306

   DELETE FROM igs_sv_btch_summary WHERE batch_id = p_batch_id AND ( person_id = p_person_id OR p_person_id IS NULL );  -- prbhardw
Line: 11406

SELECT old_per.no_show_flag
FROM igs_sv_persons new_per, igs_sv_persons old_per
WHERE new_per.person_id = c_person_id AND
      new_per.batch_id = c_batch_id AND
      old_per.batch_id = (SELECT max(batch_id) FROM igs_sv_persons WHERE batch_id < c_batch_id) AND
      old_per.person_id = new_per.person_id;
Line: 11437

     INSERT INTO igs_sv_batches
     ( batch_id,
       schema_version,
       sevis_user_id,
       sevis_school_id,
       batch_status,
       batch_type,
       creation_date ,
       created_by ,
       last_updated_by ,
       last_update_date ,
       last_update_login,
       SEVIS_SCHOOL_ORG_ID   ,
       SEVIS_USER_PERSON_ID
     )
     VALUES
     ( igs_sv_batches_id_s.nextval,
       1,
       p_dso_id,
       p_org_id,
       'S',
       p_batch_type,
       sysdate,
       g_update_by,
       g_update_by,
       sysdate,
       g_update_login,
       p_org_party_id,
       p_user_party_id
     )
     RETURNING batch_id INTO l_batch_id;
Line: 11489

                                        Added the code for inserting Site of Activity Address
------------------------------------------------------------------------
mmkumar              12-Sep-2005     SEVIS 5 uptake, Added new parameter for Org ID
******************************************************************/
PROCEDURE Create_Batch(
   errbuf             OUT NOCOPY VARCHAR2,  -- Request standard error string
   retcode            OUT NOCOPY NUMBER  ,  -- Request standard return status
   p_batch_type       IN  VARCHAR2,  -- Batch type E(ev),  I(international),   B (both)
   p_validate_only    IN  VARCHAR2,  -- Validate only flag  'Y'  'N'
   p_org_id           IN  VARCHAR2,
   p_dso_id	      IN  VARCHAR2,
   p_dso_party_id     IN  NUMBER,
   p_org_party_id     IN  NUMBER
) IS

   l_api_name  CONSTANT VARCHAR2(25) := 'Create_Batch';
Line: 11531

   SELECT fr.person_id, min(ev_form_id) form_id, pr.party_number person_number, fr.no_show_flag, fr.reprint_reason reprint_reason
    FROM igs_pe_ev_form fr, hz_parties pr
    WHERE pr.party_id = fr.person_id  AND fr.form_effective_date <= trunc(sysdate)
    AND fr.ev_form_id NOT IN
       (SELECT st.ev_form_id  FROM igs_pe_ev_form_stat st
        WHERE st.action_type IN ('TR','ED')
              AND st.ev_form_id = fr.ev_form_id
               AND st.ev_form_stat_id IN
                   ( SELECT NVL(prs.form_status_id,0) FROM igs_sv_prgms_info prs, igs_sv_persons pr
                     WHERE prs.person_id = pr.person_id AND prs.batch_id = pr.batch_id
                           AND pr.record_status <> 'E' AND prs.person_id = fr.person_id)
       ) AND fr.sevis_school_identifier = p_org_party_id AND
          ( (p_dso_id IS NULL AND
	     (EXISTS (SELECT rel.object_id
		      FROM hz_relationships rel
		      WHERE rel.object_id =  fr.person_id AND
	                    --rel.DIRECTIONAL_FLAG = 'F' AND	fix for bug 5258405
		            sysdate between rel.start_date AND nvl(end_date, sysdate) AND
		            rel.RELATIONSHIP_CODE = 'DSO_FOR') ))
	   OR
	    fr.person_id IN (SELECT rel.object_id FROM hz_relationships rel
	                          WHERE rel.subject_id = p_dso_party_id
				  --AND rel.DIRECTIONAL_FLAG = 'F'	fix for bug 5258405
				  AND sysdate between rel.start_date AND nvl(end_date, sysdate)
	    AND rel.RELATIONSHIP_CODE = 'DSO_FOR')
	   )
  GROUP BY  pr.party_number,fr.person_id,  fr.no_show_flag, fr.reprint_reason;
Line: 11560

   SELECT fr.person_id, min(nonimg_form_id) form_id, pr.party_number person_number, null no_show_flag, fr.reprint_reason reprint_reason
   FROM igs_pe_nonimg_form fr, hz_parties pr
   WHERE pr.party_id = fr.person_id
   AND fr.form_effective_date <= trunc(sysdate)
   AND fr.nonimg_form_id NOT IN
        ( SELECT st.nonimg_form_id FROM IGS_PE_NONIMG_STAT st
         WHERE st.action_type IN ('T','C')
         AND st.nonimg_form_id = fr.nonimg_form_id
         AND st.nonimg_stat_id IN
              ( SELECT NVL(prs.form_status_id,0)
                FROM igs_sv_prgms_info prs, igs_sv_persons pr
                WHERE prs.person_id = pr.person_id AND prs.batch_id = pr.batch_id
                AND pr.record_status <> 'E' AND prs.person_id = fr.person_id
                ) )
   AND fr.sevis_school_identifier = p_org_party_id AND
   ( (p_dso_id IS NULL AND
      (EXISTS (SELECT rel.object_id
	      FROM hz_relationships rel
	      WHERE rel.object_id =  fr.person_id AND
	            --rel.DIRECTIONAL_FLAG = 'F' AND		fix for bug 5258405
		    sysdate between rel.start_date AND nvl(end_date, sysdate) AND
		    rel.RELATIONSHIP_CODE = 'DSO_FOR') ))
     OR
     fr.person_id IN (SELECT rel.object_id
	                    FROM hz_relationships rel
	                    WHERE rel.subject_id = p_dso_party_id and
	                    --rel.DIRECTIONAL_FLAG = 'F' AND		fix for bug 5258405
	                    sysdate between rel.start_date AND nvl(end_date, sysdate) AND
	                    rel.RELATIONSHIP_CODE = 'DSO_FOR')
 )
 GROUP BY  pr.party_number,fr.person_id, fr.reprint_reason;
Line: 11594

     SELECT person_party_id
       FROM fnd_user
      WHERE user_id = g_update_by;
Line: 11599

   SELECT party_number
   FROM   hz_parties
   WHERE  party_id = cp_party_id;
Line: 11604

     SELECT 1
      FROM igs_sv_persons a,
           igs_sv_batches b
     WHERE person_id = p_id
           AND a.batch_id = b.batch_id
           AND b.batch_type = p_batch_type
           AND a.record_status <> 'E'
           AND form_id = f_id;
Line: 11614

     SELECT batch_id
      FROM igs_sv_batches
     WHERE batch_status IN ('N')       -- prbhardw
           AND batch_type = p_batch_type;
Line: 11620

     SELECT decode(print_form,'Y','1','0') print_form
       FROM igs_pe_nonimg_form
      WHERE nonimg_form_id = p_form_id
            AND p_batch_type = 'I'
      UNION
     SELECT decode(print_form,'Y','1','0') print_form
       FROM igs_pe_ev_form
      WHERE ev_form_id = p_form_id
            AND p_batch_type = 'E';
Line: 11633

     SELECT decode(print_flag,'Y','1','0') print_form
       FROM igs_pe_nonimg_stat
      WHERE nonimg_form_id = p_form_id
            AND p_batch_type = 'I'
	    AND action_type = 'E';
Line: 11642

          SELECT alt.api_person_id, alt.pe_person_id
	  FROM hz_relationships rel, igs_pe_alt_pers_id alt
	  WHERE rel.subject_id = c_person_id and
	       rel.object_id = alt.pe_person_id AND
               sysdate between alt.start_dt and nvl(alt.end_dt,sysdate+1) AND
	       sysdate between rel.start_date AND nvl(end_date, sysdate) AND
	       rel.RELATIONSHIP_CODE = 'HAS_DSO' AND
	       alt.person_id_type
			       IN (SELECT person_id_type
				     FROM igs_pe_person_id_typ
				    WHERE s_person_id_type = 'SEVIS_ID');
Line: 11702

   g_update_login            := FND_GLOBAL.LOGIN_ID;
Line: 11703

   g_update_by               := FND_GLOBAL.USER_ID;
Line: 11761

   Put_Log_Msg('Inserting batch record',0);
Line: 11763

   INSERT INTO igs_sv_batches
     ( batch_id,
       schema_version,
       sevis_user_id,
       sevis_school_id,
       batch_status,
       batch_type,
       creation_date ,
       created_by ,
       last_updated_by ,
       last_update_date ,
       last_update_login,
       SEVIS_SCHOOL_ORG_ID,
       SEVIS_USER_PERSON_ID
     )
     VALUES
     ( igs_sv_batches_id_s.nextval,
       1,
       l_person_sevis_id,
       p_org_id,
       'S',
       p_batch_type,
       sysdate,
       g_update_by,
       g_update_by,
       sysdate,
       g_update_login,
       p_org_party_id,
       l_sevis_user_person_id
     )
     RETURNING batch_id INTO l_batch_id;
Line: 11795

     g_running_update_batch  := l_batch_id;       -- prbhardw CP enhancement
Line: 11823

	  IF (MOD(g_create_count,250) = 0 AND g_create_count > 0 ) OR (MOD(g_update_count,250) = 0 AND g_update_count > 0 ) THEN
	       l_batch_id :=  new_batch(l_batch_id, l_person_sevis_id, p_org_id, p_batch_type,p_org_party_id,l_sevis_user_person_id);
Line: 11829

		    g_running_update_batch := l_batch_id;
Line: 11830

		    g_running_batches(g_running_batches.COUNT + 1) := g_running_update_batch;
Line: 11833

	       Put_Log_Msg('count exceeded max limmit. new batch created: '||l_batch_id||' g_create_count '||g_create_count||' g_update_count '||g_update_count,0);
Line: 11876

         FND_MESSAGE.SET_NAME('IGS', 'IGS_SV_STUDENT_UPD'); -- Student is found in Update mode
Line: 11918

	   l_debug_str := 'Inserting in igs_sv_persons batch id: '||l_batch_id;
Line: 11921

         INSERT INTO igs_sv_persons (
             batch_id     ,
             person_id    ,
             record_number,
             form_id      ,
             print_form   ,
	     pdso_sevis_id,
             record_status,
             person_number,
             sevis_user_id,
             creation_date,
             created_by             ,
             last_updated_by        ,
             last_update_date       ,
             last_update_login,
	     no_show_flag,
	     reprint_rsn_code,
	     PDSO_SEVIS_PERSON_ID
            ) VALUES (
             l_batch_id,
             l_student_rec.person_id,
             l_student_rec.record_number,
             l_student_rec.form_id,
             l_student_rec.print_form,
	     dso_id,
             l_student_rec.record_status,
             l_student_rec.person_number,
             l_student_rec.sevis_user_id,
             sysdate,
             g_update_by,
             g_update_by,
             sysdate,
             g_update_login,
	     l_student_rec.no_show_flag,
	     l_student_rec.reprint_reason,
             dso_party_id
            );
Line: 12106

           Put_Log_Msg(' Inserting data ',0);
Line: 12112

            Update_Issue_Info ( p_data_rec  => l_issue_rec);
Line: 12114

            Insert_Bio_Info ( p_data_rec  => l_bio_rec);
Line: 12118

               Insert_Other_Info ( p_data_rec  => l_oth_rec);
Line: 12122

            Insert_Edu_Info ('EDU', p_data_rec  => l_edu_rec, p_auth_drp_data_rec => l_cur_authdrp_rec);
Line: 12126

              Insert_Address_Info ('F', p_data_rec  => l_f_addr_rec,p_records => 1);   --- prbhardw CP enhancement
Line: 12132

               Insert_Address_Info ( 'US',p_data_rec  => l_us_addr_rec,p_records => 1);   --- prbhardw CP enhancement
Line: 12137

               Insert_Address_Info ('SOA', p_data_rec  => l_site_addr_rec,p_records => l_soa_count);   --- prbhardw CP enhancement
Line: 12140

            Insert_Finance_Info ( p_data_rec  => l_fin_rec);
Line: 12144

              Insert_Dependent_Info ( p_data_rec  => l_dep_rec,p_records   => l_student_rec.dep_count  );
Line: 12150

           Put_Log_Msg(' No insertion, person_status is:'||l_student_rec.person_status ,0);
Line: 12152

         END IF;  -- Insertion ends here
Line: 12156

	  g_update_count := g_update_count +1; -- prbhardw CP enhancement
Line: 12157

	  l_student_rec.record_number := g_update_count; -- prbhardw CP enhancement
Line: 12158

	  Put_Log_Msg(' update_count:'||g_update_count,0);
Line: 12159

          IF p_batch_type = 'I' THEN -- If mode update for Non immigrants

               -- IF l_student_rec.changes_found <> 'Y' THEN   --- commented by prbhardw

		     -- Call Update_Employment_Info
                    l_status := Update_Employment_Info ( p_person_rec  => l_student_rec  );
Line: 12170

				l_debug_str := 'ERROR in Create_Batch. l_status from Update_Employment_Info is not S';
Line: 12178

	   -- Call Update_Registration_Info
	       l_status := Update_Registration_Info ( p_person_rec  => l_student_rec  );
Line: 12193

                    l_status := Update_Personal_Info ( p_person_rec  => l_student_rec  );
Line: 12207

			-- Call Update_Program_Info
                    l_status := Update_Program_Info ( p_person_rec  => l_student_rec  );
Line: 12214

		               l_debug_str := 'ERROR in Create_Batch. l_status from Update_Program_Info is not S';
Line: 12224

			-- Call Update_Finance_Info
                    l_status := Update_Finance_Info ( p_person_rec  => l_student_rec  );
Line: 12231

				l_debug_str := 'ERROR in Create_Batch. l_status from Update_Finance_Info is not S';
Line: 12240

			-- Call Update_Dependent_Info
                    l_status := Update_Dependent_Info ( p_person_rec  => l_student_rec  );
Line: 12247

				l_debug_str := 'ERROR in Create_Batch. l_status from Update_Dependent_Info is not S';
Line: 12257

			-- Call Update_Conviction_Info
                    l_status := Update_Conviction_Info ( p_person_rec  => l_student_rec  );
Line: 12264

				l_debug_str := 'ERROR in Create_Batch. l_status from Update_Conviction_Info is not S';
Line: 12272

          ELSE  -- Update for EV student
         -------
	  IF l_student_rec.no_show_flag =  'Y' THEN
               IF Get_pre_noshow_status(l_student_rec.person_id,l_student_rec.batch_id) = 'Y' THEN
                    l_student_rec.changes_found := 'N';
Line: 12283

		    Insert_Summary_Info(l_btch_id,
				       l_student_rec.person_id,
				       'NOSHOW',
				       'SV_STATUS',
				       'SEND',
				       'IGS_SV_PERSONS',
				       '');
Line: 12297

		   l_status := Update_Personal_Info ( p_person_rec  => l_student_rec  );
Line: 12303

			  l_debug_str := 'ERROR in Create_Batch. l_status from Update_Personal_Info is not S';
Line: 12309

		    l_status := Update_ev_legal_Info ( p_person_rec  => l_student_rec  );
Line: 12314

		            l_debug_str := 'ERROR in Create_Batch. Update_ev_legal_Info status is not S';
Line: 12322

		     -- Call Update_Finance_Info
		     l_status := Update_Finance_Info ( p_person_rec  => l_student_rec  );
Line: 12330

			  l_debug_str := 'ERROR in Create_Batch. l_status from Update_Finance_Info is not S';
Line: 12339

		     -- Call Update_EV_Program_Info
		     l_status := Update_EV_Program_Info ( p_person_rec  => l_student_rec  );
Line: 12347

			  l_debug_str := 'ERROR in Create_Batch. l_status from Update_EV_Program_Info is not S';
Line: 12356

		     -- Call Update_EV_Address_Info
		     l_status := Update_EV_Address_Info ( p_person_rec  => l_student_rec  );
Line: 12364

			  l_debug_str := 'ERROR in Create_Batch. l_status from Update_EV_Address_Info is not S';
Line: 12373

		     -- Call Update_Dependent_Info
		     l_status := Update_Dependent_Info ( p_person_rec  => l_student_rec  );
Line: 12381

			  l_debug_str := 'ERROR in Create_Batch. l_status from Update_Dependent_Info is not S';
Line: 12456

      DELETE FROM igs_sv_batches WHERE batch_id = l_batch_id;
Line: 12484

          DELETE FROM igs_sv_batches WHERE batch_id = g_parallel_batches(i);
Line: 12490

           DELETE FROM igs_sv_batches WHERE batch_id = g_running_batches(i);
Line: 12667

     SELECT batch_id
      FROM igs_sv_batches
     WHERE batch_status IN ('S','N')
           AND batch_type = p_batch_type;
Line: 12700

     DELETE FROM igs_sv_batches WHERE batch_id = l_batch_id;
Line: 12701

     DELETE FROM igs_sv_batches WHERE batch_id > l_batch_id;*/
Line: 12705

          DELETE FROM igs_sv_batches WHERE batch_id = g_parallel_batches(i);
Line: 12711

           DELETE FROM igs_sv_batches WHERE batch_id = g_running_batches(i);
Line: 12991

   SELECT person_id_type
     FROM igs_pe_person_id_typ
    WHERE s_person_id_type = g_person_sevis_id AND
          closed_ind = 'N';
Line: 13007

    UPDATE igs_sv_persons
       SET record_status = 'E',
           sevis_error_code = p_SEVIS_ErrorCode,
           sevis_error_element = p_SEVIS_ErrorElement
     WHERE batch_id = p_BatchID
           AND person_id = p_person_id;
Line: 13023

   UPDATE igs_pe_alt_pers_id
      SET end_dt = trunc(sysdate)
    WHERE pe_person_id = p_person_id
          AND person_id_type
              IN (SELECT person_id_type
                    FROM igs_pe_person_id_typ
                   WHERE s_person_id_type = g_person_sevis_id)
           AND start_dt <= trunc(sysdate)
           AND NVL(end_dt,sysdate+1) >= trunc(sysdate) ;
Line: 13038

     IGS_PE_ALT_PERS_ID_PKG.INSERT_ROW (
         X_ROWID         => l_rowid,
         X_PE_PERSON_ID  => p_person_id,
         X_API_PERSON_ID => p_sevisID,
         X_API_PERSON_ID_UF => p_sevisID,
         X_PERSON_ID_TYPE => l_alt_id,
         X_START_DT       => trunc(sysdate),
         X_END_DT         => NULL,
         X_attribute_category => '',
         X_attribute1          => '',
         X_attribute2          => '',
         X_attribute3          => '',
         X_attribute4          => '',
         X_attribute5          => '',
         X_attribute6          => '',
         X_attribute7          => '',
         X_attribute8          => '',
         X_attribute9          => '',
         X_attribute10         => '',
         X_attribute11         => '',
         X_attribute12         => '',
         X_attribute13         => '',
         X_attribute14         => '',
         X_attribute15         => '',
         X_attribute16         => '',
         X_attribute17         => '',
         X_attribute18         => '',
         X_attribute19         => '',
         X_attribute20         => '',
         X_MODE                => 'I'
      );
Line: 13101

    SELECT batch_status
      FROM igs_sv_batches
     WHERE batch_id = p_BatchID;
Line: 13150

    UPDATE igs_sv_batches SET batch_status = 'P' WHERE batch_id = p_BatchID;
Line: 13157

    UPDATE igs_sv_batches SET batch_status = 'E', SEVIS_ERROR_CODE = NVL(p_FileErrorCode,NVL(p_FileValidation,'X')) WHERE batch_id = p_BatchID;
Line: 13244

update igs_sv_persons set SEVIS_USER_ID = p_sevisID ,
        SEVIS_ERROR_CODE = p_SEVIS_ErrorCode, SEVIS_ERROR_ELEMENT  = p_SEVIS_ErrorElement
        where person_id = p_PersonID;
Line: 13296

    SELECT  '1'
      FROM IGS_SV_DEPDNT_INFO
     WHERE PERSON_ID = p_PersonID and DEPDNT_ID  = p_DepPersonID;
Line: 13338

    UPDATE IGS_SV_DEPDNT_INFO SET DEPDNT_SEVIS_ID = p_DepSevisID WHERE PERSON_ID = p_PersonID and DEPDNT_ID  = p_DepPersonID;
Line: 13356

   Purpose            : Insert batch summary into igs_sv_btch_summary before inserting in interface tables.

   Change History
   Who                  When            What
------------------------------------------------------------------------

******************************************************************/
PROCEDURE Insert_Summary_Info(
   p_batch_id  IN  igs_sv_btch_summary.batch_id%TYPE,
   p_person_id  IN  igs_sv_btch_summary.person_id%TYPE,
   p_action_code  IN  igs_sv_btch_summary.action_code%TYPE,
   p_tag_code  IN  igs_sv_btch_summary.tag_code%TYPE,
   p_adm_action IN  igs_sv_btch_summary.adm_action_code%TYPE,
   p_owner_table_name IN igs_sv_btch_summary.owner_table_name%TYPE,
   p_owner_table_id  IN  igs_sv_btch_summary.OWNER_TABLE_IDENTIFIER%TYPE
)
IS
   l_api_name CONSTANT VARCHAR(30) := 'Insert_Summary_Info';
Line: 13376

SELECT max(batch_id) FROM IGS_SV_BTCH_SUMMARY;
Line: 13381

   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Summary_Info';
Line: 13382

   l_debug_str := 'Entering Insert_Summary_Info. p_data_rec.person_id is '||p_person_id|| ' and batch_id is '||p_batch_id;
Line: 13386

   INSERT INTO IGS_SV_BTCH_SUMMARY (
        summary_id	       ,
        batch_id               ,
        person_id              ,
        action_code            ,
	tag_code               ,
	adm_action_code        ,
	creation_date          ,
	created_by             ,
	last_updated_by        ,
	last_update_date       ,
	last_update_login      ,
	owner_table_name,
	OWNER_TABLE_IDENTIFIER         --mmkumar, owner_table_id
     ) VALUES
     (
      IGS_SV_BTCH_SUMM_ID_S.nextval    ,
       p_batch_id  ,
       p_person_id  ,
       p_action_code ,
       p_tag_code  ,
       p_adm_action ,
       sysdate,
       g_update_by,
       g_update_by,
       sysdate,
       g_update_login,
       p_owner_table_name,
       p_owner_table_id
     );
Line: 13422

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Summary_Info';
Line: 13423

	   l_debug_str := 'record in Insert_Summary_Info max batch_id: '||l_batch;
Line: 13434

	   l_label := 'igs.plsql.igs_sv_batch_process_pkg.Insert_Summary_Info';
Line: 13435

	   l_debug_str := 'EXCEPTION in Insert_Summary_Info. '||SQLERRM;
Line: 13441

END Insert_Summary_Info;
Line: 13465

     SELECT batch_type
     FROM igs_sv_batches
     WHERE batch_id = cp_batch_id;
Line: 13486

     UPDATE igs_sv_batches
     SET batch_status = 'X' , xml_gen_date = trunc(sysdate)
     WHERE batch_id = l_batch_id;
Line: 13521

   CURSOR c_updated_pers(cp_batch_id igs_sv_btch_summary.batch_id%TYPE)
   IS
     SELECT summ.person_id, summ.tag_code
     FROM igs_sv_btch_summary summ
     WHERE summ.batch_id = cp_batch_id AND
	  summ.adm_action_code ='HOLD' AND
	  EXISTS (SELECT 1 FROM igs_sv_persons pers
		  WHERE pers.person_id = summ.person_id AND
		  pers.batch_id = summ.batch_id AND
		  pers.record_status = 'C' );
Line: 13534

     SELECT distinct person_number
     FROM igs_sv_persons pers
     WHERE pers.batch_id = cp_batch_id AND record_status = 'N'
           AND EXISTS (SELECT 1
		FROM igs_sv_btch_summary summ
		WHERE summ.person_id = pers.person_id AND
                  summ.batch_id=pers.batch_id AND
                  summ.adm_action_code ='HOLD' AND
                  summ.batch_id = pers.batch_id);
Line: 13545

     SELECT party_number
     FROM hz_parties
     WHERE party_id = cp_party_id;
Line: 13551

     SELECT lkp.meaning info
     FROM  igs_lookup_values lkp
     WHERE lkp.lookup_code = cp_tag_code
           AND lkp.lookup_type ='IGS_SV_COMP_TREE';
Line: 13573

	FOR c_updated_pers_rec IN c_updated_pers(p_batch_id) LOOP
	  l_per_count := l_per_count + 1;
Line: 13587

	  OPEN c_get_prsn_num(c_updated_pers_rec.person_id);
Line: 13591

	  OPEN c_get_info(c_updated_pers_rec.tag_code);
Line: 13638

     SELECT COUNT(DISTINCT person_id)
     FROM igs_sv_btch_summary
     WHERE batch_id = cp_batch_id;
Line: 13644

     SELECT hz.party_number prsn_num, lkp.meaning info
     FROM igs_sv_btch_summary svbs, hz_parties hz, igs_lookup_values lkp, igs_sv_persons pers
     WHERE svbs.batch_id = cp_batch_id
           AND svbs.person_id = hz.party_id
           AND svbs.tag_code = lkp.lookup_code
           AND lkp.lookup_type ='IGS_SV_COMP_TREE'
	   AND lkp.enabled_flag = 'Y'
	   AND svbs.person_id = pers.person_id
           AND svbs.batch_id = pers.batch_id
           AND pers.record_status = 'N';
Line: 13655

   CURSOR c_get_updated_persons(cp_batch_id igs_sv_btch_summary.batch_id%TYPE)
   IS
     SELECT hz.party_number prsn_num, lkp.meaning info
     FROM igs_sv_btch_summary svbs, hz_parties hz, igs_lookup_values lkp, igs_sv_persons pers
     WHERE svbs.batch_id = cp_batch_id
           AND svbs.person_id = hz.party_id
           AND svbs.tag_code = lkp.lookup_code
           AND lkp.lookup_type ='IGS_SV_COMP_TREE'
	   AND lkp.enabled_flag = 'Y'
	   AND svbs.person_id = pers.person_id
           AND svbs.batch_id = pers.batch_id
           AND pers.record_status = 'C';
Line: 13738

     FOR updated_persons IN c_get_updated_persons(g_parallel_batches(i)) LOOP
          Put_Log_Msg('        ' || rpad(updated_persons.prsn_num,30,' ') || '          ' || updated_persons.info,1);
Line: 13773

     FOR updated_persons IN c_get_updated_persons(g_running_batches(i)) LOOP
          Put_Log_Msg('        ' || rpad(updated_persons.prsn_num,30,' ') || '          ' || updated_persons.info,1);
Line: 13823

     SELECT person_id
     FROM igs_pe_prsid_grp_mem_all
     WHERE group_id = p_group_id AND SYSDATE BETWEEN start_date AND NVL(end_date, SYSDATE);
Line: 13828

     SELECT subject_id
     FROM hz_relationships
     WHERE object_id = cp_person_id AND
           SYSDATE BETWEEN start_date AND NVL(end_date, SYSDATE)
	   AND relationship_code = 'DSO_FOR';
Line: 13836

     SELECT object_id, relationship_id, comments, object_version_number, directional_flag
     FROM hz_relationships
     WHERE subject_id = cp_person_id AND
     SYSDATE BETWEEN start_date AND NVL(end_date, SYSDATE+1)
	   AND relationship_code = 'DSO_FOR';
Line: 13844

     SELECT directional_flag, primary, secondary, joint_salutation, next_to_kin, rep_faculty, rep_staff,
            rep_student, rep_alumni, emergency_contact_flag
     FROM igs_pe_hz_rel
     WHERE relationship_id = cp_rel_id
           AND directional_flag = cp_dir_flag;		-- fix for bug 5258405
Line: 13851

     SELECT party_number person_num, person_first_name first_name, person_last_name last_name
     FROM hz_parties
     WHERE party_id = cp_person_id;
Line: 13861

    lv_last_update_date HZ_PARTIES.LAST_UPDATE_DATE%TYPE ;
Line: 13909

       lv_last_update_date  := SYSDATE;
Line: 13974

			IGS_PE_RELATIONSHIPS_PKG.CREATUPDATE_PARTY_RELATIONSHIP (
				     P_ACTION                       => 'INSERT',
				     P_SUBJECT_ID                   => l_new_dso_partyid,
				     P_OBJECT_ID                    => l_person_id,
				     P_PARTY_RELATIONSHIP_TYPE      => 'DESIGNATED_SCHOOL_OFFICIAL',
				     P_RELATIONSHIP_CODE            => 'DSO_FOR',
				     P_COMMENTS                     => NULL,
				     P_START_DATE                   => SYSDATE,
				     P_END_DATE                     => NULL,
				     P_LAST_UPDATE_DATE             => lv_last_update_date,
				     P_RETURN_STATUS                => lv_return_status,
				     P_MSG_COUNT                    => lv_msg_count,
				     P_MSG_DATA                     => lv_msg_data,
				     P_PARTY_RELATIONSHIP_ID        => lv_party_relationship_id,
				     P_PARTY_ID                     => lv_party_id,
				     P_PARTY_NUMBER                 => lv_party_number,
				     P_CALLER                       => 'NOT_FAMILY',
				     P_OBJECT_VERSION_NUMBER        => lv_object_version_number,
				     P_PRIMARY                      => 'N',
				     P_SECONDARY                    => 'N',
				     P_JOINT_SALUTATION             => NULL,
				     P_NEXT_TO_KIN                  => 'N',
				     P_REP_FACULTY                  => 'N',
				     P_REP_STAFF                    => 'N',
				     P_REP_STUDENT                  => 'N',
				     P_REP_ALUMNI                   => 'N',
				     P_EMERGENCY_CONTACT_FLAG       => 'N'
			   );
Line: 14101

			IGS_PE_RELATIONSHIPS_PKG.CREATUPDATE_PARTY_RELATIONSHIP (
				     P_ACTION                       => 'UPDATE',
				     P_SUBJECT_ID                   => l_old_dso_partyid,
				     P_OBJECT_ID                    => l_obj_id,
				     P_PARTY_RELATIONSHIP_TYPE      => 'DESIGNATED_SCHOOL_OFFICIAL',
				     P_RELATIONSHIP_CODE            => 'DSO_FOR',
				     P_COMMENTS                     => r_old_dso_rel_rec.comments,
				     P_START_DATE                   => SYSDATE,
				     P_END_DATE                     => SYSDATE,
				     P_LAST_UPDATE_DATE             => lv_last_update_date,
				     P_RETURN_STATUS                => lv_return_status,
				     P_MSG_COUNT                    => lv_msg_count,
				     P_MSG_DATA                     => lv_msg_data,
				     P_PARTY_RELATIONSHIP_ID        => l_rel_id,
				     P_PARTY_ID                     => lv_party_id,
				     P_PARTY_NUMBER                 => lv_party_number,
				     P_CALLER                       => 'NOT_FAMILY',
				     P_OBJECT_VERSION_NUMBER        => lv_object_version_number,
				     P_PRIMARY                      => l_old_rel_values.primary,
				     P_SECONDARY                    => l_old_rel_values.secondary,
				     P_JOINT_SALUTATION             => l_old_rel_values.joint_salutation,
				     P_NEXT_TO_KIN                  => l_old_rel_values.next_to_kin,
				     P_REP_FACULTY                  => l_old_rel_values.rep_faculty,
				     P_REP_STAFF                    => l_old_rel_values.rep_staff,
				     P_REP_STUDENT                  => l_old_rel_values.rep_student,
				     P_REP_ALUMNI                   => l_old_rel_values.rep_alumni,
				     P_DIRECTIONAL_FLAG             => l_old_rel_values.directional_flag,
				     P_EMERGENCY_CONTACT_FLAG       => l_old_rel_values.emergency_contact_flag
				);
Line: 14131

			IGS_PE_RELATIONSHIPS_PKG.CREATUPDATE_PARTY_RELATIONSHIP (
				     P_ACTION                       => 'INSERT',
				     P_SUBJECT_ID                   => l_new_dso_partyid,
				     P_OBJECT_ID                    => l_obj_id,
				     P_PARTY_RELATIONSHIP_TYPE      => 'DESIGNATED_SCHOOL_OFFICIAL',
				     P_RELATIONSHIP_CODE            => 'DSO_FOR',
				     P_COMMENTS                     => r_old_dso_rel_rec.comments,
				     P_START_DATE                   => SYSDATE,
				     P_END_DATE                     => NULL,
				     P_LAST_UPDATE_DATE             => lv_last_update_date,
				     P_RETURN_STATUS                => lv_return_status,
				     P_MSG_COUNT                    => lv_msg_count,
				     P_MSG_DATA                     => lv_msg_data,
				     P_PARTY_RELATIONSHIP_ID        => lv_party_relationship_id,
				     P_PARTY_ID                     => lv_party_id,
				     P_PARTY_NUMBER                 => lv_party_number,
				     P_CALLER                       => 'NOT_FAMILY',
				     P_OBJECT_VERSION_NUMBER        => lv_object_version_number,
				     P_PRIMARY                      => l_old_rel_values.primary,
				     P_SECONDARY                    => l_old_rel_values.secondary,
				     P_JOINT_SALUTATION             => l_old_rel_values.joint_salutation,
				     P_NEXT_TO_KIN                  => l_old_rel_values.next_to_kin,
				     P_REP_FACULTY                  => l_old_rel_values.rep_faculty,
				     P_REP_STAFF                    => l_old_rel_values.rep_staff,
				     P_REP_STUDENT                  => l_old_rel_values.rep_student,
				     P_REP_ALUMNI                   => l_old_rel_values.rep_alumni,
				     P_EMERGENCY_CONTACT_FLAG       => l_old_rel_values.emergency_contact_flag
			);
Line: 14194

		fnd_message.set_name('IGS','IGS_SV_REL_UPDATED');