958: -- check whether corresponding record already exists.
959: CURSOR old_school_cur (p_school_id igs_uc_cvsch_ints.school%TYPE) IS
960: SELECT csh.rowid,
961: csh.*
962: FROM igs_uc_com_sch csh
963: WHERE csh.school = p_school_id ;
964:
965:
966: -- check for school type in Lookups
970: WHERE code_type = 'ST'
971: AND code = p_sch_type;
972:
973: -- school site details
974: CURSOR old_schsite_cur (p_sch_id igs_uc_com_schsites.school%TYPE, p_site_cd igs_uc_com_schsites.sitecode%TYPE ) IS
975: SELECT a.ROWID
976: FROM igs_uc_com_schsites a
977: WHERE school = p_sch_id
978: AND sitecode = p_site_cd;
972:
973: -- school site details
974: CURSOR old_schsite_cur (p_sch_id igs_uc_com_schsites.school%TYPE, p_site_cd igs_uc_com_schsites.sitecode%TYPE ) IS
975: SELECT a.ROWID
976: FROM igs_uc_com_schsites a
977: WHERE school = p_sch_id
978: AND sitecode = p_site_cd;
979:
980:
1039: IF old_school_rec.rowid IS NULL THEN
1040:
1041: BEGIN
1042: -- insert a new record in the main table
1043: igs_uc_com_sch_pkg.insert_row -- IGSXI10B.pls
1044: (
1045: x_rowid => old_school_rec.rowid
1046: ,x_school => new_school_rec.school
1047: ,x_school_name => new_school_rec.schoolname
1073: ELSE -- update
1074:
1075: BEGIN
1076: -- update a new record in the main table
1077: igs_uc_com_sch_pkg.update_row -- IGSXI10B.pls
1078: (
1079: x_rowid => old_school_rec.rowid
1080: ,x_school => old_school_rec.school
1081: ,x_school_name => new_school_rec.schoolname
1122: fnd_file.put_line(fnd_file.log, fnd_message.get);
1123:
1124: IF l_schsite_rowid IS NULL THEN
1125: BEGIN
1126: igs_uc_com_schsites_pkg.insert_row -- IGSXI11B.pls
1127: (
1128: x_rowid => l_schsite_rowid
1129: ,x_school => new_school_rec.school
1130: ,x_sitecode => NVL(new_school_rec.sitecode ,'A')
1148:
1149: ELSE
1150: -- update
1151: BEGIN
1152: igs_uc_com_schsites_pkg.update_row -- IGSXI11B.pls
1153: (
1154: x_rowid => l_schsite_rowid
1155: ,x_school => old_school_rec.school
1156: ,x_sitecode => NVL(new_school_rec.sitecode, 'A')
1273:
1274: -- validate school
1275: CURSOR chk_school (p_school igs_uc_cschcnt_ints.school%TYPE) IS
1276: SELECT 'X'
1277: FROM igs_uc_com_sch
1278: WHERE school = p_school;
1279:
1280: -- validate school site details
1281: CURSOR chk_schsite (p_school igs_uc_cschcnt_ints.school%TYPE, p_site_code igs_uc_cschcnt_ints.sitecode%TYPE) IS
1279:
1280: -- validate school site details
1281: CURSOR chk_schsite (p_school igs_uc_cschcnt_ints.school%TYPE, p_site_code igs_uc_cschcnt_ints.sitecode%TYPE) IS
1282: SELECT 'X'
1283: FROM igs_uc_com_schsites
1284: WHERE school = p_school
1285: AND sitecode = p_site_code;
1286:
1287: