[Home] [Help]
PACKAGE BODY: APPS.AMS_CODE_DEFINITION_PVT_W
Source
1 package body ams_code_definition_pvt_w as
2 /* $Header: amswcdnb.pls 120.1 2005/06/27 05:42:49 appldev ship $ */
3 rosetta_g_mistake_date date := to_date('01/01/+4713', 'MM/DD/SYYYY');
4 rosetta_g_miss_date date := to_date('01/01/-4712', 'MM/DD/SYYYY');
5
6 function rosetta_g_miss_num_map(n number) return number as
7 a number := fnd_api.g_miss_num;
8 b number := 0-1962.0724;
9 begin
10 if n=a then return b; end if;
11 if n=b then return a; end if;
12 return n;
13 end;
14
15 -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
16 function rosetta_g_miss_date_in_map(d date) return date as
17 begin
18 if d = rosetta_g_mistake_date then return fnd_api.g_miss_date; end if;
19 return d;
20 end;
21
22 procedure rosetta_table_copy_in_p3(t OUT NOCOPY ams_code_definition_pvt.code_def_tbl_type, a0 JTF_DATE_TABLE
23 , a1 JTF_DATE_TABLE
24 , a2 JTF_NUMBER_TABLE
25 , a3 JTF_NUMBER_TABLE
26 , a4 JTF_NUMBER_TABLE
27 , a5 JTF_VARCHAR2_TABLE_100
28 , a6 JTF_VARCHAR2_TABLE_100
29 , a7 JTF_VARCHAR2_TABLE_100
30 , a8 JTF_NUMBER_TABLE
31 , a9 JTF_NUMBER_TABLE
32 ) as
33 ddindx binary_integer; indx binary_integer;
34 begin
35 if a0 is not null and a0.count > 0 then
36 if a0.count > 0 then
37 indx := a0.first;
38 ddindx := 1;
39 while true loop
40 t(ddindx).creation_date := rosetta_g_miss_date_in_map(a0(indx));
41 t(ddindx).last_update_date := rosetta_g_miss_date_in_map(a1(indx));
42 t(ddindx).created_by := rosetta_g_miss_num_map(a2(indx));
43 t(ddindx).last_updated_by := rosetta_g_miss_num_map(a3(indx));
44 t(ddindx).last_update_login := rosetta_g_miss_num_map(a4(indx));
45 t(ddindx).object_type := a5(indx);
46 t(ddindx).column_name := a6(indx);
47 t(ddindx).object_def := a7(indx);
48 t(ddindx).code_definition_id := rosetta_g_miss_num_map(a8(indx));
49 t(ddindx).object_version_number := rosetta_g_miss_num_map(a9(indx));
50 ddindx := ddindx+1;
51 if a0.last =indx
52 then exit;
53 end if;
54 indx := a0.next(indx);
55 end loop;
56 end if;
57 end if;
58 end rosetta_table_copy_in_p3;
59 procedure rosetta_table_copy_out_p3(t ams_code_definition_pvt.code_def_tbl_type, a0 OUT NOCOPY JTF_DATE_TABLE
60 , a1 OUT NOCOPY JTF_DATE_TABLE
61 , a2 OUT NOCOPY JTF_NUMBER_TABLE
62 , a3 OUT NOCOPY JTF_NUMBER_TABLE
63 , a4 OUT NOCOPY JTF_NUMBER_TABLE
64 , a5 OUT NOCOPY JTF_VARCHAR2_TABLE_100
65 , a6 OUT NOCOPY JTF_VARCHAR2_TABLE_100
66 , a7 OUT NOCOPY JTF_VARCHAR2_TABLE_100
67 , a8 OUT NOCOPY JTF_NUMBER_TABLE
68 , a9 OUT NOCOPY JTF_NUMBER_TABLE
69 ) as
70 ddindx binary_integer; indx binary_integer;
71 begin
72 if t is null or t.count = 0 then
73 a0 := JTF_DATE_TABLE();
74 a1 := JTF_DATE_TABLE();
75 a2 := JTF_NUMBER_TABLE();
76 a3 := JTF_NUMBER_TABLE();
77 a4 := JTF_NUMBER_TABLE();
78 a5 := JTF_VARCHAR2_TABLE_100();
79 a6 := JTF_VARCHAR2_TABLE_100();
80 a7 := JTF_VARCHAR2_TABLE_100();
81 a8 := JTF_NUMBER_TABLE();
82 a9 := JTF_NUMBER_TABLE();
83 else
84 a0 := JTF_DATE_TABLE();
85 a1 := JTF_DATE_TABLE();
86 a2 := JTF_NUMBER_TABLE();
87 a3 := JTF_NUMBER_TABLE();
88 a4 := JTF_NUMBER_TABLE();
89 a5 := JTF_VARCHAR2_TABLE_100();
90 a6 := JTF_VARCHAR2_TABLE_100();
91 a7 := JTF_VARCHAR2_TABLE_100();
92 a8 := JTF_NUMBER_TABLE();
93 a9 := JTF_NUMBER_TABLE();
94 if t.count > 0 then
95 a0.extend(t.count);
96 a1.extend(t.count);
97 a2.extend(t.count);
98 a3.extend(t.count);
99 a4.extend(t.count);
100 a5.extend(t.count);
101 a6.extend(t.count);
102 a7.extend(t.count);
103 a8.extend(t.count);
104 a9.extend(t.count);
105 ddindx := t.first;
106 indx := 1;
107 while true loop
108 a0(indx) := t(ddindx).creation_date;
109 a1(indx) := t(ddindx).last_update_date;
110 a2(indx) := rosetta_g_miss_num_map(t(ddindx).created_by);
111 a3(indx) := rosetta_g_miss_num_map(t(ddindx).last_updated_by);
112 a4(indx) := rosetta_g_miss_num_map(t(ddindx).last_update_login);
113 a5(indx) := t(ddindx).object_type;
114 a6(indx) := t(ddindx).column_name;
115 a7(indx) := t(ddindx).object_def;
116 a8(indx) := rosetta_g_miss_num_map(t(ddindx).code_definition_id);
117 a9(indx) := rosetta_g_miss_num_map(t(ddindx).object_version_number);
118 indx := indx+1;
119 if t.last =ddindx
120 then exit;
121 end if;
122 ddindx := t.next(ddindx);
123 end loop;
124 end if;
125 end if;
126 end rosetta_table_copy_out_p3;
127
128 procedure create_code_definition(p_api_version_number NUMBER
129 , p_init_msg_list VARCHAR2
130 , p_commit VARCHAR2
131 , p_validation_level NUMBER
132 , x_return_status OUT NOCOPY VARCHAR2
133 , x_msg_count OUT NOCOPY NUMBER
134 , x_msg_data OUT NOCOPY VARCHAR2
135 , x_code_definition_id OUT NOCOPY NUMBER
136 , p7_a0 DATE := fnd_api.g_miss_date
137 , p7_a1 DATE := fnd_api.g_miss_date
138 , p7_a2 NUMBER := 0-1962.0724
139 , p7_a3 NUMBER := 0-1962.0724
140 , p7_a4 NUMBER := 0-1962.0724
141 , p7_a5 VARCHAR2 := fnd_api.g_miss_char
142 , p7_a6 VARCHAR2 := fnd_api.g_miss_char
143 , p7_a7 VARCHAR2 := fnd_api.g_miss_char
144 , p7_a8 NUMBER := 0-1962.0724
145 , p7_a9 NUMBER := 0-1962.0724
146 )
147 as
148 ddp_code_def_rec ams_code_definition_pvt.code_def_rec_type;
149 ddindx binary_integer; indx binary_integer;
150 begin
151
152 -- copy data to the local IN or IN-OUT args, if any
153
154
155
156
157
158
159
160 ddp_code_def_rec.creation_date := rosetta_g_miss_date_in_map(p7_a0);
161 ddp_code_def_rec.last_update_date := rosetta_g_miss_date_in_map(p7_a1);
162 ddp_code_def_rec.created_by := rosetta_g_miss_num_map(p7_a2);
163 ddp_code_def_rec.last_updated_by := rosetta_g_miss_num_map(p7_a3);
164 ddp_code_def_rec.last_update_login := rosetta_g_miss_num_map(p7_a4);
165 ddp_code_def_rec.object_type := p7_a5;
166 ddp_code_def_rec.column_name := p7_a6;
167 ddp_code_def_rec.object_def := p7_a7;
168 ddp_code_def_rec.code_definition_id := rosetta_g_miss_num_map(p7_a8);
169 ddp_code_def_rec.object_version_number := rosetta_g_miss_num_map(p7_a9);
170
171
172 -- here's the delegated call to the old PL/SQL routine
173 ams_code_definition_pvt.create_code_definition(p_api_version_number,
174 p_init_msg_list,
175 p_commit,
176 p_validation_level,
177 x_return_status,
178 x_msg_count,
179 x_msg_data,
180 ddp_code_def_rec,
181 x_code_definition_id);
182
183 -- copy data back from the local OUT or IN-OUT args, if any
184
185
186
187
188
189
190
191
192 end;
193
194 procedure update_code_definition(p_api_version_number NUMBER
195 , p_init_msg_list VARCHAR2
196 , p_commit VARCHAR2
197 , p_validation_level NUMBER
198 , x_return_status OUT NOCOPY VARCHAR2
199 , x_msg_count OUT NOCOPY NUMBER
200 , x_msg_data OUT NOCOPY VARCHAR2
201 , x_object_version_number OUT NOCOPY NUMBER
202 , p7_a0 DATE := fnd_api.g_miss_date
203 , p7_a1 DATE := fnd_api.g_miss_date
204 , p7_a2 NUMBER := 0-1962.0724
205 , p7_a3 NUMBER := 0-1962.0724
206 , p7_a4 NUMBER := 0-1962.0724
207 , p7_a5 VARCHAR2 := fnd_api.g_miss_char
208 , p7_a6 VARCHAR2 := fnd_api.g_miss_char
209 , p7_a7 VARCHAR2 := fnd_api.g_miss_char
210 , p7_a8 NUMBER := 0-1962.0724
211 , p7_a9 NUMBER := 0-1962.0724
212 )
213 as
214 ddp_code_def_rec ams_code_definition_pvt.code_def_rec_type;
215 ddindx binary_integer; indx binary_integer;
216 begin
217
218 -- copy data to the local IN or IN-OUT args, if any
219
220
221
222
223
224
225
226 ddp_code_def_rec.creation_date := rosetta_g_miss_date_in_map(p7_a0);
227 ddp_code_def_rec.last_update_date := rosetta_g_miss_date_in_map(p7_a1);
228 ddp_code_def_rec.created_by := rosetta_g_miss_num_map(p7_a2);
229 ddp_code_def_rec.last_updated_by := rosetta_g_miss_num_map(p7_a3);
230 ddp_code_def_rec.last_update_login := rosetta_g_miss_num_map(p7_a4);
231 ddp_code_def_rec.object_type := p7_a5;
232 ddp_code_def_rec.column_name := p7_a6;
233 ddp_code_def_rec.object_def := p7_a7;
234 ddp_code_def_rec.code_definition_id := rosetta_g_miss_num_map(p7_a8);
235 ddp_code_def_rec.object_version_number := rosetta_g_miss_num_map(p7_a9);
236
237
238 -- here's the delegated call to the old PL/SQL routine
239 ams_code_definition_pvt.update_code_definition(p_api_version_number,
240 p_init_msg_list,
241 p_commit,
242 p_validation_level,
243 x_return_status,
244 x_msg_count,
245 x_msg_data,
246 ddp_code_def_rec,
247 x_object_version_number);
248
249 -- copy data back from the local OUT or IN-OUT args, if any
250
251
252
253
254
255
256
257
258 end;
259
260 procedure validate_code_definition(p_api_version_number NUMBER
261 , p_init_msg_list VARCHAR2
262 , p_validation_level NUMBER
263 , p_validation_mode VARCHAR2
264 , x_return_status OUT NOCOPY VARCHAR2
265 , x_msg_count OUT NOCOPY NUMBER
266 , x_msg_data OUT NOCOPY VARCHAR2
267 , p3_a0 DATE := fnd_api.g_miss_date
268 , p3_a1 DATE := fnd_api.g_miss_date
269 , p3_a2 NUMBER := 0-1962.0724
270 , p3_a3 NUMBER := 0-1962.0724
271 , p3_a4 NUMBER := 0-1962.0724
272 , p3_a5 VARCHAR2 := fnd_api.g_miss_char
273 , p3_a6 VARCHAR2 := fnd_api.g_miss_char
274 , p3_a7 VARCHAR2 := fnd_api.g_miss_char
275 , p3_a8 NUMBER := 0-1962.0724
276 , p3_a9 NUMBER := 0-1962.0724
277 )
278 as
279 ddp_code_def_rec ams_code_definition_pvt.code_def_rec_type;
280 ddindx binary_integer; indx binary_integer;
281 begin
282
283 -- copy data to the local IN or IN-OUT args, if any
284
285
286
287 ddp_code_def_rec.creation_date := rosetta_g_miss_date_in_map(p3_a0);
288 ddp_code_def_rec.last_update_date := rosetta_g_miss_date_in_map(p3_a1);
289 ddp_code_def_rec.created_by := rosetta_g_miss_num_map(p3_a2);
290 ddp_code_def_rec.last_updated_by := rosetta_g_miss_num_map(p3_a3);
291 ddp_code_def_rec.last_update_login := rosetta_g_miss_num_map(p3_a4);
292 ddp_code_def_rec.object_type := p3_a5;
293 ddp_code_def_rec.column_name := p3_a6;
294 ddp_code_def_rec.object_def := p3_a7;
295 ddp_code_def_rec.code_definition_id := rosetta_g_miss_num_map(p3_a8);
296 ddp_code_def_rec.object_version_number := rosetta_g_miss_num_map(p3_a9);
297
298
299
300
301
302 -- here's the delegated call to the old PL/SQL routine
303 ams_code_definition_pvt.validate_code_definition(p_api_version_number,
304 p_init_msg_list,
305 p_validation_level,
306 ddp_code_def_rec,
307 p_validation_mode,
308 x_return_status,
309 x_msg_count,
310 x_msg_data);
311
312 -- copy data back from the local OUT or IN-OUT args, if any
313
314
315
316
317
318
319
320 end;
321
322 procedure check_code_def_items(p_validation_mode VARCHAR2
323 , x_return_status OUT NOCOPY VARCHAR2
324 , p0_a0 DATE := fnd_api.g_miss_date
325 , p0_a1 DATE := fnd_api.g_miss_date
326 , p0_a2 NUMBER := 0-1962.0724
327 , p0_a3 NUMBER := 0-1962.0724
328 , p0_a4 NUMBER := 0-1962.0724
329 , p0_a5 VARCHAR2 := fnd_api.g_miss_char
330 , p0_a6 VARCHAR2 := fnd_api.g_miss_char
331 , p0_a7 VARCHAR2 := fnd_api.g_miss_char
332 , p0_a8 NUMBER := 0-1962.0724
333 , p0_a9 NUMBER := 0-1962.0724
334 )
335 as
336 ddp_code_def_rec ams_code_definition_pvt.code_def_rec_type;
337 ddindx binary_integer; indx binary_integer;
338 begin
339
340 -- copy data to the local IN or IN-OUT args, if any
341 ddp_code_def_rec.creation_date := rosetta_g_miss_date_in_map(p0_a0);
342 ddp_code_def_rec.last_update_date := rosetta_g_miss_date_in_map(p0_a1);
343 ddp_code_def_rec.created_by := rosetta_g_miss_num_map(p0_a2);
344 ddp_code_def_rec.last_updated_by := rosetta_g_miss_num_map(p0_a3);
345 ddp_code_def_rec.last_update_login := rosetta_g_miss_num_map(p0_a4);
346 ddp_code_def_rec.object_type := p0_a5;
347 ddp_code_def_rec.column_name := p0_a6;
348 ddp_code_def_rec.object_def := p0_a7;
349 ddp_code_def_rec.code_definition_id := rosetta_g_miss_num_map(p0_a8);
350 ddp_code_def_rec.object_version_number := rosetta_g_miss_num_map(p0_a9);
351
352
353
354 -- here's the delegated call to the old PL/SQL routine
355 ams_code_definition_pvt.check_code_def_items(ddp_code_def_rec,
356 p_validation_mode,
357 x_return_status);
358
359 -- copy data back from the local OUT or IN-OUT args, if any
360
361
362 end;
363
364 procedure validate_code_def_rec(p_api_version_number NUMBER
365 , p_init_msg_list VARCHAR2
366 , x_return_status OUT NOCOPY VARCHAR2
367 , x_msg_count OUT NOCOPY NUMBER
368 , x_msg_data OUT NOCOPY VARCHAR2
369 , p5_a0 DATE := fnd_api.g_miss_date
370 , p5_a1 DATE := fnd_api.g_miss_date
371 , p5_a2 NUMBER := 0-1962.0724
372 , p5_a3 NUMBER := 0-1962.0724
373 , p5_a4 NUMBER := 0-1962.0724
374 , p5_a5 VARCHAR2 := fnd_api.g_miss_char
375 , p5_a6 VARCHAR2 := fnd_api.g_miss_char
376 , p5_a7 VARCHAR2 := fnd_api.g_miss_char
377 , p5_a8 NUMBER := 0-1962.0724
378 , p5_a9 NUMBER := 0-1962.0724
379 )
380 as
381 ddp_code_def_rec ams_code_definition_pvt.code_def_rec_type;
382 ddindx binary_integer; indx binary_integer;
383 begin
384
385 -- copy data to the local IN or IN-OUT args, if any
386
387
388
389
390
391 ddp_code_def_rec.creation_date := rosetta_g_miss_date_in_map(p5_a0);
392 ddp_code_def_rec.last_update_date := rosetta_g_miss_date_in_map(p5_a1);
393 ddp_code_def_rec.created_by := rosetta_g_miss_num_map(p5_a2);
394 ddp_code_def_rec.last_updated_by := rosetta_g_miss_num_map(p5_a3);
395 ddp_code_def_rec.last_update_login := rosetta_g_miss_num_map(p5_a4);
396 ddp_code_def_rec.object_type := p5_a5;
397 ddp_code_def_rec.column_name := p5_a6;
398 ddp_code_def_rec.object_def := p5_a7;
399 ddp_code_def_rec.code_definition_id := rosetta_g_miss_num_map(p5_a8);
400 ddp_code_def_rec.object_version_number := rosetta_g_miss_num_map(p5_a9);
401
402 -- here's the delegated call to the old PL/SQL routine
403 ams_code_definition_pvt.validate_code_def_rec(p_api_version_number,
404 p_init_msg_list,
405 x_return_status,
406 x_msg_count,
407 x_msg_data,
408 ddp_code_def_rec);
409
410 -- copy data back from the local OUT or IN-OUT args, if any
411
412
413
414
415
416 end;
417
418 end ams_code_definition_pvt_w;