15: is
16: lv_count number := 0 ;
17: begin
18: select count(*) into lv_count
19: from igs_ss_su_selection
20: where person_id = p_person_id
21: and call_number = p_call_number
22: and cal_type = p_cal_type
23: and ci_sequence_number = p_ci_sequence_number ;
23: and ci_sequence_number = p_ci_sequence_number ;
24: if lv_count = 0
25: then
26: begin
27: insert into igs_ss_su_selection
28: (
29: usec_su_selection_id ,
30: person_id ,
31: unit_cd ,
47: last_update_login ,
48: org_id
49: )
50: select
51: igs_ss_su_selection_s.nextval,
52: p_person_id,
53: unit_cd,
54: version_number ,
55: cal_type ,
86: fnd_msg_pub.add;
87: p_return_status := fnd_api.g_ret_sts_error;
88: end ;
89: else
90: fnd_message.set_name('IGS','IGS_SS_SU_SELECTION_PK');
91: fnd_msg_pub.add;
92: p_return_status := fnd_api.g_ret_sts_error;
93: end if ;
94:
132: p_insert_flag := 'NA' ;
133: elsif lv_count = 1
134: then
135: begin
136: insert into igs_ss_su_selection
137: (
138: usec_su_selection_id ,
139: person_id ,
140: unit_cd ,
156: last_update_login,
157: org_id
158: )
159: select
160: igs_ss_su_selection_s.nextval,
161: p_person_id,
162: unit_cd,
163: version_number ,
164: cal_type ,
191: end if ;
192: exception
193: when dup_val_on_index
194: then
195: fnd_message.set_name('IGS','IGS_SS_SU_SELECTION_PK');
196: fnd_msg_pub.add;
197: p_return_status := fnd_api.g_ret_sts_error;
198: end ;
199: else
224: as
225: lv_count number := 0 ;
226: begin
227: select count(*) into lv_count
228: from igs_ss_su_selection
229: where person_id = p_person_id
230: and uoo_id = p_uoo_id ;
231: if lv_count = 0
232: then
230: and uoo_id = p_uoo_id ;
231: if lv_count = 0
232: then
233: begin
234: insert into igs_ss_su_selection
235: (
236: usec_su_selection_id ,
237: person_id ,
238: unit_cd ,
254: last_update_login ,
255: org_id
256: )
257: select
258: igs_ss_su_selection_s.nextval,
259: p_person_id ,
260: a.unit_cd ,
261: a.version_number ,
262: a.cal_type ,
279: where uoo_id = p_uoo_id ;
280: exception
281: when dup_val_on_index
282: then
283: fnd_message.set_name('IGS','IGS_SS_SU_SELECTION_PK');
284: fnd_msg_pub.add;
285: p_return_status := fnd_api.g_ret_sts_error;
286: when others
287: then
289: fnd_msg_pub.add;
290: p_return_status := fnd_api.g_ret_sts_error;
291: end ;
292: else
293: fnd_message.set_name('IGS','IGS_SS_SU_SELECTION_PK');
294: fnd_msg_pub.add;
295: p_return_status := fnd_api.g_ret_sts_error;
296: end if ;
297: fnd_msg_pub.count_and_get
322: )
323: is
324: begin
325: begin
326: delete from igs_ss_su_selection
327: where person_id = p_person_id
328: and uoo_id = p_uoo_id ;
329: if sql%rowcount = 0
330: then
451: p_return_status := fnd_api.g_ret_sts_error;
452: end ;
453:
454: begin
455: delete from igs_ss_su_selection
456: where person_id = p_person_id
457: and uoo_id = p_uoo_id ;
458: if sql%rowcount = 0
459: then