DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGS_DA_RQST_PKG

Source


1 PACKAGE BODY igs_da_rqst_pkg AS
2 /* $Header: IGSKI41B.pls 115.2 2003/04/17 11:22:29 smanglm noship $ */
3 
4   l_rowid VARCHAR2(25);
5   old_references igs_da_rqst%ROWTYPE;
6   new_references igs_da_rqst%ROWTYPE;
7 
8   PROCEDURE set_column_values (
9     p_action                            IN     VARCHAR2,
10     x_rowid                             IN     VARCHAR2,
11     x_batch_id                          IN     NUMBER,
12     x_request_type_id                   IN     NUMBER,
13     x_request_mode                      IN     VARCHAR2,
14     x_program_comparison_type           IN     VARCHAR2,
15     x_request_status                    IN     VARCHAR2,
16     x_person_id_group_id                IN     NUMBER,
17     x_person_id                         IN     NUMBER,
18     x_requestor_id                      IN     NUMBER,
19     x_student_release_ind               IN     VARCHAR2,
20     x_special_program                   IN     VARCHAR2,
21     x_special_program_catalog           IN     VARCHAR2,
22     x_attribute_category                IN     VARCHAR2,
23     x_attribute1                        IN     VARCHAR2,
24     x_attribute2                        IN     VARCHAR2,
25     x_attribute3                        IN     VARCHAR2,
26     x_attribute4                        IN     VARCHAR2,
27     x_attribute5                        IN     VARCHAR2,
28     x_attribute6                        IN     VARCHAR2,
29     x_attribute7                        IN     VARCHAR2,
30     x_attribute8                        IN     VARCHAR2,
31     x_attribute9                        IN     VARCHAR2,
32     x_attribute10                       IN     VARCHAR2,
33     x_attribute11                       IN     VARCHAR2,
34     x_attribute12                       IN     VARCHAR2,
35     x_attribute13                       IN     VARCHAR2,
36     x_attribute14                       IN     VARCHAR2,
37     x_attribute15                       IN     VARCHAR2,
38     x_attribute16                       IN     VARCHAR2,
39     x_attribute17                       IN     VARCHAR2,
40     x_attribute18                       IN     VARCHAR2,
41     x_attribute19                       IN     VARCHAR2,
42     x_attribute20                       IN     VARCHAR2,
43     x_creation_date                     IN     DATE,
44     x_created_by                        IN     NUMBER,
45     x_last_update_date                  IN     DATE,
46     x_last_updated_by                   IN     NUMBER,
47     x_last_update_login                 IN     NUMBER
48   ) AS
49   /*
50   ||  Created By :
51   ||  Created On : 27-MAR-2003
52   ||  Purpose : Initialises the Old and New references for the columns of the table.
53   ||  Known limitations, enhancements or remarks :
54   ||  Change History :
55   ||  Who             When            What
56   ||  (reverse chronological order - newest change first)
57   */
58 
59     CURSOR cur_old_ref_values IS
60       SELECT   *
61       FROM     igs_da_rqst
62       WHERE    rowid = x_rowid;
63 
64   BEGIN
65 
66     l_rowid := x_rowid;
67 
68     -- Code for setting the Old and New Reference Values.
69     -- Populate Old Values.
70     OPEN cur_old_ref_values;
71     FETCH cur_old_ref_values INTO old_references;
72     IF ((cur_old_ref_values%NOTFOUND) AND (p_action NOT IN ('INSERT', 'VALIDATE_INSERT'))) THEN
73       CLOSE cur_old_ref_values;
74       fnd_message.set_name ('FND', 'FORM_RECORD_DELETED');
75       igs_ge_msg_stack.add;
76       app_exception.raise_exception;
77       RETURN;
78     END IF;
79     CLOSE cur_old_ref_values;
80 
81     -- Populate New Values.
82     new_references.batch_id                          := x_batch_id;
83     new_references.request_type_id                   := x_request_type_id;
84     new_references.request_mode                      := x_request_mode;
85     new_references.program_comparison_type           := x_program_comparison_type;
86     new_references.request_status                    := x_request_status;
87     new_references.person_id_group_id                := x_person_id_group_id;
88     new_references.person_id                         := x_person_id;
89     new_references.requestor_id                      := x_requestor_id;
90     new_references.student_release_ind               := x_student_release_ind;
91     new_references.special_program                   := x_special_program;
92     new_references.special_program_catalog           := x_special_program_catalog;
93     new_references.attribute_category                := x_attribute_category;
94     new_references.attribute1                        := x_attribute1;
95     new_references.attribute2                        := x_attribute2;
96     new_references.attribute3                        := x_attribute3;
97     new_references.attribute4                        := x_attribute4;
98     new_references.attribute5                        := x_attribute5;
99     new_references.attribute6                        := x_attribute6;
100     new_references.attribute7                        := x_attribute7;
101     new_references.attribute8                        := x_attribute8;
102     new_references.attribute9                        := x_attribute9;
103     new_references.attribute10                       := x_attribute10;
104     new_references.attribute11                       := x_attribute11;
105     new_references.attribute12                       := x_attribute12;
106     new_references.attribute13                       := x_attribute13;
107     new_references.attribute14                       := x_attribute14;
108     new_references.attribute15                       := x_attribute15;
109     new_references.attribute16                       := x_attribute16;
110     new_references.attribute17                       := x_attribute17;
111     new_references.attribute18                       := x_attribute18;
112     new_references.attribute19                       := x_attribute19;
113     new_references.attribute20                       := x_attribute20;
114 
115     IF (p_action = 'UPDATE') THEN
116       new_references.creation_date                   := old_references.creation_date;
117       new_references.created_by                      := old_references.created_by;
118     ELSE
119       new_references.creation_date                   := x_creation_date;
120       new_references.created_by                      := x_created_by;
121     END IF;
122 
123     new_references.last_update_date                  := x_last_update_date;
124     new_references.last_updated_by                   := x_last_updated_by;
125     new_references.last_update_login                 := x_last_update_login;
126 
127   END set_column_values;
128 
129 
130   PROCEDURE check_parent_existance AS
131   /*
132   ||  Created By :
133   ||  Created On : 27-MAR-2003
134   ||  Purpose : Checks for the existance of Parent records.
135   ||  Known limitations, enhancements or remarks :
136   ||  Change History :
137   ||  Who             When            What
138   ||  (reverse chronological order - newest change first)
139   */
140   BEGIN
141 
142     IF (((old_references.request_type_id = new_references.request_type_id)) OR
143         ((new_references.request_type_id IS NULL))) THEN
144       NULL;
145     ELSIF NOT igs_da_cnfg_req_typ_pkg.get_pk_for_validation (
146                 new_references.request_type_id
147               ) THEN
148       fnd_message.set_name ('FND', 'FORM_RECORD_DELETED');
149       igs_ge_msg_stack.add;
150       app_exception.raise_exception;
151     END IF;
152 
153     IF (((old_references.person_id_group_id = new_references.person_id_group_id)) OR
154         ((new_references.person_id_group_id IS NULL))) THEN
155       NULL;
156     ELSIF NOT igs_pe_persid_group_pkg.get_pk_for_validation (
157                 new_references.person_id_group_id
158               ) THEN
159       fnd_message.set_name ('FND', 'FORM_RECORD_DELETED');
160       igs_ge_msg_stack.add;
161       app_exception.raise_exception;
162     END IF;
163 
164   END check_parent_existance;
165 
166 
167   PROCEDURE check_child_existance AS
168   /*
169   ||  Created By :
170   ||  Created On : 27-MAR-2003
171   ||  Purpose : Checks for the existance of Child records.
172   ||  Known limitations, enhancements or remarks :
173   ||  Change History :
174   ||  Who             When            What
175   ||  (reverse chronological order - newest change first)
176   */
177   BEGIN
178 
179     igs_da_req_wif_pkg.get_fk_igs_da_rqst (
180       old_references.batch_id
181     );
182 
183     igs_da_req_ftrs_pkg.get_fk_igs_da_rqst (
184       old_references.batch_id
185     );
186 
187   END check_child_existance;
188 
189 
190   FUNCTION get_pk_for_validation (
191     x_batch_id                          IN     NUMBER
192   ) RETURN BOOLEAN AS
193   /*
194   ||  Created By :
195   ||  Created On : 27-MAR-2003
196   ||  Purpose : Validates the Primary Key of the table.
197   ||  Known limitations, enhancements or remarks :
198   ||  Change History :
199   ||  Who             When            What
200   ||  (reverse chronological order - newest change first)
201   */
202     CURSOR cur_rowid IS
203       SELECT   rowid
204       FROM     igs_da_rqst
205       WHERE    batch_id = x_batch_id
206       FOR UPDATE NOWAIT;
207 
208     lv_rowid cur_rowid%RowType;
209 
210   BEGIN
211 
212     OPEN cur_rowid;
213     FETCH cur_rowid INTO lv_rowid;
214     IF (cur_rowid%FOUND) THEN
215       CLOSE cur_rowid;
216       RETURN(TRUE);
217     ELSE
218       CLOSE cur_rowid;
219       RETURN(FALSE);
220     END IF;
221 
222   END get_pk_for_validation;
223 
224 
225   PROCEDURE get_fk_igs_da_cnfg_req_typ (
226     x_request_type_id                   IN     NUMBER
227   ) AS
228   /*
229   ||  Created By :
230   ||  Created On : 27-MAR-2003
231   ||  Purpose : Validates the Foreign Keys for the table.
232   ||  Known limitations, enhancements or remarks :
233   ||  Change History :
234   ||  Who             When            What
235   ||  (reverse chronological order - newest change first)
236   */
237     CURSOR cur_rowid IS
238       SELECT   rowid
239       FROM     igs_da_rqst
240       WHERE   ((request_type_id = x_request_type_id));
241 
242     lv_rowid cur_rowid%RowType;
243 
244   BEGIN
245 
246     OPEN cur_rowid;
247     FETCH cur_rowid INTO lv_rowid;
248     IF (cur_rowid%FOUND) THEN
249       CLOSE cur_rowid;
250       fnd_message.set_name ('IGS', 'IGS_DA_CNFG_RQST_FK');
251       igs_ge_msg_stack.add;
252       app_exception.raise_exception;
253       RETURN;
254     END IF;
255     CLOSE cur_rowid;
256 
257   END get_fk_igs_da_cnfg_req_typ;
258 
259 
260   PROCEDURE get_fk_igs_pe_persid_group (
261     x_group_id                          IN     NUMBER
262   ) AS
263   /*
264   ||  Created By :
265   ||  Created On : 27-MAR-2003
266   ||  Purpose : Validates the Foreign Keys for the table.
267   ||  Known limitations, enhancements or remarks :
268   ||  Change History :
269   ||  Who             When            What
270   ||  (reverse chronological order - newest change first)
271   */
272     CURSOR cur_rowid IS
273       SELECT   rowid
274       FROM     igs_da_rqst
275       WHERE   ((person_id_group_id = x_group_id));
276 
277     lv_rowid cur_rowid%RowType;
278 
279   BEGIN
280 
281     OPEN cur_rowid;
282     FETCH cur_rowid INTO lv_rowid;
283     IF (cur_rowid%FOUND) THEN
284       CLOSE cur_rowid;
285       fnd_message.set_name ('IGS', 'IGS_DA_PERSON_RQST_FK');
286       igs_ge_msg_stack.add;
287       app_exception.raise_exception;
288       RETURN;
289     END IF;
290     CLOSE cur_rowid;
291 
292   END get_fk_igs_pe_persid_group;
293 
294 
295   PROCEDURE before_dml (
296     p_action                            IN     VARCHAR2,
297     x_rowid                             IN     VARCHAR2,
298     x_batch_id                          IN     NUMBER,
299     x_request_type_id                   IN     NUMBER,
300     x_request_mode                      IN     VARCHAR2,
301     x_program_comparison_type           IN     VARCHAR2,
302     x_request_status                    IN     VARCHAR2,
303     x_person_id_group_id                IN     NUMBER,
304     x_person_id                         IN     NUMBER,
305     x_requestor_id                      IN     NUMBER,
306     x_student_release_ind               IN     VARCHAR2,
307     x_special_program                   IN     VARCHAR2,
308     x_special_program_catalog           IN     VARCHAR2,
309     x_attribute_category                IN     VARCHAR2,
310     x_attribute1                        IN     VARCHAR2,
311     x_attribute2                        IN     VARCHAR2,
312     x_attribute3                        IN     VARCHAR2,
313     x_attribute4                        IN     VARCHAR2,
314     x_attribute5                        IN     VARCHAR2,
315     x_attribute6                        IN     VARCHAR2,
316     x_attribute7                        IN     VARCHAR2,
317     x_attribute8                        IN     VARCHAR2,
318     x_attribute9                        IN     VARCHAR2,
319     x_attribute10                       IN     VARCHAR2,
320     x_attribute11                       IN     VARCHAR2,
321     x_attribute12                       IN     VARCHAR2,
322     x_attribute13                       IN     VARCHAR2,
323     x_attribute14                       IN     VARCHAR2,
324     x_attribute15                       IN     VARCHAR2,
325     x_attribute16                       IN     VARCHAR2,
326     x_attribute17                       IN     VARCHAR2,
327     x_attribute18                       IN     VARCHAR2,
328     x_attribute19                       IN     VARCHAR2,
329     x_attribute20                       IN     VARCHAR2,
330     x_creation_date                     IN     DATE,
331     x_created_by                        IN     NUMBER,
332     x_last_update_date                  IN     DATE,
333     x_last_updated_by                   IN     NUMBER,
334     x_last_update_login                 IN     NUMBER
335   ) AS
336   /*
337   ||  Created By :
338   ||  Created On : 27-MAR-2003
339   ||  Purpose : Initialises the columns, Checks Constraints, Calls the
340   ||            Trigger Handlers for the table, before any DML operation.
341   ||  Known limitations, enhancements or remarks :
342   ||  Change History :
343   ||  Who             When            What
344   ||  (reverse chronological order - newest change first)
345   */
346   BEGIN
347     set_column_values (
348       p_action,
349       x_rowid,
350       x_batch_id,
351       x_request_type_id,
352       x_request_mode,
353       x_program_comparison_type,
354       x_request_status,
355       x_person_id_group_id,
356       x_person_id,
357       x_requestor_id,
358       x_student_release_ind,
359       x_special_program,
360       x_special_program_catalog,
361       x_attribute_category,
362       x_attribute1,
363       x_attribute2,
364       x_attribute3,
365       x_attribute4,
366       x_attribute5,
367       x_attribute6,
368       x_attribute7,
369       x_attribute8,
370       x_attribute9,
371       x_attribute10,
372       x_attribute11,
373       x_attribute12,
374       x_attribute13,
375       x_attribute14,
376       x_attribute15,
377       x_attribute16,
378       x_attribute17,
379       x_attribute18,
380       x_attribute19,
381       x_attribute20,
382       x_creation_date,
383       x_created_by,
384       x_last_update_date,
385       x_last_updated_by,
386       x_last_update_login
387     );
388     IF (p_action = 'INSERT') THEN
389       -- Call all the procedures related to Before Insert.
390       IF ( get_pk_for_validation(
391              new_references.batch_id
392            )
393          ) THEN
394         fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
395         igs_ge_msg_stack.add;
396         app_exception.raise_exception;
397       END IF;
398       check_parent_existance;
399     ELSIF (p_action = 'UPDATE') THEN
400       -- Call all the procedures related to Before Update.
401       check_parent_existance;
402     ELSIF (p_action = 'DELETE') THEN
403       -- Call all the procedures related to Before Delete.
404       check_child_existance;
405     ELSIF (p_action = 'VALIDATE_INSERT') THEN
406       -- Call all the procedures related to Before Insert.
407       IF ( get_pk_for_validation (
408              new_references.batch_id
409            )
410          ) THEN
411         fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
412         igs_ge_msg_stack.add;
413         app_exception.raise_exception;
414       END IF;
415     ELSIF (p_action = 'VALIDATE_DELETE') THEN
416       check_child_existance;
417     END IF;
418   END before_dml;
419 
420 
421   PROCEDURE insert_row (
422     x_rowid                             IN OUT NOCOPY VARCHAR2,
423     x_batch_id                          IN OUT NOCOPY NUMBER,
424     x_request_type_id                   IN     NUMBER,
425     x_request_mode                      IN     VARCHAR2,
426     x_program_comparison_type           IN     VARCHAR2,
427     x_request_status                    IN     VARCHAR2,
428     x_person_id_group_id                IN     NUMBER,
429     x_person_id                         IN     NUMBER,
430     x_requestor_id                      IN     NUMBER,
431     x_student_release_ind               IN     VARCHAR2,
432     x_special_program                   IN     VARCHAR2,
433     x_special_program_catalog           IN     VARCHAR2,
434     x_attribute_category                IN     VARCHAR2,
435     x_attribute1                        IN     VARCHAR2,
436     x_attribute2                        IN     VARCHAR2,
437     x_attribute3                        IN     VARCHAR2,
438     x_attribute4                        IN     VARCHAR2,
439     x_attribute5                        IN     VARCHAR2,
440     x_attribute6                        IN     VARCHAR2,
441     x_attribute7                        IN     VARCHAR2,
442     x_attribute8                        IN     VARCHAR2,
443     x_attribute9                        IN     VARCHAR2,
444     x_attribute10                       IN     VARCHAR2,
445     x_attribute11                       IN     VARCHAR2,
446     x_attribute12                       IN     VARCHAR2,
447     x_attribute13                       IN     VARCHAR2,
448     x_attribute14                       IN     VARCHAR2,
449     x_attribute15                       IN     VARCHAR2,
450     x_attribute16                       IN     VARCHAR2,
451     x_attribute17                       IN     VARCHAR2,
452     x_attribute18                       IN     VARCHAR2,
453     x_attribute19                       IN     VARCHAR2,
454     x_attribute20                       IN     VARCHAR2,
455     x_mode                              IN     VARCHAR2,
456     X_RETURN_STATUS                     OUT NOCOPY    VARCHAR2,
457     X_MSG_DATA                          OUT NOCOPY    VARCHAR2,
458     X_MSG_COUNT                         OUT NOCOPY    NUMBER
459   ) AS
460   /*
461   ||  Created By :
462   ||  Created On : 27-MAR-2003
463   ||  Purpose : Handles the INSERT DML logic for the table.
464   ||  Known limitations, enhancements or remarks :
465   ||  Change History :
466   ||  Who             When            What
467   ||  (reverse chronological order - newest change first)
468   */
469 
470     x_last_update_date           DATE;
471     x_last_updated_by            NUMBER;
472     x_last_update_login          NUMBER;
473 
474   BEGIN
475     FND_MSG_PUB.initialize;
476     x_last_update_date := SYSDATE;
477     IF (x_mode = 'I') THEN
478       x_last_updated_by := 1;
479       x_last_update_login := 0;
480     ELSIF (x_mode = 'R') THEN
481       x_last_updated_by := fnd_global.user_id;
482       IF (x_last_updated_by IS NULL) THEN
483         x_last_updated_by := -1;
484       END IF;
485       x_last_update_login := fnd_global.login_id;
486       IF (x_last_update_login IS NULL) THEN
487         x_last_update_login := -1;
488       END IF;
489     ELSE
490       fnd_message.set_name ('FND', 'SYSTEM-INVALID ARGS');
491       fnd_message.set_token ('ROUTINE', 'IGS_DA_RQST_PKG.INSERT_ROW');
492       igs_ge_msg_stack.add;
493       app_exception.raise_exception;
494     END IF;
495 --    x_batch_id := NULL;
496 
497     before_dml(
498       p_action                            => 'INSERT',
499       x_rowid                             => x_rowid,
500       x_batch_id                          => x_batch_id,
501       x_request_type_id                   => x_request_type_id,
502       x_request_mode                      => x_request_mode,
503       x_program_comparison_type           => x_program_comparison_type,
504       x_request_status                    => x_request_status,
505       x_person_id_group_id                => x_person_id_group_id,
506       x_person_id                         => x_person_id,
507       x_requestor_id                      => x_requestor_id,
508       x_student_release_ind               => x_student_release_ind,
509       x_special_program                   => x_special_program,
510       x_special_program_catalog           => x_special_program_catalog,
511       x_attribute_category                => x_attribute_category,
512       x_attribute1                        => x_attribute1,
513       x_attribute2                        => x_attribute2,
514       x_attribute3                        => x_attribute3,
515       x_attribute4                        => x_attribute4,
516       x_attribute5                        => x_attribute5,
517       x_attribute6                        => x_attribute6,
518       x_attribute7                        => x_attribute7,
519       x_attribute8                        => x_attribute8,
520       x_attribute9                        => x_attribute9,
521       x_attribute10                       => x_attribute10,
522       x_attribute11                       => x_attribute11,
523       x_attribute12                       => x_attribute12,
524       x_attribute13                       => x_attribute13,
525       x_attribute14                       => x_attribute14,
526       x_attribute15                       => x_attribute15,
527       x_attribute16                       => x_attribute16,
528       x_attribute17                       => x_attribute17,
529       x_attribute18                       => x_attribute18,
530       x_attribute19                       => x_attribute19,
531       x_attribute20                       => x_attribute20,
532       x_creation_date                     => x_last_update_date,
533       x_created_by                        => x_last_updated_by,
534       x_last_update_date                  => x_last_update_date,
535       x_last_updated_by                   => x_last_updated_by,
536       x_last_update_login                 => x_last_update_login
537     );
538     INSERT INTO igs_da_rqst (
539       batch_id,
540       request_type_id,
541       request_mode,
542       program_comparison_type,
543       request_status,
544       person_id_group_id,
545       person_id,
546       requestor_id,
547       student_release_ind,
548       special_program,
549       special_program_catalog,
550       attribute_category,
551       attribute1,
552       attribute2,
553       attribute3,
554       attribute4,
555       attribute5,
556       attribute6,
557       attribute7,
558       attribute8,
559       attribute9,
560       attribute10,
561       attribute11,
562       attribute12,
563       attribute13,
564       attribute14,
565       attribute15,
566       attribute16,
567       attribute17,
568       attribute18,
569       attribute19,
570       attribute20,
571       creation_date,
572       created_by,
573       last_update_date,
574       last_updated_by,
575       last_update_login
576     ) VALUES (
577       new_references.batch_id,
578       new_references.request_type_id,
579       new_references.request_mode,
580       new_references.program_comparison_type,
581       new_references.request_status,
582       new_references.person_id_group_id,
583       new_references.person_id,
584       new_references.requestor_id,
585       new_references.student_release_ind,
586       new_references.special_program,
587       new_references.special_program_catalog,
588       new_references.attribute_category,
589       new_references.attribute1,
590       new_references.attribute2,
591       new_references.attribute3,
592       new_references.attribute4,
593       new_references.attribute5,
594       new_references.attribute6,
595       new_references.attribute7,
596       new_references.attribute8,
597       new_references.attribute9,
598       new_references.attribute10,
599       new_references.attribute11,
600       new_references.attribute12,
601       new_references.attribute13,
602       new_references.attribute14,
603       new_references.attribute15,
604       new_references.attribute16,
605       new_references.attribute17,
606       new_references.attribute18,
607       new_references.attribute19,
608       new_references.attribute20,
609       x_last_update_date,
610       x_last_updated_by,
611       x_last_update_date,
612       x_last_updated_by,
613       x_last_update_login
614     ) RETURNING ROWID, batch_id INTO x_rowid, x_batch_id;
615 
616   -- Initialize API return status to success.
617      X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
618   -- Standard call to get message count and if count is 1, get message
619   -- info.
620      FND_MSG_PUB.Count_And_Get(
621                 p_encoded => FND_API.G_FALSE,
622                 p_count => x_MSG_COUNT,
623                 p_data  => X_MSG_DATA);
624 
625   EXCEPTION
626         WHEN FND_API.G_EXC_ERROR THEN
627             X_RETURN_STATUS := FND_API.G_RET_STS_ERROR;
628             FND_MSG_PUB.Count_And_Get(
629                      p_encoded => FND_API.G_FALSE,
630                      p_count => x_MSG_COUNT,
631                      p_data  => X_MSG_DATA);
632      RETURN;
633         WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
634                     X_RETURN_STATUS := FND_API.G_RET_STS_UNEXP_ERROR;
635                     FND_MSG_PUB.Count_And_Get(
636                         p_encoded => FND_API.G_FALSE,
637                         p_count => x_MSG_COUNT,
638                         p_data  => X_MSG_DATA);
639      RETURN;
640         WHEN OTHERS THEN
641              X_RETURN_STATUS := FND_API.G_RET_STS_UNEXP_ERROR;
642              FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXCEPTION');
643              FND_MESSAGE.SET_TOKEN('NAME','Insert_Row : '||SQLERRM);
644              FND_MSG_PUB.ADD;
645              FND_MSG_PUB.Count_And_Get(
646                                p_encoded => FND_API.G_FALSE,
647                                p_count => x_MSG_COUNT,
648                                p_data  => X_MSG_DATA);
649      RETURN;
650 
651 
652   END insert_row;
653 
654 
655   PROCEDURE lock_row (
656     x_rowid                             IN     VARCHAR2,
657     x_batch_id                          IN     NUMBER,
658     x_request_type_id                   IN     NUMBER,
659     x_request_mode                      IN     VARCHAR2,
660     x_program_comparison_type           IN     VARCHAR2,
661     x_request_status                    IN     VARCHAR2,
662     x_person_id_group_id                IN     NUMBER,
663     x_person_id                         IN     NUMBER,
664     x_requestor_id                      IN     NUMBER,
665     x_student_release_ind               IN     VARCHAR2,
666     x_special_program                   IN     VARCHAR2,
667     x_special_program_catalog           IN     VARCHAR2,
668     x_attribute_category                IN     VARCHAR2,
669     x_attribute1                        IN     VARCHAR2,
670     x_attribute2                        IN     VARCHAR2,
671     x_attribute3                        IN     VARCHAR2,
672     x_attribute4                        IN     VARCHAR2,
673     x_attribute5                        IN     VARCHAR2,
674     x_attribute6                        IN     VARCHAR2,
675     x_attribute7                        IN     VARCHAR2,
676     x_attribute8                        IN     VARCHAR2,
677     x_attribute9                        IN     VARCHAR2,
678     x_attribute10                       IN     VARCHAR2,
679     x_attribute11                       IN     VARCHAR2,
680     x_attribute12                       IN     VARCHAR2,
681     x_attribute13                       IN     VARCHAR2,
682     x_attribute14                       IN     VARCHAR2,
683     x_attribute15                       IN     VARCHAR2,
684     x_attribute16                       IN     VARCHAR2,
685     x_attribute17                       IN     VARCHAR2,
686     x_attribute18                       IN     VARCHAR2,
687     x_attribute19                       IN     VARCHAR2,
688     x_attribute20                       IN     VARCHAR2,
689     X_RETURN_STATUS                     OUT NOCOPY    VARCHAR2,
690     X_MSG_DATA                          OUT NOCOPY    VARCHAR2,
691     X_MSG_COUNT                         OUT NOCOPY    NUMBER
692   ) AS
693   /*
694   ||  Created By :
695   ||  Created On : 27-MAR-2003
696   ||  Purpose : Handles the LOCK mechanism for the table.
697   ||  Known limitations, enhancements or remarks :
698   ||  Change History :
699   ||  Who             When            What
700   ||  (reverse chronological order - newest change first)
701   */
702     CURSOR c1 IS
703       SELECT
704         request_type_id,
705         request_mode,
706         program_comparison_type,
707         request_status,
708         person_id_group_id,
709         person_id,
710         requestor_id,
711         student_release_ind,
712         special_program,
713         special_program_catalog,
714         attribute_category,
715         attribute1,
716         attribute2,
717         attribute3,
718         attribute4,
719         attribute5,
720         attribute6,
721         attribute7,
722         attribute8,
723         attribute9,
724         attribute10,
725         attribute11,
726         attribute12,
727         attribute13,
728         attribute14,
729         attribute15,
730         attribute16,
731         attribute17,
732         attribute18,
733         attribute19,
734         attribute20
735       FROM  igs_da_rqst
736       WHERE rowid = x_rowid
737       FOR UPDATE NOWAIT;
738 
739     tlinfo c1%ROWTYPE;
740 
741   BEGIN
742     FND_MSG_PUB.initialize;
743     OPEN c1;
744     FETCH c1 INTO tlinfo;
745     IF (c1%notfound) THEN
746       fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
747       igs_ge_msg_stack.add;
748       CLOSE c1;
749       app_exception.raise_exception;
750       RETURN;
751     END IF;
752     CLOSE c1;
753 
754     IF (
755         (tlinfo.request_type_id = x_request_type_id)
756         AND (tlinfo.request_mode = x_request_mode)
757         AND (tlinfo.program_comparison_type = x_program_comparison_type)
758         AND (tlinfo.request_status = x_request_status)
759         AND ((tlinfo.person_id_group_id = x_person_id_group_id) OR ((tlinfo.person_id_group_id IS NULL) AND (X_person_id_group_id IS NULL)))
760         AND ((tlinfo.person_id = x_person_id) OR ((tlinfo.person_id IS NULL) AND (X_person_id IS NULL)))
761         AND (tlinfo.requestor_id = x_requestor_id)
762         AND (tlinfo.student_release_ind = x_student_release_ind)
763         AND ((tlinfo.special_program = x_special_program) OR ((tlinfo.special_program IS NULL) AND (X_special_program IS NULL)))
764         AND ((tlinfo.special_program_catalog = x_special_program_catalog) OR ((tlinfo.special_program_catalog IS NULL) AND (X_special_program_catalog IS NULL)))
765         AND ((tlinfo.attribute_category = x_attribute_category) OR ((tlinfo.attribute_category IS NULL) AND (X_attribute_category IS NULL)))
766         AND ((tlinfo.attribute1 = x_attribute1) OR ((tlinfo.attribute1 IS NULL) AND (X_attribute1 IS NULL)))
767         AND ((tlinfo.attribute2 = x_attribute2) OR ((tlinfo.attribute2 IS NULL) AND (X_attribute2 IS NULL)))
768         AND ((tlinfo.attribute3 = x_attribute3) OR ((tlinfo.attribute3 IS NULL) AND (X_attribute3 IS NULL)))
769         AND ((tlinfo.attribute4 = x_attribute4) OR ((tlinfo.attribute4 IS NULL) AND (X_attribute4 IS NULL)))
770         AND ((tlinfo.attribute5 = x_attribute5) OR ((tlinfo.attribute5 IS NULL) AND (X_attribute5 IS NULL)))
771         AND ((tlinfo.attribute6 = x_attribute6) OR ((tlinfo.attribute6 IS NULL) AND (X_attribute6 IS NULL)))
772         AND ((tlinfo.attribute7 = x_attribute7) OR ((tlinfo.attribute7 IS NULL) AND (X_attribute7 IS NULL)))
773         AND ((tlinfo.attribute8 = x_attribute8) OR ((tlinfo.attribute8 IS NULL) AND (X_attribute8 IS NULL)))
774         AND ((tlinfo.attribute9 = x_attribute9) OR ((tlinfo.attribute9 IS NULL) AND (X_attribute9 IS NULL)))
775         AND ((tlinfo.attribute10 = x_attribute10) OR ((tlinfo.attribute10 IS NULL) AND (X_attribute10 IS NULL)))
776         AND ((tlinfo.attribute11 = x_attribute11) OR ((tlinfo.attribute11 IS NULL) AND (X_attribute11 IS NULL)))
777         AND ((tlinfo.attribute12 = x_attribute12) OR ((tlinfo.attribute12 IS NULL) AND (X_attribute12 IS NULL)))
778         AND ((tlinfo.attribute13 = x_attribute13) OR ((tlinfo.attribute13 IS NULL) AND (X_attribute13 IS NULL)))
779         AND ((tlinfo.attribute14 = x_attribute14) OR ((tlinfo.attribute14 IS NULL) AND (X_attribute14 IS NULL)))
780         AND ((tlinfo.attribute15 = x_attribute15) OR ((tlinfo.attribute15 IS NULL) AND (X_attribute15 IS NULL)))
781         AND ((tlinfo.attribute16 = x_attribute16) OR ((tlinfo.attribute16 IS NULL) AND (X_attribute16 IS NULL)))
782         AND ((tlinfo.attribute17 = x_attribute17) OR ((tlinfo.attribute17 IS NULL) AND (X_attribute17 IS NULL)))
783         AND ((tlinfo.attribute18 = x_attribute18) OR ((tlinfo.attribute18 IS NULL) AND (X_attribute18 IS NULL)))
784         AND ((tlinfo.attribute19 = x_attribute19) OR ((tlinfo.attribute19 IS NULL) AND (X_attribute19 IS NULL)))
785         AND ((tlinfo.attribute20 = x_attribute20) OR ((tlinfo.attribute20 IS NULL) AND (X_attribute20 IS NULL)))
786        ) THEN
787       NULL;
788     ELSE
789       fnd_message.set_name('FND', 'FORM_RECORD_CHANGED');
790       igs_ge_msg_stack.add;
791       RAISE FND_API.G_EXC_ERROR;
792     END IF;
793 
794   -- Initialize API return status to success.
795      X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
796   -- Standard call to get message count and if count is 1, get message
797   -- info.
798 	FND_MSG_PUB.Count_And_Get(
799 		p_encoded => FND_API.G_FALSE,
800 		p_count => x_MSG_COUNT,
801 		p_data  => X_MSG_DATA);
802      RETURN;
803  EXCEPTION
804   WHEN FND_API.G_EXC_ERROR THEN
805 	X_RETURN_STATUS := FND_API.G_RET_STS_ERROR;
806 	FND_MSG_PUB.Count_And_Get(
807 		 p_encoded => FND_API.G_FALSE,
808 		 p_count => x_MSG_COUNT,
809 		 p_data  => X_MSG_DATA);
810  RETURN;
811     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
812 		X_RETURN_STATUS := FND_API.G_RET_STS_UNEXP_ERROR;
813 		FND_MSG_PUB.Count_And_Get(
814 		    p_encoded => FND_API.G_FALSE,
815 		    p_count => x_MSG_COUNT,
816 		    p_data  => X_MSG_DATA);
817  RETURN;
818   WHEN OTHERS THEN
819 	 X_RETURN_STATUS := FND_API.G_RET_STS_UNEXP_ERROR;
820 	 FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXCEPTION');
821 	 FND_MESSAGE.SET_TOKEN('NAME','Insert_Row : '||SQLERRM);
822 	 FND_MSG_PUB.ADD;
823 	 FND_MSG_PUB.Count_And_Get(
824 			   p_encoded => FND_API.G_FALSE,
825 			   p_count => x_MSG_COUNT,
826 			   p_data  => X_MSG_DATA);
827  RETURN;
828 
829   END lock_row;
830 
831 
832   PROCEDURE update_row (
833     x_rowid                             IN     VARCHAR2,
834     x_batch_id                          IN     NUMBER,
835     x_request_type_id                   IN     NUMBER,
836     x_request_mode                      IN     VARCHAR2,
837     x_program_comparison_type           IN     VARCHAR2,
838     x_request_status                    IN     VARCHAR2,
839     x_person_id_group_id                IN     NUMBER,
840     x_person_id                         IN     NUMBER,
841     x_requestor_id                      IN     NUMBER,
842     x_student_release_ind               IN     VARCHAR2,
843     x_special_program                   IN     VARCHAR2,
844     x_special_program_catalog           IN     VARCHAR2,
845     x_attribute_category                IN     VARCHAR2,
846     x_attribute1                        IN     VARCHAR2,
847     x_attribute2                        IN     VARCHAR2,
848     x_attribute3                        IN     VARCHAR2,
849     x_attribute4                        IN     VARCHAR2,
850     x_attribute5                        IN     VARCHAR2,
851     x_attribute6                        IN     VARCHAR2,
852     x_attribute7                        IN     VARCHAR2,
853     x_attribute8                        IN     VARCHAR2,
854     x_attribute9                        IN     VARCHAR2,
855     x_attribute10                       IN     VARCHAR2,
856     x_attribute11                       IN     VARCHAR2,
857     x_attribute12                       IN     VARCHAR2,
858     x_attribute13                       IN     VARCHAR2,
859     x_attribute14                       IN     VARCHAR2,
860     x_attribute15                       IN     VARCHAR2,
861     x_attribute16                       IN     VARCHAR2,
862     x_attribute17                       IN     VARCHAR2,
863     x_attribute18                       IN     VARCHAR2,
864     x_attribute19                       IN     VARCHAR2,
865     x_attribute20                       IN     VARCHAR2,
866     x_mode                              IN     VARCHAR2,
867     X_RETURN_STATUS                     OUT NOCOPY    VARCHAR2,
868     X_MSG_DATA                          OUT NOCOPY    VARCHAR2,
869     X_MSG_COUNT                         OUT NOCOPY    NUMBER
870   ) AS
871   /*
872   ||  Created By :
873   ||  Created On : 27-MAR-2003
874   ||  Purpose : Handles the UPDATE DML logic for the table.
875   ||  Known limitations, enhancements or remarks :
876   ||  Change History :
877   ||  Who             When            What
878   ||  (reverse chronological order - newest change first)
879   */
880     x_last_update_date           DATE ;
881     x_last_updated_by            NUMBER;
882     x_last_update_login          NUMBER;
883 
884   BEGIN
885     FND_MSG_PUB.initialize;
886     x_last_update_date := SYSDATE;
887     IF (X_MODE = 'I') THEN
888       x_last_updated_by := 1;
889       x_last_update_login := 0;
890     ELSIF (x_mode = 'R') THEN
891       x_last_updated_by := fnd_global.user_id;
892       IF x_last_updated_by IS NULL THEN
893         x_last_updated_by := -1;
894       END IF;
895       x_last_update_login := fnd_global.login_id;
896       IF (x_last_update_login IS NULL) THEN
897         x_last_update_login := -1;
898       END IF;
899     ELSE
900       fnd_message.set_name( 'FND', 'SYSTEM-INVALID ARGS');
901       fnd_message.set_token ('ROUTINE', 'IGS_DA_RQST_PKG.UPDATE_ROW');
902       igs_ge_msg_stack.add;
903       app_exception.raise_exception;
904     END IF;
905 
906 --    x_batch_id := NULL;
907 
908     before_dml(
909       p_action                            => 'UPDATE',
910       x_rowid                             => x_rowid,
911       x_batch_id                          => x_batch_id,
912       x_request_type_id                   => x_request_type_id,
913       x_request_mode                      => x_request_mode,
914       x_program_comparison_type           => x_program_comparison_type,
915       x_request_status                    => x_request_status,
916       x_person_id_group_id                => x_person_id_group_id,
917       x_person_id                         => x_person_id,
918       x_requestor_id                      => x_requestor_id,
919       x_student_release_ind               => x_student_release_ind,
920       x_special_program                   => x_special_program,
921       x_special_program_catalog           => x_special_program_catalog,
922       x_attribute_category                => x_attribute_category,
923       x_attribute1                        => x_attribute1,
924       x_attribute2                        => x_attribute2,
925       x_attribute3                        => x_attribute3,
926       x_attribute4                        => x_attribute4,
927       x_attribute5                        => x_attribute5,
928       x_attribute6                        => x_attribute6,
929       x_attribute7                        => x_attribute7,
930       x_attribute8                        => x_attribute8,
931       x_attribute9                        => x_attribute9,
932       x_attribute10                       => x_attribute10,
933       x_attribute11                       => x_attribute11,
934       x_attribute12                       => x_attribute12,
935       x_attribute13                       => x_attribute13,
936       x_attribute14                       => x_attribute14,
937       x_attribute15                       => x_attribute15,
938       x_attribute16                       => x_attribute16,
939       x_attribute17                       => x_attribute17,
940       x_attribute18                       => x_attribute18,
941       x_attribute19                       => x_attribute19,
942       x_attribute20                       => x_attribute20,
943       x_creation_date                     => x_last_update_date,
944       x_created_by                        => x_last_updated_by,
945       x_last_update_date                  => x_last_update_date,
946       x_last_updated_by                   => x_last_updated_by,
947       x_last_update_login                 => x_last_update_login
948     );
949 
950     UPDATE igs_da_rqst
951       SET
952         request_type_id                   = new_references.request_type_id,
953         request_mode                      = new_references.request_mode,
954         program_comparison_type           = new_references.program_comparison_type,
955         request_status                    = new_references.request_status,
956         person_id_group_id                = new_references.person_id_group_id,
957         person_id                         = new_references.person_id,
958         requestor_id                      = new_references.requestor_id,
959         student_release_ind               = new_references.student_release_ind,
960         special_program                   = new_references.special_program,
961         special_program_catalog           = new_references.special_program_catalog,
962         attribute_category                = new_references.attribute_category,
963         attribute1                        = new_references.attribute1,
964         attribute2                        = new_references.attribute2,
965         attribute3                        = new_references.attribute3,
966         attribute4                        = new_references.attribute4,
967         attribute5                        = new_references.attribute5,
968         attribute6                        = new_references.attribute6,
969         attribute7                        = new_references.attribute7,
970         attribute8                        = new_references.attribute8,
971         attribute9                        = new_references.attribute9,
972         attribute10                       = new_references.attribute10,
973         attribute11                       = new_references.attribute11,
974         attribute12                       = new_references.attribute12,
975         attribute13                       = new_references.attribute13,
976         attribute14                       = new_references.attribute14,
977         attribute15                       = new_references.attribute15,
978         attribute16                       = new_references.attribute16,
979         attribute17                       = new_references.attribute17,
980         attribute18                       = new_references.attribute18,
981         attribute19                       = new_references.attribute19,
982         attribute20                       = new_references.attribute20,
983         last_update_date                  = x_last_update_date,
984         last_updated_by                   = x_last_updated_by,
985         last_update_login                 = x_last_update_login
986       WHERE rowid = x_rowid;
987 
988     IF (SQL%NOTFOUND) THEN
989       RAISE NO_DATA_FOUND;
990     END IF;
991 
992   -- Initialize API return status to success.
993         X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
994   -- Standard call to get message count and if count is 1, get message
995   -- info.
996         FND_MSG_PUB.Count_And_Get(
997                 p_encoded => FND_API.G_FALSE,
998                 p_count => x_MSG_COUNT,
999                 p_data  => X_MSG_DATA);
1000 
1001   EXCEPTION
1002     WHEN FND_API.G_EXC_ERROR THEN
1003           X_RETURN_STATUS := FND_API.G_RET_STS_ERROR;
1004           FND_MSG_PUB.Count_And_Get(
1005                    p_encoded => FND_API.G_FALSE,
1006                    p_count => x_MSG_COUNT,
1007                    p_data  => X_MSG_DATA);
1008    RETURN;
1009       WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1010                   X_RETURN_STATUS := FND_API.G_RET_STS_UNEXP_ERROR;
1011                   FND_MSG_PUB.Count_And_Get(
1012                       p_encoded => FND_API.G_FALSE,
1013                       p_count => x_MSG_COUNT,
1014                       p_data  => X_MSG_DATA);
1015    RETURN;
1016     WHEN OTHERS THEN
1017            X_RETURN_STATUS := FND_API.G_RET_STS_UNEXP_ERROR;
1018            FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXCEPTION');
1019            FND_MESSAGE.SET_TOKEN('NAME','Update_Row : '||SQLERRM);
1020            FND_MSG_PUB.ADD;
1021            FND_MSG_PUB.Count_And_Get(
1022                              p_encoded => FND_API.G_FALSE,
1023                              p_count => x_MSG_COUNT,
1024                              p_data  => X_MSG_DATA);
1025    RETURN;
1026 
1027   END update_row;
1028 
1029 
1030   PROCEDURE add_row (
1031     x_rowid                             IN OUT NOCOPY VARCHAR2,
1032     x_batch_id                          IN OUT NOCOPY NUMBER,
1033     x_request_type_id                   IN     NUMBER,
1034     x_request_mode                      IN     VARCHAR2,
1035     x_program_comparison_type           IN     VARCHAR2,
1036     x_request_status                    IN     VARCHAR2,
1037     x_person_id_group_id                IN     NUMBER,
1038     x_person_id                         IN     NUMBER,
1039     x_requestor_id                      IN     NUMBER,
1040     x_student_release_ind               IN     VARCHAR2,
1041     x_special_program                   IN     VARCHAR2,
1042     x_special_program_catalog           IN     VARCHAR2,
1043     x_attribute_category                IN     VARCHAR2,
1044     x_attribute1                        IN     VARCHAR2,
1045     x_attribute2                        IN     VARCHAR2,
1046     x_attribute3                        IN     VARCHAR2,
1047     x_attribute4                        IN     VARCHAR2,
1048     x_attribute5                        IN     VARCHAR2,
1049     x_attribute6                        IN     VARCHAR2,
1050     x_attribute7                        IN     VARCHAR2,
1051     x_attribute8                        IN     VARCHAR2,
1052     x_attribute9                        IN     VARCHAR2,
1053     x_attribute10                       IN     VARCHAR2,
1054     x_attribute11                       IN     VARCHAR2,
1055     x_attribute12                       IN     VARCHAR2,
1056     x_attribute13                       IN     VARCHAR2,
1057     x_attribute14                       IN     VARCHAR2,
1058     x_attribute15                       IN     VARCHAR2,
1059     x_attribute16                       IN     VARCHAR2,
1060     x_attribute17                       IN     VARCHAR2,
1061     x_attribute18                       IN     VARCHAR2,
1062     x_attribute19                       IN     VARCHAR2,
1063     x_attribute20                       IN     VARCHAR2,
1064     x_mode                              IN     VARCHAR2
1065   ) AS
1066   /*
1067   ||  Created By :
1068   ||  Created On : 27-MAR-2003
1069   ||  Purpose : Adds a row if there is no existing row, otherwise updates existing row in the table.
1070   ||  Known limitations, enhancements or remarks :
1071   ||  Change History :
1072   ||  Who             When            What
1073   ||  (reverse chronological order - newest change first)
1074   */
1075     CURSOR c1 IS
1076       SELECT   rowid
1077       FROM     igs_da_rqst
1078       WHERE    batch_id                          = x_batch_id;
1079     L_RETURN_STATUS                VARCHAR2(10);
1080     L_MSG_DATA                     VARCHAR2(2000);
1081     L_MSG_COUNT                    NUMBER(10);
1082   BEGIN
1083 
1084     OPEN c1;
1085     FETCH c1 INTO x_rowid;
1086     IF (c1%NOTFOUND) THEN
1087       CLOSE c1;
1088 
1089       insert_row (
1090         x_rowid,
1091         x_batch_id,
1092         x_request_type_id,
1093         x_request_mode,
1094         x_program_comparison_type,
1095         x_request_status,
1096         x_person_id_group_id,
1097         x_person_id,
1098         x_requestor_id,
1099         x_student_release_ind,
1100         x_special_program,
1101         x_special_program_catalog,
1102         x_attribute_category,
1103         x_attribute1,
1104         x_attribute2,
1105         x_attribute3,
1106         x_attribute4,
1107         x_attribute5,
1108         x_attribute6,
1109         x_attribute7,
1110         x_attribute8,
1111         x_attribute9,
1112         x_attribute10,
1113         x_attribute11,
1114         x_attribute12,
1115         x_attribute13,
1116         x_attribute14,
1117         x_attribute15,
1118         x_attribute16,
1119         x_attribute17,
1120         x_attribute18,
1121         x_attribute19,
1122         x_attribute20,
1123         x_mode ,
1124         L_RETURN_STATUS,
1125 	L_MSG_DATA     ,
1126 	L_MSG_COUNT
1127       );
1128       RETURN;
1129     END IF;
1130     CLOSE c1;
1131 
1132     update_row (
1133       x_rowid,
1134       x_batch_id,
1135       x_request_type_id,
1136       x_request_mode,
1137       x_program_comparison_type,
1138       x_request_status,
1139       x_person_id_group_id,
1140       x_person_id,
1141       x_requestor_id,
1142       x_student_release_ind,
1143       x_special_program,
1144       x_special_program_catalog,
1145       x_attribute_category,
1146       x_attribute1,
1147       x_attribute2,
1148       x_attribute3,
1149       x_attribute4,
1150       x_attribute5,
1151       x_attribute6,
1152       x_attribute7,
1153       x_attribute8,
1154       x_attribute9,
1155       x_attribute10,
1156       x_attribute11,
1157       x_attribute12,
1158       x_attribute13,
1159       x_attribute14,
1160       x_attribute15,
1161       x_attribute16,
1162       x_attribute17,
1163       x_attribute18,
1164       x_attribute19,
1165       x_attribute20,
1166       x_mode,
1167       L_RETURN_STATUS,
1168       L_MSG_DATA     ,
1169       L_MSG_COUNT
1170     );
1171 
1172   END add_row;
1173 
1174 
1175   PROCEDURE delete_row (
1176     x_rowid IN VARCHAR2 ,
1177     X_RETURN_STATUS                     OUT NOCOPY    VARCHAR2,
1178     X_MSG_DATA                          OUT NOCOPY    VARCHAR2,
1179     X_MSG_COUNT                         OUT NOCOPY    NUMBER
1180   ) AS
1181   /*
1182   ||  Created By :
1183   ||  Created On : 27-MAR-2003
1184   ||  Purpose : Handles the DELETE DML logic for the table.
1185   ||  Known limitations, enhancements or remarks :
1186   ||  Change History :
1187   ||  Who             When            What
1188   ||  (reverse chronological order - newest change first)
1189   */
1190   BEGIN
1191     FND_MSG_PUB.initialize;
1192     before_dml (
1193       p_action => 'DELETE',
1194       x_rowid => x_rowid
1195     );
1196 
1197     DELETE FROM igs_da_rqst
1198     WHERE rowid = x_rowid;
1199 
1200     IF (SQL%NOTFOUND) THEN
1201       RAISE NO_DATA_FOUND;
1202     END IF;
1203 
1204  -- Initialize API return status to success.
1205         X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
1206   -- Standard call to get message count and if count is 1, get message
1207   -- info.
1208         FND_MSG_PUB.Count_And_Get(
1209                 p_encoded => FND_API.G_FALSE,
1210                 p_count => x_MSG_COUNT,
1211                 p_data  => X_MSG_DATA);
1212 
1213   EXCEPTION
1214     WHEN FND_API.G_EXC_ERROR THEN
1215           X_RETURN_STATUS := FND_API.G_RET_STS_ERROR;
1216           FND_MSG_PUB.Count_And_Get(
1217                    p_encoded => FND_API.G_FALSE,
1218                    p_count => x_MSG_COUNT,
1219                    p_data  => X_MSG_DATA);
1220    RETURN;
1221       WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1222                   X_RETURN_STATUS := FND_API.G_RET_STS_UNEXP_ERROR;
1223                   FND_MSG_PUB.Count_And_Get(
1224                       p_encoded => FND_API.G_FALSE,
1225                       p_count => x_MSG_COUNT,
1226                       p_data  => X_MSG_DATA);
1227    RETURN;
1228     WHEN OTHERS THEN
1229            X_RETURN_STATUS := FND_API.G_RET_STS_UNEXP_ERROR;
1230            FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXCEPTION');
1231            FND_MESSAGE.SET_TOKEN('NAME','Insert_Row : '||SQLERRM);
1232            FND_MSG_PUB.ADD;
1233            FND_MSG_PUB.Count_And_Get(
1234                              p_encoded => FND_API.G_FALSE,
1235                              p_count => x_MSG_COUNT,
1236                              p_data  => X_MSG_DATA);
1237    RETURN;
1238 
1239   END delete_row;
1240 
1241 
1242 END igs_da_rqst_pkg;