DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGS_PR_CSS_CLASS_STD_PKG

Source


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