DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGS_PS_USEC_X_GRP_PKG

Source


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