DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGS_EN_SVS_AUTH_CAL_PKG

Source


1 PACKAGE BODY igs_en_svs_auth_cal_pkg AS
2 /* $Header: IGSEI82B.pls 120.0 2006/05/02 01:43:28 amuthu noship $ */
3 
4   l_rowid VARCHAR2(25);
5   old_references igs_en_svs_auth_cal%ROWTYPE;
6   new_references igs_en_svs_auth_cal%ROWTYPE;
7 
8     PROCEDURE  afterinsert1(
9        x_sevis_auth_id IN NUMBER,
10        x_cal_type IN VARCHAR2,
11        x_ci_sequence_number IN NUMBER);
12 
13   PROCEDURE set_column_values (
14     p_action                            IN     VARCHAR2,
15     x_rowid                             IN     VARCHAR2,
16     x_sevis_auth_id                     IN     NUMBER,
17     x_cal_type                          IN     VARCHAR2,
18     x_ci_sequence_number                IN     NUMBER,
19     x_creation_date                     IN     DATE,
20     x_created_by                        IN     NUMBER,
21     x_last_update_date                  IN     DATE,
22     x_last_updated_by                   IN     NUMBER,
23     x_last_update_login                 IN     NUMBER
24   ) AS
25   /*
26   ||  Created By :
27   ||  Created On : 08-MAR-2006
28   ||  Purpose : Initialises the Old and New references for the columns of the table.
29   ||  Known limitations, enhancements or remarks :
30   ||  Change History :
31   ||  Who             When            What
32   ||  (reverse chronological order - newest change first)
33   */
34 
35     CURSOR cur_old_ref_values IS
36       SELECT   *
37       FROM     igs_en_svs_auth_cal
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 
51       fnd_message.set_name ('FND', 'FORM_RECORD_DELETED');
52       igs_ge_msg_stack.add;
53       app_exception.raise_exception;
54       RETURN;
55     END IF;
56     CLOSE cur_old_ref_values;
57 
58     -- Populate New Values.
59     new_references.sevis_auth_id                     := x_sevis_auth_id;
60     new_references.cal_type                          := x_cal_type;
61     new_references.ci_sequence_number                := x_ci_sequence_number;
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_parent_existance AS
79   /*
80   ||  Created By :
81   ||  Created On : 08-MAR-2006
82   ||  Purpose : Checks for the existance of Parent records.
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 (((old_references.sevis_auth_id = new_references.sevis_auth_id)) OR
91         ((new_references.sevis_auth_id IS NULL))) THEN
92       NULL;
93     ELSIF NOT igs_en_svs_auth_pkg.get_pk_for_validation (
94                 new_references.sevis_auth_id
95               ) THEN
96       fnd_message.set_name ('FND', 'FORM_RECORD_DELETED');
97       igs_ge_msg_stack.add;
98       app_exception.raise_exception;
99     END IF;
100 
101     IF (((old_references.cal_type = new_references.cal_type) AND
102          (old_references.ci_sequence_number = new_references.ci_sequence_number)) OR
103         ((new_references.cal_type is null) OR
104          (new_references.ci_sequence_number is null))) THEN
105       NULL;
106     ELSIF NOT igs_ca_inst_pkg.get_pk_for_validation (
107                         new_references.cal_type,
108                          new_references.ci_sequence_number
109         )  THEN
110      fnd_message.set_name ('FND','FORM_RECORD_DELETED');
111      igs_ge_msg_stack.add;
112      app_exception.raise_exception;
113     END IF;
114 
115 
116 
117   END check_parent_existance;
118 
119 
120   FUNCTION get_pk_for_validation (
121     x_sevis_auth_id                     IN     NUMBER,
122     x_cal_type                          IN     VARCHAR2,
123     x_ci_sequence_number                IN     NUMBER
124   ) RETURN BOOLEAN AS
125   /*
126   ||  Created By :
127   ||  Created On : 08-MAR-2006
128   ||  Purpose : Validates the Primary Key of the table.
129   ||  Known limitations, enhancements or remarks :
130   ||  Change History :
131   ||  Who             When            What
132   ||  (reverse chronological order - newest change first)
133   */
134     CURSOR cur_rowid IS
135       SELECT   rowid
136       FROM     igs_en_svs_auth_cal
137       WHERE    sevis_auth_id = x_sevis_auth_id
138       AND      cal_type = x_cal_type
139       AND      ci_sequence_number = x_ci_sequence_number
140       FOR UPDATE NOWAIT;
141 
142     lv_rowid cur_rowid%RowType;
143 
144   BEGIN
145 
146     OPEN cur_rowid;
147     FETCH cur_rowid INTO lv_rowid;
148     IF (cur_rowid%FOUND) THEN
149       CLOSE cur_rowid;
150       RETURN(TRUE);
151     ELSE
152       CLOSE cur_rowid;
153       RETURN(FALSE);
154     END IF;
155 
156   END get_pk_for_validation;
157 
158 
159   PROCEDURE get_fk_igs_en_svs_auth (
160     x_sevis_auth_id                     IN     NUMBER
161   ) AS
162   /*
163   ||  Created By :
164   ||  Created On : 08-MAR-2006
165   ||  Purpose : Validates the Foreign Keys for the table.
166   ||  Known limitations, enhancements or remarks :
167   ||  Change History :
168   ||  Who             When            What
169   ||  (reverse chronological order - newest change first)
170   */
171     CURSOR cur_rowid IS
172       SELECT   rowid
173       FROM     igs_en_svs_auth_cal
174       WHERE   ((sevis_auth_id = x_sevis_auth_id));
175 
176     lv_rowid cur_rowid%RowType;
177 
178   BEGIN
179 
180     OPEN cur_rowid;
181     FETCH cur_rowid INTO lv_rowid;
182     IF (cur_rowid%FOUND) THEN
183       CLOSE cur_rowid;
184       fnd_message.set_name ('IGS', 'IGS_EN_ESAC_ESA_FK');
185       igs_ge_msg_stack.add;
186       app_exception.raise_exception;
187       RETURN;
188     END IF;
189     CLOSE cur_rowid;
190 
191   END get_fk_igs_en_svs_auth;
192 
193 
194   PROCEDURE get_fk_igs_ca_inst (
195     x_cal_type IN VARCHAR2,
196     x_ci_sequence_number IN NUMBER
197     ) AS
198     CURSOR cur_rowid IS
199       SELECT ROWID
200       FROM   igs_en_svs_auth_cal
201       WHERE  cal_type = x_cal_type
202             AND  ci_sequence_number = x_ci_sequence_number  ;
203     lv_rowid cur_rowid%ROWTYPE;
204 
205   BEGIN
206     OPEN cur_rowid;
207     FETCH cur_rowid INTO lv_rowid;
208     IF (cur_rowid%FOUND) THEN
209       Fnd_Message.Set_Name ('IGS', 'IGS_EN_ESAC_CI_FK');
210       Igs_Ge_Msg_Stack.ADD;
211       CLOSE cur_rowid;
212       App_Exception.Raise_Exception;
213       RETURN;
214     END IF;
215     CLOSE cur_rowid;
216   END get_fk_igs_ca_inst;
217 
218   PROCEDURE beforedelete1(
219     x_sevis_auth_id                     IN     NUMBER,
220     x_cal_type                          IN     VARCHAR2,
221     x_ci_sequence_number                IN     NUMBER
222   ) AS
223 
224     CURSOR c_auth IS
225     SELECT eeo.ELGB_OVERRIDE_ID, esa.person_id
226     FROM IGS_EN_SVS_AUTH esa,
227          IGS_EN_ELGB_OVR eeo
228     WHERE esa.SEVIS_AUTH_ID = x_sevis_auth_id
229     AND esa.person_id = eeo.person_id
230     AND eeo.cal_type = x_cal_type
231     AND eeo.ci_sequence_number = x_ci_sequence_number;
232 
233     CURSOR c_another_auth (cp_person_id HZ_PARTIES.PARTY_ID%TYPE) IS
234       SELECT 'X'
235       FROM IGS_EN_SVS_AUTH_CAL sac, IGS_EN_SVS_AUTH esa
236       WHERE esa.SEVIS_AUTH_ID <> x_sevis_auth_id
237       AND esa.person_id = cp_person_id
238       AND esa.sevis_auth_id = sac.sevis_auth_id
239       AND sac.cal_type = x_cal_type
240       AND sac.ci_sequence_number = x_ci_sequence_number ;
241 
242     CURSOR c_eos (cp_elgb_override_id IGS_EN_ELGB_OVR.ELGB_OVERRIDE_ID%TYPE) IS
243     SELECT eos.rowid row_id, step_override_type, step_override_limit
244     FROM IGS_EN_ELGB_OVR_STEP eos
245     WHERE elgb_override_id = cp_elgb_override_id
246     AND STEP_OVERRIDE_TYPE IN ('FMIN_CRDT','FATD_TYPE');
247 
248     l_elgb_override_id IGS_EN_ELGB_OVR.ELGB_OVERRIDE_ID%TYPE;
249     l_step_override_type  IGS_EN_ELGB_OVR_STEP.step_override_type%TYPE;
250     l_step_override_limit IGS_EN_ELGB_OVR_STEP.step_override_limit%TYPE;
251     l_person_id HZ_PARTIES.PARTY_ID%TYPE;
252     l_dummy VARCHAR2(10);
253     l_rowid VARCHAR2(25);
254 
255   BEGIN
256 
257     OPEN c_auth;
258     FETCH c_auth INTO l_elgb_override_id, l_person_id;
259     IF c_auth%FOUND THEN
260       CLOSE c_auth;
261 
262         OPEN c_eos(l_elgb_override_id);
263         FETCH c_eos INTO l_rowid,l_step_override_type,l_step_override_limit;
264         CLOSE c_eos;
265 
266         IF g_s_last_ovr_step IS NULL THEN
267           g_s_last_ovr_step := l_step_override_type;
268           g_s_last_step_limit := l_step_override_limit;
269         END IF;
270 
271         OPEN c_another_auth(l_person_id);
272         FETCH c_another_auth INTO l_dummy;
273         IF c_another_auth%NOTFOUND THEN
274           CLOSE c_another_auth;
275           FOR c_eos_rec in c_eos(l_elgb_override_id) LOOP
276             IGS_EN_ELGB_OVR_STEP_PKG.DELETE_ROW(c_eos_rec.row_id);
277           END LOOP;
278         ELSE
279           CLOSE c_another_auth;
280         END IF;
281 
282     ELSE
283       CLOSE c_auth;
284     END IF;
285 
286   END beforedelete1;
287 
288 
289 
290   PROCEDURE before_dml (
291     p_action                            IN     VARCHAR2,
292     x_rowid                             IN     VARCHAR2,
293     x_sevis_auth_id                     IN     NUMBER,
294     x_cal_type                          IN     VARCHAR2,
295     x_ci_sequence_number                IN     NUMBER,
296     x_creation_date                     IN     DATE,
297     x_created_by                        IN     NUMBER,
298     x_last_update_date                  IN     DATE,
299     x_last_updated_by                   IN     NUMBER,
300     x_last_update_login                 IN     NUMBER
301   ) AS
302   /*
303   ||  Created By :
304   ||  Created On : 08-MAR-2006
305   ||  Purpose : Initialises the columns, Checks Constraints, Calls the
306   ||            Trigger Handlers for the table, before any DML operation.
307   ||  Known limitations, enhancements or remarks :
308   ||  Change History :
309   ||  Who             When            What
310   ||  (reverse chronological order - newest change first)
311   */
312   BEGIN
313 
314     set_column_values (
315       p_action,
316       x_rowid,
317       x_sevis_auth_id,
318       x_cal_type,
319       x_ci_sequence_number,
320       x_creation_date,
321       x_created_by,
322       x_last_update_date,
323       x_last_updated_by,
324       x_last_update_login
325     );
326 
327     IF (p_action = 'INSERT') THEN
328       -- Call all the procedures related to Before Insert.
329       IF ( get_pk_for_validation(
330              new_references.sevis_auth_id,
331              new_references.cal_type,
332              new_references.ci_sequence_number
333            )
334          ) THEN
335         fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
336         igs_ge_msg_stack.add;
337         app_exception.raise_exception;
338       END IF;
339       check_parent_existance;
340     ELSIF (p_action = 'UPDATE') THEN
341       -- Call all the procedures related to Before Update.
342       check_parent_existance;
343     ELSIF (p_action = 'VALIDATE_INSERT') THEN
344       -- Call all the procedures related to Before Insert.
345       IF ( get_pk_for_validation (
346              new_references.sevis_auth_id,
347              new_references.cal_type,
348              new_references.ci_sequence_number
349            )
350          ) THEN
351         fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
352         igs_ge_msg_stack.add;
353         app_exception.raise_exception;
354       END IF;
355     END IF;
356 
357     IF (p_action = 'DELETE') THEN
358       beforedelete1(
359        old_references.sevis_auth_id,
360        old_references.cal_type,
361        old_references.ci_sequence_number);
362     END IF;
363 
364   END before_dml;
365 
366   PROCEDURE after_dml (
367     p_action IN VARCHAR2,
368     x_rowid IN VARCHAR2
369   ) AS
370   BEGIN
371 
372     IF (p_action = 'INSERT') THEN
373       afterinsert1(
374        new_references.sevis_auth_id,
375        new_references.cal_type,
376        new_references.ci_sequence_number);
377     END IF;
378 
379   END after_dml;
380 
381   PROCEDURE  afterinsert1(
382        x_sevis_auth_id IN NUMBER,
383        x_cal_type IN VARCHAR2,
384        x_ci_sequence_number IN NUMBER) IS
385 
386     CURSOR c_step_exists IS
387     SELECT 'X'
388     FROM IGS_EN_ELGB_OVR_STEP eos,
389          IGS_EN_ELGB_OVR eo,
390          IGS_EN_SVS_AUTH esa
391     WHERE esa.sevis_auth_id = x_sevis_auth_id
392     AND esa.person_id = eo.person_id
393     AND eo.cal_type = x_cal_type
394     AND eo.CI_SEQUENCE_NUMBER = x_ci_sequence_number
395     AND eo.ELGB_OVERRIDE_ID = eos.ELGB_OVERRIDE_ID
396     AND eos.STEP_OVERRIDE_TYPE IN ('FMIN_CRDT','FATD_TYPE');
397 
398     CURSOR c_ovr IS
399     SELECT  eo.ELGB_OVERRIDE_ID
400     FROM IGS_EN_SVS_AUTH esa, IGS_EN_ELGB_OVR eo
401     WHERE esa.sevis_auth_id = x_sevis_auth_id
402     AND esa.person_id = eo.person_id
403     AND eo.cal_type = x_cal_type
404     AND eo.ci_sequence_number = X_ci_sequence_number;
405 
406 
407     CURSOR c_earliest_cal IS
408     SELECT  cal_type, ci_sequence_number
409     FROM IGS_EN_SVS_AUTH_CAL
410     WHERE sevis_auth_id = x_sevis_auth_id
411     ORDER BY CREATION_DATE ASC;
412 
413     CURSOR c_person_id IS
414     SELECT person_id
415     FROM igs_en_svs_auth
416     WHERE sevis_auth_id = x_sevis_auth_id;
417 
418 
419     CURSOR c_ovr_step (cp_person_id hz_parties.party_id%TYPE,
420                        cp_cal_type IGS_CA_INST.CAL_TYPE%TYPE,
421                        cp_ci_sequence_number IGS_CA_INST.SEQUENCE_NUMBER%TYPE)IS
422     SELECT STEP_OVERRIDE_TYPE, STEP_OVERRIDE_LIMIT
423     FROM IGS_EN_ELGB_OVR_STEP eos, IGS_EN_ELGB_OVR eo
424     WHERE eo.elgb_override_id = eos.elgb_override_id
425     AND eo.person_id = cp_person_id
426     AND eo.cal_type = cp_cal_type
427     AND eo.ci_sequence_number = cp_ci_sequence_number
428     AND STEP_OVERRIDE_TYPE IN ('FMIN_CRDT','FATD_TYPE')
429     ORDER BY eos.CREATION_DATE ASC;
430 
431 
432     l_cal_type IGS_CA_INST.CAL_TYPE%TYPE;
433     l_ci_sequence_number IGS_CA_INST.SEQUENCE_NUMBER%TYPE;
434     l_person_id hz_parties.party_id%TYPE;
435     l_elgb_override_id igs_en_elgb_ovr.elgb_override_id%TYPE;
436     l_step IGS_EN_ELGB_OVR_STEP.STEP_OVERRIDE_TYPE%TYPE;
437     l_limit IGS_EN_ELGB_OVR_STEP.STEP_OVERRIDE_LIMIT%TYPE;
438 
439     l_rowid            VARCHAR2(25);
440     l_elgb_ovr_step_id igs_en_elgb_ovr_step.elgb_ovr_step_id%TYPE;
441 
442     l_dummy VARCHAR2(1);
443 
444 
445   BEGIN
446 
447     OPEN c_person_id;
448     FETCH c_person_id INTO l_person_id;
449     CLOSE c_person_id;
450 
451     OPEN c_step_exists;
452     FETCH c_step_exists INTO l_dummy;
453 
454     IF c_step_exists%NOTFOUND THEN
455       CLOSE c_step_exists;
456 
457       OPEN c_ovr;
458       FETCH c_ovr INTO l_elgb_override_id;
459       IF c_ovr%NOTFOUND THEN
460           l_rowid := NULL;
461           l_elgb_override_id := NULL;
462 
463           igs_en_elgb_ovr_pkg.insert_row (
464             x_mode                              => 'R',
465             x_rowid                             => l_rowid,
466             x_elgb_override_id                  => l_elgb_override_id,
467             x_person_id                         => l_person_id,
468             x_cal_type                          => x_cal_type,
469             x_ci_sequence_number                => x_ci_sequence_number
470           );
471 
472       END IF;
473       CLOSE c_ovr;
474 
475       OPEN c_earliest_cal;
476       FETCH c_earliest_cal INTO l_cal_type, l_ci_sequence_number;
477       IF c_earliest_cal%NOTFOUND THEN
478         l_step := g_s_last_ovr_step;
479         l_limit := g_s_last_step_limit;
480       ELSE
481 
482         OPEN c_ovr_step(l_person_id,l_cal_type, l_ci_sequence_number );
483         FETCH c_ovr_step INTO l_step,l_limit;
484         IF c_ovr_step%NOTFOUND THEN
485           l_step := g_s_last_ovr_step;
486           l_limit := g_s_last_step_limit;
487         END IF;
488         CLOSE c_ovr_step;
489       END IF;
490       CLOSE c_earliest_cal;
491 
492 
493       IF l_step IS NOT NULL THEN
494 
495         l_rowid := NULL;
496         l_elgb_ovr_step_id := NULL;
497 
498         igs_en_elgb_ovr_step_pkg.insert_row (
499           x_mode                              => 'R',
500           x_rowid                             => l_rowid,
501           x_elgb_ovr_step_id                  => l_elgb_ovr_step_id,
502           x_elgb_override_id                  => l_elgb_override_id,
503           x_step_override_type                => l_step,
504           x_step_override_dt                  => trunc(SYSDATE),
505           x_step_override_limit               => l_limit
506         );
507       ELSE
508         fnd_message.set_name('IGS', 'IGS_EN_CANNOT_FIND_STEP');
509         igs_ge_msg_stack.add;
510         app_exception.raise_exception;
511       END IF;
512     ELSE
513       CLOSE c_step_exists;
514     END IF;
515 
516     g_s_last_ovr_step := NULL;
517     g_s_last_step_limit := NULL;
518 
519 
520   END afterinsert1;
521 
522   PROCEDURE insert_row (
523     x_rowid                             IN OUT NOCOPY VARCHAR2,
524     x_sevis_auth_id                     IN     NUMBER,
525     x_cal_type                          IN     VARCHAR2,
526     x_ci_sequence_number                IN     NUMBER,
527     x_mode                              IN     VARCHAR2
528   ) AS
529   /*
530   ||  Created By :
531   ||  Created On : 08-MAR-2006
532   ||  Purpose : Handles the INSERT DML logic for the table.
533   ||  Known limitations, enhancements or remarks :
534   ||  Change History :
535   ||  Who             When            What
536   ||  (reverse chronological order - newest change first)
537   */
538 
539     x_last_update_date           DATE;
540     x_last_updated_by            NUMBER;
541     x_last_update_login          NUMBER;
542 
543   BEGIN
544 
545     x_last_update_date := SYSDATE;
546     IF (x_mode = 'I') THEN
547       x_last_updated_by := 1;
548       x_last_update_login := 0;
549     ELSIF (x_mode = 'R') THEN
550       x_last_updated_by := fnd_global.user_id;
551       IF (x_last_updated_by IS NULL) THEN
552         x_last_updated_by := -1;
553       END IF;
554       x_last_update_login := fnd_global.login_id;
555       IF (x_last_update_login IS NULL) THEN
556         x_last_update_login := -1;
557       END IF;
558     ELSE
559       fnd_message.set_name ('FND', 'SYSTEM-INVALID ARGS');
560       fnd_message.set_token ('ROUTINE', 'IGS_EN_SVS_AUTH_CAL_PKG.INSERT_ROW');
561       igs_ge_msg_stack.add;
562       app_exception.raise_exception;
563     END IF;
564 
565     before_dml(
566       p_action                            => 'INSERT',
567       x_rowid                             => x_rowid,
568       x_sevis_auth_id                     => x_sevis_auth_id,
569       x_cal_type                          => x_cal_type,
570       x_ci_sequence_number                => x_ci_sequence_number,
571       x_creation_date                     => x_last_update_date,
572       x_created_by                        => x_last_updated_by,
573       x_last_update_date                  => x_last_update_date,
574       x_last_updated_by                   => x_last_updated_by,
575       x_last_update_login                 => x_last_update_login
576     );
577 
578     INSERT INTO igs_en_svs_auth_cal (
579       sevis_auth_id,
580       cal_type,
581       ci_sequence_number,
582       creation_date,
583       created_by,
584       last_update_date,
585       last_updated_by,
586       last_update_login
587     ) VALUES (
588       new_references.sevis_auth_id,
589       new_references.cal_type,
590       new_references.ci_sequence_number,
591       x_last_update_date,
592       x_last_updated_by,
593       x_last_update_date,
594       x_last_updated_by,
595       x_last_update_login
596     ) RETURNING ROWID INTO x_rowid;
597 
598       after_dml(
599         p_action => 'INSERT',
600         x_rowid => x_rowid
601       );
602   EXCEPTION
603     WHEN OTHERS THEN
604       g_s_last_ovr_step := NULL;
605       g_s_last_step_limit := NULL;
606       RAISE;
607   END insert_row;
608 
609 
610   PROCEDURE lock_row (
611     x_rowid                             IN     VARCHAR2,
612     x_sevis_auth_id                     IN     NUMBER,
613     x_cal_type                          IN     VARCHAR2,
614     x_ci_sequence_number                IN     NUMBER
615   ) AS
616   /*
617   ||  Created By :
618   ||  Created On : 08-MAR-2006
619   ||  Purpose : Handles the LOCK mechanism for the table.
620   ||  Known limitations, enhancements or remarks :
621   ||  Change History :
622   ||  Who             When            What
623   ||  (reverse chronological order - newest change first)
624   */
625     CURSOR c1 IS
626       SELECT
627         rowid
628       FROM  igs_en_svs_auth_cal
629       WHERE rowid = x_rowid
630       FOR UPDATE NOWAIT;
631 
632     tlinfo c1%ROWTYPE;
633 
634   BEGIN
635 
636     OPEN c1;
637     FETCH c1 INTO tlinfo;
638     IF (c1%notfound) THEN
639       fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
640       igs_ge_msg_stack.add;
641       CLOSE c1;
642       app_exception.raise_exception;
643       RETURN;
644     END IF;
645     CLOSE c1;
646 
647 
648     RETURN;
649 
650   END lock_row;
651 
652 
653   PROCEDURE delete_row (
654     x_rowid IN VARCHAR2
655   ) AS
656   /*
657   ||  Created By :
658   ||  Created On : 08-MAR-2006
659   ||  Purpose : Handles the DELETE DML logic for the table.
660   ||  Known limitations, enhancements or remarks :
661   ||  Change History :
662   ||  Who             When            What
663   ||  (reverse chronological order - newest change first)
664   */
665   BEGIN
666 
667     before_dml (
668       p_action => 'DELETE',
669       x_rowid => x_rowid
670     );
671 
672     DELETE FROM igs_en_svs_auth_cal
673     WHERE rowid = x_rowid;
674 
675     IF (SQL%NOTFOUND) THEN
676       RAISE NO_DATA_FOUND;
677     END IF;
678 
679       after_dml(
680         p_action => 'DELETE',
681         x_rowid => x_rowid
682       );
683 
684 
685   END delete_row;
686 
687 
688 END igs_en_svs_auth_cal_pkg;