DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGS_PE_NONIMG_EMPL_PKG

Source


1 PACKAGE BODY igs_pe_nonimg_empl_pkg AS
2 /* $Header: IGSNIA8B.pls 120.2 2006/02/17 06:57:01 gmaheswa ship $ */
3 
4   l_rowid VARCHAR2(25);
5   old_references igs_pe_nonimg_empl%ROWTYPE;
6   new_references igs_pe_nonimg_empl%ROWTYPE;
7 
8   PROCEDURE set_column_values (
9     p_action                            IN     VARCHAR2,
10     x_rowid                             IN     VARCHAR2,
11     x_nonimg_empl_id                    IN     NUMBER,
12     x_nonimg_form_id                    IN     NUMBER,
13     x_empl_type                         IN     VARCHAR2,
14     x_recommend_empl                    IN     VARCHAR2,
15     x_rescind_empl                      IN     VARCHAR2,
16     x_remarks                           IN     VARCHAR2,
17     x_empl_start_date                   IN     DATE,
18     x_empl_end_date                     IN     DATE,
19     x_course_relevance                  IN     VARCHAR2,
20     x_empl_time                         IN     VARCHAR2,
21     x_empl_party_id                     IN     NUMBER,
22     x_creation_date                     IN     DATE,
23     x_created_by                        IN     NUMBER,
24     x_last_update_date                  IN     DATE,
25     x_last_updated_by                   IN     NUMBER,
26     x_last_update_login                 IN     NUMBER ,
27     x_action_code			IN     VARCHAR2,
28     x_print_flag			IN     VARCHAR2
29   ) AS
30   /*
31   ||  Created By : [email protected]
32   ||  Created On : 28-NOV-2002
33   ||  Purpose : Initialises the Old and New references for the columns of the table.
34   ||  Known limitations, enhancements or remarks :
35   ||  Change History :
36   ||  Who             When            What
37   ||  (reverse chronological order - newest change first)
38   */
39 
40     CURSOR cur_old_ref_values IS
41       SELECT   *
42       FROM     igs_pe_nonimg_empl
43       WHERE    rowid = x_rowid;
44 
45   BEGIN
46 
47     l_rowid := x_rowid;
48 
49     -- Code for setting the Old and New Reference Values.
50     -- Populate Old Values.
51     OPEN cur_old_ref_values;
52     FETCH cur_old_ref_values INTO old_references;
53     IF ((cur_old_ref_values%NOTFOUND) AND (p_action NOT IN ('INSERT', 'VALIDATE_INSERT'))) THEN
54       CLOSE cur_old_ref_values;
55       fnd_message.set_name ('FND', 'FORM_RECORD_DELETED');
56       igs_ge_msg_stack.add;
57       app_exception.raise_exception;
58       RETURN;
59     END IF;
60     CLOSE cur_old_ref_values;
61 
62     -- Populate New Values.
63     new_references.nonimg_empl_id                    := x_nonimg_empl_id;
64     new_references.nonimg_form_id                    := x_nonimg_form_id;
65     new_references.empl_type                         := x_empl_type;
66     new_references.recommend_empl                    := x_recommend_empl;
67     new_references.rescind_empl                      := x_rescind_empl;
68     new_references.remarks                           := x_remarks;
69     new_references.empl_start_date                   := x_empl_start_date;
70     new_references.empl_end_date                     := x_empl_end_date;
71     new_references.course_relevance                  := x_course_relevance;
72     new_references.empl_time                         := x_empl_time;
73     new_references.empl_party_id                     := x_empl_party_id;
74 
75     IF (p_action = 'UPDATE') THEN
76       new_references.creation_date                   := old_references.creation_date;
77       new_references.created_by                      := old_references.created_by;
78     ELSE
79       new_references.creation_date                   := x_creation_date;
80       new_references.created_by                      := x_created_by;
81     END IF;
82 
83     new_references.last_update_date                  := x_last_update_date;
84     new_references.last_updated_by                   := x_last_updated_by;
85     new_references.last_update_login                 := x_last_update_login;
86     new_references.action_code			     := x_action_code;
87     new_references.print_flag			     := x_print_flag;
88   END set_column_values;
89 
90 
91   PROCEDURE check_parent_existance AS
92   /*
93   ||  Created By : [email protected]
94   ||  Created On : 28-NOV-2002
95   ||  Purpose : Checks for the existance of Parent records.
96   ||  Known limitations, enhancements or remarks :
97   ||  Change History :
98   ||  Who             When            What
99   ||  (reverse chronological order - newest change first)
100   */
101   BEGIN
102 
103     IF (((old_references.nonimg_form_id = new_references.nonimg_form_id)) OR
104         ((new_references.nonimg_form_id IS NULL))) THEN
105       NULL;
106     ELSIF NOT igs_pe_nonimg_form_pkg.get_pk_for_validation ( new_references.nonimg_form_id ) THEN
107       fnd_message.set_name ('FND', 'FORM_RECORD_DELETED');
108       igs_ge_msg_stack.add;
109       app_exception.raise_exception;
110     END IF;
111 
112   END check_parent_existance;
113 
114 
115   FUNCTION get_pk_for_validation ( x_nonimg_empl_id    IN     NUMBER   ) RETURN BOOLEAN AS
116   /*
117   ||  Created By : [email protected]
118   ||  Created On : 28-NOV-2002
119   ||  Purpose : Validates the Primary Key of the table.
120   ||  Known limitations, enhancements or remarks :
121   ||  Change History :
122   ||  Who             When            What
123   ||  (reverse chronological order - newest change first)
124   */
125     CURSOR cur_rowid IS
126       SELECT   rowid
127       FROM     igs_pe_nonimg_empl
128       WHERE    nonimg_empl_id = x_nonimg_empl_id
129       FOR UPDATE NOWAIT;
130 
131     lv_rowid cur_rowid%RowType;
132 
133   BEGIN
134 
135     OPEN cur_rowid;
136     FETCH cur_rowid INTO lv_rowid;
137     IF (cur_rowid%FOUND) THEN
138       CLOSE cur_rowid;
139       RETURN(TRUE);
140     ELSE
141       CLOSE cur_rowid;
142       RETURN(FALSE);
143     END IF;
144 
145   END get_pk_for_validation;
146 
147 
148   PROCEDURE get_fk_igs_pe_nonimg_form (
149     x_nonimg_form_id                    IN     NUMBER
150   ) AS
151   /*
152   ||  Created By : [email protected]
153   ||  Created On : 28-NOV-2002
154   ||  Purpose : Validates the Foreign Keys for the table.
155   ||  Known limitations, enhancements or remarks :
156   ||  Change History :
157   ||  Who             When            What
158   ||  (reverse chronological order - newest change first)
159   */
160     CURSOR cur_rowid IS
161       SELECT   rowid
162       FROM     igs_pe_nonimg_empl
163       WHERE   ((nonimg_form_id = x_nonimg_form_id));
164 
165     lv_rowid cur_rowid%RowType;
166 
167   BEGIN
168 
169     OPEN cur_rowid;
170     FETCH cur_rowid INTO lv_rowid;
171     IF (cur_rowid%FOUND) THEN
172       CLOSE cur_rowid;
173       fnd_message.set_name ('IGS', 'IGS_PE_PENEM_PENIF_FK');
174       igs_ge_msg_stack.add;
175       app_exception.raise_exception;
176       RETURN;
177     END IF;
178     CLOSE cur_rowid;
179 
180   END get_fk_igs_pe_nonimg_form;
181 
182 
183   PROCEDURE before_dml (
184     p_action                            IN     VARCHAR2,
185     x_rowid                             IN     VARCHAR2,
186     x_nonimg_empl_id                    IN     NUMBER,
187     x_nonimg_form_id                    IN     NUMBER,
188     x_empl_type                         IN     VARCHAR2,
189     x_recommend_empl                    IN     VARCHAR2,
190     x_rescind_empl                      IN     VARCHAR2,
191     x_remarks                           IN     VARCHAR2,
192     x_empl_start_date                   IN     DATE,
193     x_empl_end_date                     IN     DATE,
194     x_course_relevance                  IN     VARCHAR2,
195     x_empl_time                         IN     VARCHAR2,
196     x_empl_party_id                     IN     NUMBER,
197     x_creation_date                     IN     DATE,
198     x_created_by                        IN     NUMBER,
199     x_last_update_date                  IN     DATE,
200     x_last_updated_by                   IN     NUMBER,
201     x_last_update_login                 IN     NUMBER,
202     x_action_code			IN     VARCHAR2,
203     x_print_flag			IN     VARCHAR2
204   ) AS
205   /*
206   ||  Created By : [email protected]
207   ||  Created On : 28-NOV-2002
208   ||  Purpose : Initialises the columns, Checks Constraints, Calls the
209   ||            Trigger Handlers for the table, before any DML operation.
210   ||  Known limitations, enhancements or remarks :
211   ||  Change History :
212   ||  Who             When            What
213   ||  (reverse chronological order - newest change first)
214   */
215   BEGIN
216 
217     set_column_values (
218       p_action,
219       x_rowid,
220       x_nonimg_empl_id,
221       x_nonimg_form_id,
222       x_empl_type,
223       x_recommend_empl,
224       x_rescind_empl,
225       x_remarks,
226       x_empl_start_date,
227       x_empl_end_date,
228       x_course_relevance,
229       x_empl_time,
230       x_empl_party_id,
231       x_creation_date,
232       x_created_by,
233       x_last_update_date,
234       x_last_updated_by,
235       x_last_update_login ,
236       x_action_code,
237       x_print_flag
238     );
239 
240     IF (p_action = 'INSERT') THEN
241       -- Call all the procedures related to Before Insert.
242       IF ( get_pk_for_validation( new_references.nonimg_empl_id ) ) THEN
243         fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
244         igs_ge_msg_stack.add;
245         app_exception.raise_exception;
246       END IF;
247       check_parent_existance;
248     ELSIF (p_action = 'UPDATE') THEN
249       -- Call all the procedures related to Before Update.
250       check_parent_existance;
251     ELSIF (p_action = 'VALIDATE_INSERT') THEN
252       -- Call all the procedures related to Before Insert.
253       IF ( get_pk_for_validation ( new_references.nonimg_empl_id ) ) THEN
254         fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
255         igs_ge_msg_stack.add;
256         app_exception.raise_exception;
257       END IF;
258     END IF;
259 
260   END before_dml;
261 
262 
263   PROCEDURE insert_row (
264     x_rowid                             IN OUT NOCOPY VARCHAR2,
265     x_nonimg_empl_id                    IN OUT NOCOPY NUMBER,
266     x_nonimg_form_id                    IN     NUMBER,
267     x_empl_type                         IN     VARCHAR2,
268     x_recommend_empl                    IN     VARCHAR2,
269     x_rescind_empl                      IN     VARCHAR2,
270     x_remarks                           IN     VARCHAR2,
271     x_empl_start_date                   IN     DATE,
272     x_empl_end_date                     IN     DATE,
273     x_course_relevance                  IN     VARCHAR2,
274     x_empl_time                         IN     VARCHAR2,
275     x_empl_party_id                     IN     NUMBER,
276     x_mode                              IN     VARCHAR2,
277     x_action_code			IN     VARCHAR2,
278     x_print_flag			IN     VARCHAR2
279   ) AS
280   /*
281   ||  Created By : [email protected]
282   ||  Created On : 28-NOV-2002
283   ||  Purpose : Handles the INSERT DML logic for the table.
284   ||  Known limitations, enhancements or remarks :
285   ||  Change History :
286   ||  Who             When            What
287   ||  (reverse chronological order - newest change first)
288   */
289 
290     x_last_update_date           DATE;
291     x_last_updated_by            NUMBER;
292     x_last_update_login          NUMBER;
293 
294   BEGIN
295 
296     x_last_update_date := SYSDATE;
297     IF (x_mode = 'I') THEN
298       x_last_updated_by := 1;
299       x_last_update_login := 0;
300     ELSIF (X_MODE IN ('R', 'S')) THEN
301       x_last_updated_by := fnd_global.user_id;
302       IF (x_last_updated_by IS NULL) THEN
303         x_last_updated_by := -1;
304       END IF;
305       x_last_update_login := fnd_global.login_id;
306       IF (x_last_update_login IS NULL) THEN
307         x_last_update_login := -1;
308       END IF;
309     ELSE
310       fnd_message.set_name ('FND', 'SYSTEM-INVALID ARGS');
311       igs_ge_msg_stack.add;
312       app_exception.raise_exception;
313     END IF;
314 
315     before_dml(
316       p_action                            => 'INSERT',
317       x_rowid                             => x_rowid,
318       x_nonimg_empl_id                    => x_nonimg_empl_id,
319       x_nonimg_form_id                    => x_nonimg_form_id,
320       x_empl_type                         => x_empl_type,
321       x_recommend_empl                    => x_recommend_empl,
322       x_rescind_empl                      => x_rescind_empl,
323       x_remarks                           => x_remarks,
324       x_empl_start_date                   => x_empl_start_date,
325       x_empl_end_date                     => x_empl_end_date,
326       x_course_relevance                  => x_course_relevance,
327       x_empl_time                         => x_empl_time,
328       x_empl_party_id                     => x_empl_party_id,
329       x_creation_date                     => x_last_update_date,
330       x_created_by                        => x_last_updated_by,
331       x_last_update_date                  => x_last_update_date,
332       x_last_updated_by                   => x_last_updated_by,
333       x_last_update_login                 => x_last_update_login,
334       x_action_code			  => x_action_code,
335       x_print_flag			  => x_print_flag
336     );
337 
338      IF (x_mode = 'S') THEN
339     igs_sc_gen_001.set_ctx('R');
340   END IF;
341  INSERT INTO igs_pe_nonimg_empl (
342       nonimg_empl_id,
343       nonimg_form_id,
344       empl_type,
345       recommend_empl,
346       rescind_empl,
347       remarks,
348       empl_start_date,
349       empl_end_date,
350       course_relevance,
351       empl_time,
352       empl_party_id,
353       creation_date,
354       created_by,
355       last_update_date,
356       last_updated_by,
357       last_update_login,
358       action_code,
359       print_flag
360     ) VALUES (
361       igs_pe_nonimg_empl_s.NEXTVAL,
362       new_references.nonimg_form_id,
363       new_references.empl_type,
364       new_references.recommend_empl,
365       new_references.rescind_empl,
366       new_references.remarks,
367       new_references.empl_start_date,
368       new_references.empl_end_date,
369       new_references.course_relevance,
370       new_references.empl_time,
371       new_references.empl_party_id,
372       x_last_update_date,
373       x_last_updated_by,
374       x_last_update_date,
375       x_last_updated_by,
376       x_last_update_login,
377       new_references.action_code,
378       new_references.print_flag
379     ) RETURNING ROWID, nonimg_empl_id INTO x_rowid, x_nonimg_empl_id;
380  IF (x_mode = 'S') THEN
381     igs_sc_gen_001.unset_ctx('R');
382   END IF;
383 
384 
385 
386 EXCEPTION
387   WHEN OTHERS THEN
388     IF (SQLCODE IN (-28115, -28113, -28111)) THEN
389       fnd_message.set_name ('IGS', 'IGS_SC_POLICY_EXCEPTION');
390       fnd_message.set_token ('ERR_CD', SQLCODE);
391       igs_ge_msg_stack.add;
392       igs_sc_gen_001.unset_ctx('R');
393       app_exception.raise_exception;
394     ELSE
395       igs_sc_gen_001.unset_ctx('R');
396       RAISE;
397     END IF;
398  END insert_row;
399 
400 
401   PROCEDURE lock_row (
402     x_rowid                             IN     VARCHAR2,
403     x_nonimg_empl_id                    IN     NUMBER,
404     x_nonimg_form_id                    IN     NUMBER,
405     x_empl_type                         IN     VARCHAR2,
406     x_recommend_empl                    IN     VARCHAR2,
407     x_rescind_empl                      IN     VARCHAR2,
408     x_remarks                           IN     VARCHAR2,
409     x_empl_start_date                   IN     DATE,
410     x_empl_end_date                     IN     DATE,
411     x_course_relevance                  IN     VARCHAR2,
412     x_empl_time                         IN     VARCHAR2,
413     x_empl_party_id                     IN     NUMBER,
414     x_action_code			IN     VARCHAR2,
415     x_print_flag			IN     VARCHAR2
416   ) AS
417   /*
418   ||  Created By : [email protected]
419   ||  Created On : 28-NOV-2002
420   ||  Purpose : Handles the LOCK mechanism for the table.
421   ||  Known limitations, enhancements or remarks :
422   ||  Change History :
423   ||  Who             When            What
424   ||  (reverse chronological order - newest change first)
425   */
426     CURSOR c1 IS
427       SELECT
428         nonimg_form_id,
429         empl_type,
430         recommend_empl,
431         rescind_empl,
432         remarks,
433         empl_start_date,
434         empl_end_date,
435         course_relevance,
436         empl_time,
437         empl_party_id,
438 	action_code,
439 	print_flag
440       FROM  igs_pe_nonimg_empl
441       WHERE rowid = x_rowid
442       FOR UPDATE NOWAIT;
443 
444     tlinfo c1%ROWTYPE;
445 
446   BEGIN
447 
448     OPEN c1;
449     FETCH c1 INTO tlinfo;
450     IF (c1%notfound) THEN
451       fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
452       igs_ge_msg_stack.add;
453       CLOSE c1;
454       app_exception.raise_exception;
455       RETURN;
456     END IF;
457     CLOSE c1;
458 
459     IF (
460         (tlinfo.nonimg_form_id = x_nonimg_form_id)
461         AND (tlinfo.empl_type = x_empl_type)
462         AND ((tlinfo.recommend_empl = x_recommend_empl) OR ((tlinfo.recommend_empl IS NULL) AND (X_recommend_empl IS NULL)))
463         AND ((tlinfo.rescind_empl = x_rescind_empl) OR ((tlinfo.rescind_empl IS NULL) AND (X_rescind_empl IS NULL)))
464         AND ((tlinfo.remarks = x_remarks) OR ((tlinfo.remarks IS NULL) AND (X_remarks IS NULL)))
465         AND ((tlinfo.empl_start_date = x_empl_start_date) OR ((tlinfo.empl_start_date IS NULL) AND (X_empl_start_date IS NULL)))
466         AND ((tlinfo.empl_end_date = x_empl_end_date) OR ((tlinfo.empl_end_date IS NULL) AND (X_empl_end_date IS NULL)))
467         AND ((tlinfo.course_relevance = x_course_relevance) OR ((tlinfo.course_relevance IS NULL) AND (X_course_relevance IS NULL)))
468         AND ((tlinfo.empl_time = x_empl_time) OR ((tlinfo.empl_time IS NULL) AND (X_empl_time IS NULL)))
469         AND ((tlinfo.empl_party_id = x_empl_party_id) OR ((tlinfo.empl_party_id IS NULL) AND (X_empl_party_id IS NULL)))
470         AND ((tlinfo.action_code = x_action_code) OR ((tlinfo.action_code IS NULL) AND (X_action_code IS NULL)))
471 	--AND ((tlinfo.print_flag = x_print_flag) OR ((tlinfo.print_flag IS NULL) AND (X_print_flag IS NULL)))  uncomment
472        ) THEN
473       NULL;
474     ELSE
475       fnd_message.set_name('FND', 'FORM_RECORD_CHANGED');
476       igs_ge_msg_stack.add;
477       app_exception.raise_exception;
478     END IF;
479 
480     RETURN;
481 
482   END lock_row;
483 
484 
485   PROCEDURE update_row (
486     x_rowid                             IN     VARCHAR2,
487     x_nonimg_empl_id                    IN     NUMBER,
488     x_nonimg_form_id                    IN     NUMBER,
489     x_empl_type                         IN     VARCHAR2,
490     x_recommend_empl                    IN     VARCHAR2,
491     x_rescind_empl                      IN     VARCHAR2,
492     x_remarks                           IN     VARCHAR2,
493     x_empl_start_date                   IN     DATE,
494     x_empl_end_date                     IN     DATE,
495     x_course_relevance                  IN     VARCHAR2,
496     x_empl_time                         IN     VARCHAR2,
497     x_empl_party_id                     IN     NUMBER,
498     x_mode                              IN     VARCHAR2 ,
499     x_action_code			IN     VARCHAR2,
500     x_print_flag			IN     VARCHAR2
501   ) AS
502   /*
503   ||  Created By : [email protected]
504   ||  Created On : 28-NOV-2002
505   ||  Purpose : Handles the UPDATE DML logic for the table.
506   ||  Known limitations, enhancements or remarks :
507   ||  Change History :
508   ||  Who             When            What
509   ||  (reverse chronological order - newest change first)
510   */
511     x_last_update_date           DATE ;
512     x_last_updated_by            NUMBER;
513     x_last_update_login          NUMBER;
514 
515   BEGIN
516 
517     x_last_update_date := SYSDATE;
518     IF (X_MODE = 'I') THEN
519       x_last_updated_by := 1;
520       x_last_update_login := 0;
521     ELSIF (X_MODE IN ('R', 'S')) THEN
522       x_last_updated_by := fnd_global.user_id;
523       IF x_last_updated_by IS NULL THEN
524         x_last_updated_by := -1;
525       END IF;
526       x_last_update_login := fnd_global.login_id;
527       IF (x_last_update_login IS NULL) THEN
528         x_last_update_login := -1;
529       END IF;
530     ELSE
531       fnd_message.set_name( 'FND', 'SYSTEM-INVALID ARGS');
532       igs_ge_msg_stack.add;
533       app_exception.raise_exception;
534     END IF;
535 
536     before_dml(
537       p_action                            => 'UPDATE',
538       x_rowid                             => x_rowid,
539       x_nonimg_empl_id                    => x_nonimg_empl_id,
540       x_nonimg_form_id                    => x_nonimg_form_id,
541       x_empl_type                         => x_empl_type,
542       x_recommend_empl                    => x_recommend_empl,
543       x_rescind_empl                      => x_rescind_empl,
544       x_remarks                           => x_remarks,
545       x_empl_start_date                   => x_empl_start_date,
546       x_empl_end_date                     => x_empl_end_date,
547       x_course_relevance                  => x_course_relevance,
548       x_empl_time                         => x_empl_time,
549       x_empl_party_id                     => x_empl_party_id,
550       x_creation_date                     => x_last_update_date,
551       x_created_by                        => x_last_updated_by,
552       x_last_update_date                  => x_last_update_date,
553       x_last_updated_by                   => x_last_updated_by,
554       x_last_update_login                 => x_last_update_login ,
555       x_action_code			  => x_action_code,
556       x_print_flag			  => x_print_flag
557     );
558 
559      IF (x_mode = 'S') THEN
560     igs_sc_gen_001.set_ctx('R');
561   END IF;
562  UPDATE igs_pe_nonimg_empl
563       SET
564         nonimg_form_id                    = new_references.nonimg_form_id,
565         empl_type                         = new_references.empl_type,
566         recommend_empl                    = new_references.recommend_empl,
567         rescind_empl                      = new_references.rescind_empl,
568         remarks                           = new_references.remarks,
569         empl_start_date                   = new_references.empl_start_date,
570         empl_end_date                     = new_references.empl_end_date,
571         course_relevance                  = new_references.course_relevance,
572         empl_time                         = new_references.empl_time,
573         empl_party_id                     = new_references.empl_party_id,
574         last_update_date                  = x_last_update_date,
575         last_updated_by                   = x_last_updated_by,
576         last_update_login                 = x_last_update_login,
577 	action_code			  = x_action_code,
578 	print_flag			  = x_print_flag
579       WHERE rowid = x_rowid;
580 
581     IF (SQL%NOTFOUND) THEN
582      fnd_message.set_name ('IGS', 'IGS_SC_POLICY_UPD_DEL_EXCEP');
583      igs_ge_msg_stack.add;
584      igs_sc_gen_001.unset_ctx('R');
585      app_exception.raise_exception;
586  END IF;
587  IF (x_mode = 'S') THEN
588     igs_sc_gen_001.unset_ctx('R');
589   END IF;
590 
591 
592 
593 EXCEPTION
594   WHEN OTHERS THEN
595     IF (SQLCODE = (-28115)) THEN
596       fnd_message.set_name ('IGS', 'IGS_SC_UPD_POLICY_EXCP');
597       fnd_message.set_token ('ERR_CD', SQLCODE);
598       igs_ge_msg_stack.add;
599       igs_sc_gen_001.unset_ctx('R');
600       app_exception.raise_exception;
601     ELSE
602       igs_sc_gen_001.unset_ctx('R');
603       RAISE;
604     END IF;
605  END update_row;
606 
607 
608   PROCEDURE add_row (
609     x_rowid                             IN OUT NOCOPY VARCHAR2,
610     x_nonimg_empl_id                    IN OUT NOCOPY NUMBER,
611     x_nonimg_form_id                    IN     NUMBER,
612     x_empl_type                         IN     VARCHAR2,
613     x_recommend_empl                    IN     VARCHAR2,
614     x_rescind_empl                      IN     VARCHAR2,
615     x_remarks                           IN     VARCHAR2,
616     x_empl_start_date                   IN     DATE,
617     x_empl_end_date                     IN     DATE,
618     x_course_relevance                  IN     VARCHAR2,
619     x_empl_time                         IN     VARCHAR2,
620     x_empl_party_id                     IN     NUMBER,
621     x_mode                              IN     VARCHAR2,
622     x_action_code			IN     VARCHAR2,
623     x_print_flag			IN     VARCHAR2
624   ) AS
625   /*
626   ||  Created By : [email protected]
627   ||  Created On : 28-NOV-2002
628   ||  Purpose : Adds a row if there is no existing row, otherwise updates existing row in the table.
629   ||  Known limitations, enhancements or remarks :
630   ||  Change History :
631   ||  Who             When            What
632   ||  (reverse chronological order - newest change first)
633   */
634     CURSOR c1 IS
635       SELECT   rowid
636       FROM     igs_pe_nonimg_empl
637       WHERE    nonimg_empl_id                    = x_nonimg_empl_id;
638 
639   BEGIN
640 
641     OPEN c1;
642     FETCH c1 INTO x_rowid;
643     IF (c1%NOTFOUND) THEN
644       CLOSE c1;
645 
646       insert_row (
647         x_rowid,
648         x_nonimg_empl_id,
649         x_nonimg_form_id,
650         x_empl_type,
651         x_recommend_empl,
652         x_rescind_empl,
653         x_remarks,
654         x_empl_start_date,
655         x_empl_end_date,
656         x_course_relevance,
657         x_empl_time,
658         x_empl_party_id,
659         x_mode ,
660 	x_action_code,
661 	x_print_flag
662       );
663       RETURN;
664     END IF;
665     CLOSE c1;
666 
667     update_row (
668       x_rowid,
669       x_nonimg_empl_id,
670       x_nonimg_form_id,
671       x_empl_type,
672       x_recommend_empl,
673       x_rescind_empl,
674       x_remarks,
675       x_empl_start_date,
676       x_empl_end_date,
677       x_course_relevance,
678       x_empl_time,
679       x_empl_party_id,
680       x_mode ,
681       x_action_code,
682       x_print_flag
683     );
684 
685   END add_row;
686 
687 
688   PROCEDURE delete_row (
689     x_rowid IN VARCHAR2,
690   x_mode IN VARCHAR2
691   ) AS
692   /*
693   ||  Created By : [email protected]
694   ||  Created On : 28-NOV-2002
695   ||  Purpose : Handles the DELETE DML logic for the table.
696   ||  Known limitations, enhancements or remarks :
697   ||  Change History :
698   ||  Who             When            What
699   ||  (reverse chronological order - newest change first)
700   */
701   BEGIN
702 
703     before_dml (
704       p_action => 'DELETE',
705       x_rowid => x_rowid
706     );
707 
708      IF (x_mode = 'S') THEN
709     igs_sc_gen_001.set_ctx('R');
710   END IF;
711  DELETE FROM igs_pe_nonimg_empl
712     WHERE rowid = x_rowid;
713 
714     IF (SQL%NOTFOUND) THEN
715      fnd_message.set_name ('IGS', 'IGS_SC_POLICY_UPD_DEL_EXCEP');
716      igs_ge_msg_stack.add;
717      igs_sc_gen_001.unset_ctx('R');
718      app_exception.raise_exception;
719  END IF;
720  IF (x_mode = 'S') THEN
721     igs_sc_gen_001.unset_ctx('R');
722   END IF;
723 
724 
725   END delete_row;
726 
727 
728 END igs_pe_nonimg_empl_pkg;