DBA Data[Home] [Help]

PACKAGE BODY: APPS.JG_ZZ_ENTITY_ASSOC_PKG

Source


1 PACKAGE BODY JG_ZZ_ENTITY_ASSOC_PKG AS
2 /* $Header: jgzzieab.pls 115.6 2002/11/21 18:00:18 thwon ship $  */
3 
4 PROCEDURE insert_row( x_rowid IN OUT NOCOPY VARCHAR2,
5                       x_entity_association_id NUMBER,
6                       x_primary_id_number VARCHAR2,
7                       x_associated_entity_id NUMBER,
8                       x_id_type VARCHAR2,
9                       x_id_number VARCHAR2,
10                       x_description VARCHAR2,
11                       x_effective_date DATE,
12                       x_ineffective_date DATE,
13                       x_attribute_category VARCHAR2,
14                       x_attribute1 VARCHAR2,
15                       x_attribute2 VARCHAR2,
16                       x_attribute3 VARCHAR2,
17                       x_attribute4 VARCHAR2,
18                       x_attribute5 VARCHAR2,
19                       x_attribute6 VARCHAR2,
20                       x_attribute7 VARCHAR2,
21                       x_attribute8 VARCHAR2,
22                       x_attribute9 VARCHAR2,
23                       x_attribute10 VARCHAR2,
24                       x_attribute11 VARCHAR2,
25                       x_attribute12 VARCHAR2,
26                       x_attribute13 VARCHAR2,
27                       x_attribute14 VARCHAR2,
28                       x_attribute15 VARCHAR2,
29                       x_attribute16 VARCHAR2,
30                       x_attribute17 VARCHAR2,
31                       x_attribute18 VARCHAR2,
32                       x_attribute19 VARCHAR2,
33                       x_attribute20 VARCHAR2,
34                       x_created_by NUMBER,
35                       x_creation_date DATE,
36                       x_last_updated_by NUMBER,
37                       x_last_update_date DATE,
38                       x_last_update_login NUMBER ) IS
39 
40   CURSOR C IS SELECT rowid
41               FROM jg_zz_entity_assoc
42               WHERE entity_association_id = x_entity_association_id;
43 BEGIN
44 
45   INSERT INTO jg_zz_entity_assoc( entity_association_id,
46                                   primary_id_number,
47                                   associated_entity_id,
48                                   id_type,
49                                   id_number,
50                                   description,
51                                   effective_date,
52                                   ineffective_date,
53                                   attribute_category,
54                                   attribute1,
55                                   attribute2,
56                                   attribute3,
57                                   attribute4,
58                                   attribute5,
59                                   attribute6,
60                                   attribute7,
61                                   attribute8,
62                                   attribute9,
63                                   attribute10,
64                                   attribute11,
65                                   attribute12,
66                                   attribute13,
67                                   attribute14,
68                                   attribute15,
69                                   attribute16,
70                                   attribute17,
71                                   attribute18,
72                                   attribute19,
73                                   attribute20,
74                                   created_by,
75                                   creation_date,
76                                   last_updated_by,
77                                   last_update_date,
78                                   last_update_login
79                                   ) VALUES (
80                                   x_entity_association_id,
81                                   x_primary_id_number,
82                                   x_associated_entity_id,
83                                   x_id_type,
84                                   x_id_number,
85                                   x_description,
86                                   x_effective_date,
87                                   x_ineffective_date,
88                                   x_attribute_category,
89                                   x_attribute1,
90                                   x_attribute2,
91                                   x_attribute3,
92                                   x_attribute4,
93                                   x_attribute5,
94                                   x_attribute6,
95                                   x_attribute7,
96                                   x_attribute8,
97                                   x_attribute9,
98                                   x_attribute10,
99                                   x_attribute11,
100                                   x_attribute12,
101                                   x_attribute13,
102                                   x_attribute14,
103                                   x_attribute15,
104                                   x_attribute16,
105                                   x_attribute17,
106                                   x_attribute18,
107                                   x_attribute19,
108                                   x_attribute20,
109                                   x_created_by,
110                                   x_creation_date,
111                                   x_last_updated_by,
112                                   x_last_update_date,
113                                   x_last_update_login );
114 
115   OPEN C;
116   FETCH C INTO x_rowid;
117 
118   IF ( C%NOTFOUND ) THEN
119 
120     CLOSE C;
121     RAISE NO_DATA_FOUND;
122 
123   END IF;
124 
125   CLOSE C;
126 
127 END insert_row;
128 
129 
130 PROCEDURE lock_row( x_rowid VARCHAR2,
131                     x_entity_association_id NUMBER,
132                     x_primary_id_number VARCHAR2,
133                     x_associated_entity_id NUMBER,
134                     x_id_type VARCHAR2,
135                     x_id_number VARCHAR2,
136                     x_description VARCHAR2,
137                     x_effective_date DATE,
138                     x_ineffective_date DATE,
139                     x_attribute_category VARCHAR2,
140                     x_attribute1 VARCHAR2,
141                     x_attribute2 VARCHAR2,
142                     x_attribute3 VARCHAR2,
143                     x_attribute4 VARCHAR2,
144                     x_attribute5 VARCHAR2,
145                     x_attribute6 VARCHAR2,
146                     x_attribute7 VARCHAR2,
147                     x_attribute8 VARCHAR2,
148                     x_attribute9 VARCHAR2,
149                     x_attribute10 VARCHAR2,
150                     x_attribute11 VARCHAR2,
151                     x_attribute12 VARCHAR2,
152                     x_attribute13 VARCHAR2,
153                     x_attribute14 VARCHAR2,
154                     x_attribute15 VARCHAR2,
155                     x_attribute16 VARCHAR2,
156                     x_attribute17 VARCHAR2,
157                     x_attribute18 VARCHAR2,
158                     x_attribute19 VARCHAR2,
159                     x_attribute20 VARCHAR2,
160                     x_created_by NUMBER,
161                     x_creation_date DATE,
162                     x_last_updated_by NUMBER,
163                     x_last_update_date DATE,
164                     x_last_update_login NUMBER ) IS
165 
166   CURSOR C IS SELECT *
167               FROM jg_zz_entity_assoc
168               WHERE rowid = x_rowid
169               FOR UPDATE OF entity_association_id NOWAIT;
170 
171   recinfo C%ROWTYPE;
172 
173 BEGIN
174 
175   OPEN C;
176   FETCH C INTO recinfo;
177 
178   IF ( C%NOTFOUND ) THEN
179 
180     CLOSE C;
181     fnd_message.set_name( 'FND', 'FORM_RECORD_DELETED' );
182     app_exception.raise_exception;
183 
184   END IF;
185 
186   CLOSE C;
187 
188   IF(     ( recinfo.entity_association_id = x_entity_association_id )
189       AND ( recinfo.primary_id_number = x_primary_id_number )
190       AND ( recinfo.associated_entity_id = x_associated_entity_id )
191       AND ( recinfo.id_type = x_id_type )
192       AND ( recinfo.id_number = x_id_number )
193       AND (   ( recinfo.description = x_description )
194            OR (    (recinfo.description IS NULL)
195                AND (x_description IS NULL)))
196       AND ( recinfo.effective_date = x_effective_date )
197       AND (   ( recinfo.ineffective_date = x_ineffective_date )
198            OR (    (recinfo.ineffective_date IS NULL)
199                AND (x_ineffective_date IS NULL)))
200       AND (   (recinfo.attribute_category = x_attribute_category)
201            OR (    (recinfo.attribute_category IS NULL)
202                AND (x_attribute_category IS NULL)))
203       AND (   (recinfo.attribute1 = x_attribute1)
204            OR (    (recinfo.attribute1 IS NULL)
205                AND (x_attribute1 IS NULL)))
206       AND (   (recinfo.attribute2 = x_attribute2)
207            OR (    (recinfo.attribute2 IS NULL)
208                AND (x_attribute2 IS NULL)))
209       AND (   (recinfo.attribute3 = x_attribute3)
210            OR (    (recinfo.attribute3 IS NULL)
211                AND (x_attribute3 IS NULL)))
212       AND (   (recinfo.attribute4 = x_attribute4)
213            OR (    (recinfo.attribute4 IS NULL)
214                AND (x_attribute4 IS NULL)))
215       AND (   (recinfo.attribute5 = x_attribute5)
216            OR (    (recinfo.attribute5 IS NULL)
217                AND (x_attribute5 IS NULL)))
218       AND (   (recinfo.attribute6 = x_attribute6)
219            OR (    (recinfo.attribute6 IS NULL)
220                AND (x_attribute6 IS NULL)))
221       AND (   (recinfo.attribute7 = x_attribute7)
222            OR (    (recinfo.attribute7 IS NULL)
223                AND (x_attribute7 IS NULL)))
224       AND (   (recinfo.attribute8 = x_attribute8)
225            OR (    (recinfo.attribute8 IS NULL)
226                AND (x_attribute8 IS NULL)))
227       AND (   (recinfo.attribute9 = x_attribute9)
228            OR (    (recinfo.attribute9 IS NULL)
229                AND (x_attribute9 IS NULL)))
230       AND (   (recinfo.attribute10 = x_attribute10)
231            OR (    (recinfo.attribute10 IS NULL)
232                AND (x_attribute10 IS NULL)))
233       AND (   (recinfo.attribute11 = x_attribute11)
234            OR (    (recinfo.attribute11 IS NULL)
235                AND (x_attribute11 IS NULL)))
236       AND (   (recinfo.attribute12 = x_attribute12)
237            OR (    (recinfo.attribute12 IS NULL)
238                AND (x_attribute12 IS NULL)))
239       AND (   (recinfo.attribute13 = x_attribute13)
240            OR (    (recinfo.attribute13 IS NULL)
241                AND (x_attribute13 IS NULL)))
242       AND (   (recinfo.attribute14 = x_attribute14)
243            OR (    (recinfo.attribute14 IS NULL)
244                AND (x_attribute14 IS NULL)))
245       AND (   (recinfo.attribute15 = x_attribute15)
246            OR (    (recinfo.attribute15 IS NULL)
247                AND (x_attribute15 IS NULL)))
248       AND (   (recinfo.attribute16 = x_attribute16)
249            OR (    (recinfo.attribute16 IS NULL)
250                AND (x_attribute16 IS NULL)))
251       AND (   (recinfo.attribute17 = x_attribute17)
252            OR (    (recinfo.attribute17 IS NULL)
253                AND (x_attribute17 IS NULL)))
254       AND (   (recinfo.attribute18 = x_attribute18)
255            OR (    (recinfo.attribute18 IS NULL)
256                AND (x_attribute18 IS NULL)))
257       AND (   (recinfo.attribute19 = x_attribute19)
258            OR (    (recinfo.attribute19 IS NULL)
259                AND (x_attribute19 IS NULL)))
260       AND (   (recinfo.attribute20 = x_attribute20)
261            OR (    (recinfo.attribute20 IS NULL)
262                AND (x_attribute20 IS NULL)))
263       AND ( recinfo.created_by = x_created_by )
264       AND ( recinfo.creation_date = x_creation_date )
265       AND ( recinfo.last_updated_by = x_last_updated_by )
266       AND ( recinfo.last_update_date = x_last_update_date )
267       AND (   (recinfo.last_update_login = x_last_update_login)
268            OR (    (recinfo.last_update_login IS NULL)
269                AND (x_last_update_login IS NULL)))
270   ) THEN
271 
272     return;
273 
274   ELSE
275 
276     fnd_message.set_name( 'FND', 'FORM_RECORD_CHANGED' );
277     app_exception.raise_exception;
278 
279   END IF;
280 
281 END lock_row;
282 
283 
284 PROCEDURE update_row( x_rowid VARCHAR2,
285                       x_entity_association_id NUMBER,
286                       x_primary_id_number VARCHAR2,
287                       x_associated_entity_id NUMBER,
288                       x_id_type VARCHAR2,
289                       x_id_number VARCHAR2,
290                       x_description VARCHAR2,
291                       x_effective_date DATE,
292                       x_ineffective_date DATE,
293                       x_attribute_category VARCHAR2,
294                       x_attribute1 VARCHAR2,
295                       x_attribute2 VARCHAR2,
296                       x_attribute3 VARCHAR2,
297                       x_attribute4 VARCHAR2,
298                       x_attribute5 VARCHAR2,
299                       x_attribute6 VARCHAR2,
300                       x_attribute7 VARCHAR2,
301                       x_attribute8 VARCHAR2,
302                       x_attribute9 VARCHAR2,
303                       x_attribute10 VARCHAR2,
304                       x_attribute11 VARCHAR2,
305                       x_attribute12 VARCHAR2,
306                       x_attribute13 VARCHAR2,
307                       x_attribute14 VARCHAR2,
308                       x_attribute15 VARCHAR2,
309                       x_attribute16 VARCHAR2,
310                       x_attribute17 VARCHAR2,
311                       x_attribute18 VARCHAR2,
312                       x_attribute19 VARCHAR2,
313                       x_attribute20 VARCHAR2,
314                       x_created_by NUMBER,
315                       x_creation_date DATE,
316                       x_last_updated_by NUMBER,
317                       x_last_update_date DATE,
318                       x_last_update_login NUMBER ) IS
319 BEGIN
320 
321   UPDATE jg_zz_entity_assoc
322   SET entity_association_id = x_entity_association_id,
323       primary_id_number     = x_primary_id_number,
324       associated_entity_id  = x_associated_entity_id,
325       id_type               = x_id_type,
326       id_number             = x_id_number,
327       description           = x_description,
328       effective_date        = x_effective_date,
329       ineffective_date      = x_ineffective_date,
330       attribute_category    = x_attribute_category,
331       attribute1            = x_attribute1,
332       attribute2            = x_attribute2,
333       attribute3            = x_attribute3,
334       attribute4            = x_attribute4,
335       attribute5            = x_attribute5,
336       attribute6            = x_attribute6,
337       attribute7            = x_attribute7,
338       attribute8            = x_attribute8,
339       attribute9            = x_attribute9,
340       attribute10           = x_attribute10,
341       attribute11           = x_attribute11,
342       attribute12           = x_attribute12,
343       attribute13           = x_attribute13,
344       attribute14           = x_attribute14,
345       attribute15           = x_attribute15,
346       attribute16           = x_attribute16,
347       attribute17           = x_attribute17,
348       attribute18           = x_attribute18,
349       attribute19           = x_attribute19,
350       attribute20           = x_attribute20,
351       created_by            = x_created_by,
352       creation_date         = x_creation_date,
353       last_updated_by       = x_last_updated_by,
354       last_update_date      = x_last_update_date,
355       last_update_login     = x_last_update_login
356   WHERE rowid = x_rowid;
357 
358   IF ( SQL%NOTFOUND ) THEN
359 
360     RAISE NO_DATA_FOUND;
361 
362   END IF;
363 
364 END update_row;
365 
366 
367 END JG_ZZ_ENTITY_ASSOC_PKG;