DBA Data[Home] [Help]

PACKAGE BODY: APPS.PV_PRGM_PTR_TYPES_PVT_W

Source


1 package body pv_prgm_ptr_types_pvt_w as
2   /* $Header: pvxwprpb.pls 115.2 2002/11/27 22:09:38 ktsao 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_p2(t OUT NOCOPY pv_prgm_ptr_types_pvt.prgm_ptr_types_rec_tbl_type, a0 JTF_NUMBER_TABLE
23     , a1 JTF_NUMBER_TABLE
24     , a2 JTF_VARCHAR2_TABLE_100
25     , a3 JTF_DATE_TABLE
26     , a4 JTF_NUMBER_TABLE
27     , a5 JTF_DATE_TABLE
28     , a6 JTF_NUMBER_TABLE
29     , a7 JTF_NUMBER_TABLE
30     , a8 JTF_NUMBER_TABLE
31     ) as
32     ddindx binary_integer; indx binary_integer;
33   begin
34   if a0 is not null and a0.count > 0 then
35       if a0.count > 0 then
36         indx := a0.first;
37         ddindx := 1;
38         while true loop
39           t(ddindx).program_partner_types_id := a0(indx);
40           t(ddindx).program_type_id := a1(indx);
41           t(ddindx).partner_type := a2(indx);
42           t(ddindx).last_update_date := rosetta_g_miss_date_in_map(a3(indx));
43           t(ddindx).last_updated_by := a4(indx);
44           t(ddindx).creation_date := rosetta_g_miss_date_in_map(a5(indx));
45           t(ddindx).created_by := a6(indx);
46           t(ddindx).last_update_login := a7(indx);
47           t(ddindx).object_version_number := a8(indx);
48           ddindx := ddindx+1;
49           if a0.last =indx
50             then exit;
51           end if;
52           indx := a0.next(indx);
53         end loop;
54       end if;
55    end if;
56   end rosetta_table_copy_in_p2;
57   procedure rosetta_table_copy_out_p2(t pv_prgm_ptr_types_pvt.prgm_ptr_types_rec_tbl_type, a0 OUT NOCOPY JTF_NUMBER_TABLE
58     , a1 OUT NOCOPY JTF_NUMBER_TABLE
59     , a2 OUT NOCOPY JTF_VARCHAR2_TABLE_100
60     , a3 OUT NOCOPY JTF_DATE_TABLE
61     , a4 OUT NOCOPY JTF_NUMBER_TABLE
62     , a5 OUT NOCOPY JTF_DATE_TABLE
63     , a6 OUT NOCOPY JTF_NUMBER_TABLE
64     , a7 OUT NOCOPY JTF_NUMBER_TABLE
65     , a8 OUT NOCOPY JTF_NUMBER_TABLE
66     ) as
67     ddindx binary_integer; indx binary_integer;
68   begin
69   if t is null or t.count = 0 then
70     a0 := JTF_NUMBER_TABLE();
71     a1 := JTF_NUMBER_TABLE();
72     a2 := JTF_VARCHAR2_TABLE_100();
73     a3 := JTF_DATE_TABLE();
74     a4 := JTF_NUMBER_TABLE();
75     a5 := JTF_DATE_TABLE();
76     a6 := JTF_NUMBER_TABLE();
77     a7 := JTF_NUMBER_TABLE();
78     a8 := JTF_NUMBER_TABLE();
79   else
80       a0 := JTF_NUMBER_TABLE();
81       a1 := JTF_NUMBER_TABLE();
82       a2 := JTF_VARCHAR2_TABLE_100();
83       a3 := JTF_DATE_TABLE();
84       a4 := JTF_NUMBER_TABLE();
85       a5 := JTF_DATE_TABLE();
86       a6 := JTF_NUMBER_TABLE();
87       a7 := JTF_NUMBER_TABLE();
88       a8 := JTF_NUMBER_TABLE();
89       if t.count > 0 then
90         a0.extend(t.count);
91         a1.extend(t.count);
92         a2.extend(t.count);
93         a3.extend(t.count);
94         a4.extend(t.count);
95         a5.extend(t.count);
96         a6.extend(t.count);
97         a7.extend(t.count);
98         a8.extend(t.count);
99         ddindx := t.first;
100         indx := 1;
101         while true loop
102           a0(indx) := t(ddindx).program_partner_types_id;
103           a1(indx) := t(ddindx).program_type_id;
104           a2(indx) := t(ddindx).partner_type;
105           a3(indx) := t(ddindx).last_update_date;
106           a4(indx) := t(ddindx).last_updated_by;
107           a5(indx) := t(ddindx).creation_date;
108           a6(indx) := t(ddindx).created_by;
109           a7(indx) := t(ddindx).last_update_login;
110           a8(indx) := t(ddindx).object_version_number;
111           indx := indx+1;
112           if t.last =ddindx
113             then exit;
114           end if;
115           ddindx := t.next(ddindx);
116         end loop;
117       end if;
118    end if;
119   end rosetta_table_copy_out_p2;
120 
121   procedure create_prgm_ptr_type(p_api_version_number  NUMBER
122     , p_init_msg_list  VARCHAR2
123     , p_commit  VARCHAR2
124     , p_validation_level  NUMBER
125     , x_return_status OUT NOCOPY  VARCHAR2
126     , x_msg_count OUT NOCOPY  NUMBER
127     , x_msg_data OUT NOCOPY  VARCHAR2
128     , p7_a0  NUMBER
129     , p7_a1  NUMBER
130     , p7_a2  VARCHAR2
131     , p7_a3  DATE
132     , p7_a4  NUMBER
133     , p7_a5  DATE
134     , p7_a6  NUMBER
135     , p7_a7  NUMBER
136     , p7_a8  NUMBER
137     , x_program_partner_types_id OUT NOCOPY  NUMBER
138   )
139 
140   as
141     ddp_prgm_ptr_types_rec pv_prgm_ptr_types_pvt.prgm_ptr_types_rec_type;
142     ddindx binary_integer; indx binary_integer;
143   begin
144 
145     -- copy data to the local IN or IN-OUT args, if any
146 
147 
148 
149 
150 
151 
152 
153     ddp_prgm_ptr_types_rec.program_partner_types_id := p7_a0;
154     ddp_prgm_ptr_types_rec.program_type_id := p7_a1;
155     ddp_prgm_ptr_types_rec.partner_type := p7_a2;
156     ddp_prgm_ptr_types_rec.last_update_date := rosetta_g_miss_date_in_map(p7_a3);
157     ddp_prgm_ptr_types_rec.last_updated_by := p7_a4;
158     ddp_prgm_ptr_types_rec.creation_date := rosetta_g_miss_date_in_map(p7_a5);
159     ddp_prgm_ptr_types_rec.created_by := p7_a6;
160     ddp_prgm_ptr_types_rec.last_update_login := p7_a7;
161     ddp_prgm_ptr_types_rec.object_version_number := p7_a8;
162 
163 
164     -- here's the delegated call to the old PL/SQL routine
165     pv_prgm_ptr_types_pvt.create_prgm_ptr_type(p_api_version_number,
166       p_init_msg_list,
167       p_commit,
168       p_validation_level,
169       x_return_status,
170       x_msg_count,
171       x_msg_data,
172       ddp_prgm_ptr_types_rec,
173       x_program_partner_types_id);
174 
175     -- copy data back from the local variables to OUT or IN-OUT args, if any
176 
177 
178 
179 
180 
181 
182 
183 
184   end;
185 
186   procedure update_prgm_ptr_type(p_api_version_number  NUMBER
187     , p_init_msg_list  VARCHAR2
188     , p_commit  VARCHAR2
189     , p_validation_level  NUMBER
190     , x_return_status OUT NOCOPY  VARCHAR2
191     , x_msg_count OUT NOCOPY  NUMBER
192     , x_msg_data OUT NOCOPY  VARCHAR2
193     , p7_a0  NUMBER
194     , p7_a1  NUMBER
195     , p7_a2  VARCHAR2
196     , p7_a3  DATE
197     , p7_a4  NUMBER
198     , p7_a5  DATE
199     , p7_a6  NUMBER
200     , p7_a7  NUMBER
201     , p7_a8  NUMBER
202   )
203 
204   as
205     ddp_prgm_ptr_types_rec pv_prgm_ptr_types_pvt.prgm_ptr_types_rec_type;
206     ddindx binary_integer; indx binary_integer;
207   begin
208 
209     -- copy data to the local IN or IN-OUT args, if any
210 
211 
212 
213 
214 
215 
216 
217     ddp_prgm_ptr_types_rec.program_partner_types_id := p7_a0;
218     ddp_prgm_ptr_types_rec.program_type_id := p7_a1;
219     ddp_prgm_ptr_types_rec.partner_type := p7_a2;
220     ddp_prgm_ptr_types_rec.last_update_date := rosetta_g_miss_date_in_map(p7_a3);
221     ddp_prgm_ptr_types_rec.last_updated_by := p7_a4;
222     ddp_prgm_ptr_types_rec.creation_date := rosetta_g_miss_date_in_map(p7_a5);
223     ddp_prgm_ptr_types_rec.created_by := p7_a6;
224     ddp_prgm_ptr_types_rec.last_update_login := p7_a7;
225     ddp_prgm_ptr_types_rec.object_version_number := p7_a8;
226 
227     -- here's the delegated call to the old PL/SQL routine
228     pv_prgm_ptr_types_pvt.update_prgm_ptr_type(p_api_version_number,
229       p_init_msg_list,
230       p_commit,
231       p_validation_level,
232       x_return_status,
233       x_msg_count,
234       x_msg_data,
235       ddp_prgm_ptr_types_rec);
236 
237     -- copy data back from the local variables to OUT or IN-OUT args, if any
238 
239 
240 
241 
242 
243 
244 
245   end;
246 
247   procedure validate_prgm_ptr_type(p_api_version_number  NUMBER
248     , p_init_msg_list  VARCHAR2
249     , p_validation_level  NUMBER
250     , p_validation_mode  VARCHAR2
251     , p4_a0  NUMBER
252     , p4_a1  NUMBER
253     , p4_a2  VARCHAR2
254     , p4_a3  DATE
255     , p4_a4  NUMBER
256     , p4_a5  DATE
257     , p4_a6  NUMBER
258     , p4_a7  NUMBER
259     , p4_a8  NUMBER
260     , x_return_status OUT NOCOPY  VARCHAR2
261     , x_msg_count OUT NOCOPY  NUMBER
262     , x_msg_data OUT NOCOPY  VARCHAR2
263   )
264 
265   as
266     ddp_prgm_ptr_types_rec pv_prgm_ptr_types_pvt.prgm_ptr_types_rec_type;
267     ddindx binary_integer; indx binary_integer;
268   begin
269 
270     -- copy data to the local IN or IN-OUT args, if any
271 
272 
273 
274 
275     ddp_prgm_ptr_types_rec.program_partner_types_id := p4_a0;
276     ddp_prgm_ptr_types_rec.program_type_id := p4_a1;
277     ddp_prgm_ptr_types_rec.partner_type := p4_a2;
278     ddp_prgm_ptr_types_rec.last_update_date := rosetta_g_miss_date_in_map(p4_a3);
279     ddp_prgm_ptr_types_rec.last_updated_by := p4_a4;
280     ddp_prgm_ptr_types_rec.creation_date := rosetta_g_miss_date_in_map(p4_a5);
281     ddp_prgm_ptr_types_rec.created_by := p4_a6;
282     ddp_prgm_ptr_types_rec.last_update_login := p4_a7;
283     ddp_prgm_ptr_types_rec.object_version_number := p4_a8;
284 
285 
286 
287 
288     -- here's the delegated call to the old PL/SQL routine
289     pv_prgm_ptr_types_pvt.validate_prgm_ptr_type(p_api_version_number,
290       p_init_msg_list,
291       p_validation_level,
292       p_validation_mode,
293       ddp_prgm_ptr_types_rec,
294       x_return_status,
295       x_msg_count,
296       x_msg_data);
297 
298     -- copy data back from the local variables to OUT or IN-OUT args, if any
299 
300 
301 
302 
303 
304 
305 
306   end;
307 
308   procedure check_items(p0_a0  NUMBER
309     , p0_a1  NUMBER
310     , p0_a2  VARCHAR2
311     , p0_a3  DATE
312     , p0_a4  NUMBER
313     , p0_a5  DATE
314     , p0_a6  NUMBER
315     , p0_a7  NUMBER
316     , p0_a8  NUMBER
317     , p_validation_mode  VARCHAR2
318     , x_return_status OUT NOCOPY  VARCHAR2
319   )
320 
321   as
322     ddp_prgm_ptr_types_rec pv_prgm_ptr_types_pvt.prgm_ptr_types_rec_type;
323     ddindx binary_integer; indx binary_integer;
324   begin
325 
326     -- copy data to the local IN or IN-OUT args, if any
327     ddp_prgm_ptr_types_rec.program_partner_types_id := p0_a0;
328     ddp_prgm_ptr_types_rec.program_type_id := p0_a1;
329     ddp_prgm_ptr_types_rec.partner_type := p0_a2;
330     ddp_prgm_ptr_types_rec.last_update_date := rosetta_g_miss_date_in_map(p0_a3);
331     ddp_prgm_ptr_types_rec.last_updated_by := p0_a4;
332     ddp_prgm_ptr_types_rec.creation_date := rosetta_g_miss_date_in_map(p0_a5);
333     ddp_prgm_ptr_types_rec.created_by := p0_a6;
334     ddp_prgm_ptr_types_rec.last_update_login := p0_a7;
335     ddp_prgm_ptr_types_rec.object_version_number := p0_a8;
336 
337 
338 
339     -- here's the delegated call to the old PL/SQL routine
340     pv_prgm_ptr_types_pvt.check_items(ddp_prgm_ptr_types_rec,
341       p_validation_mode,
342       x_return_status);
343 
344     -- copy data back from the local variables to OUT or IN-OUT args, if any
345 
346 
347   end;
348 
349   procedure validate_rec(p_api_version_number  NUMBER
350     , p_init_msg_list  VARCHAR2
351     , x_return_status OUT NOCOPY  VARCHAR2
352     , x_msg_count OUT NOCOPY  NUMBER
353     , x_msg_data OUT NOCOPY  VARCHAR
354     , p5_a0  NUMBER
355     , p5_a1  NUMBER
356     , p5_a2  VARCHAR2
357     , p5_a3  DATE
358     , p5_a4  NUMBER
359     , p5_a5  DATE
360     , p5_a6  NUMBER
361     , p5_a7  NUMBER
362     , p5_a8  NUMBER
363   )
364 
365   as
366     ddp_prgm_ptr_types_rec pv_prgm_ptr_types_pvt.prgm_ptr_types_rec_type;
367     ddindx binary_integer; indx binary_integer;
368   begin
369 
370     -- copy data to the local IN or IN-OUT args, if any
371 
372 
373 
374 
375 
376     ddp_prgm_ptr_types_rec.program_partner_types_id := p5_a0;
377     ddp_prgm_ptr_types_rec.program_type_id := p5_a1;
378     ddp_prgm_ptr_types_rec.partner_type := p5_a2;
379     ddp_prgm_ptr_types_rec.last_update_date := rosetta_g_miss_date_in_map(p5_a3);
380     ddp_prgm_ptr_types_rec.last_updated_by := p5_a4;
381     ddp_prgm_ptr_types_rec.creation_date := rosetta_g_miss_date_in_map(p5_a5);
382     ddp_prgm_ptr_types_rec.created_by := p5_a6;
383     ddp_prgm_ptr_types_rec.last_update_login := p5_a7;
384     ddp_prgm_ptr_types_rec.object_version_number := p5_a8;
385 
386     -- here's the delegated call to the old PL/SQL routine
387     pv_prgm_ptr_types_pvt.validate_rec(p_api_version_number,
388       p_init_msg_list,
389       x_return_status,
390       x_msg_count,
391       x_msg_data,
392       ddp_prgm_ptr_types_rec);
393 
394     -- copy data back from the local variables to OUT or IN-OUT args, if any
395 
396 
397 
398 
399 
400   end;
401 
402   procedure complete_rec(p0_a0  NUMBER
403     , p0_a1  NUMBER
404     , p0_a2  VARCHAR2
405     , p0_a3  DATE
406     , p0_a4  NUMBER
407     , p0_a5  DATE
408     , p0_a6  NUMBER
409     , p0_a7  NUMBER
410     , p0_a8  NUMBER
411     , p1_a0 OUT NOCOPY  NUMBER
412     , p1_a1 OUT NOCOPY  NUMBER
413     , p1_a2 OUT NOCOPY  VARCHAR2
414     , p1_a3 OUT NOCOPY  DATE
415     , p1_a4 OUT NOCOPY  NUMBER
416     , p1_a5 OUT NOCOPY  DATE
417     , p1_a6 OUT NOCOPY  NUMBER
418     , p1_a7 OUT NOCOPY  NUMBER
419     , p1_a8 OUT NOCOPY  NUMBER
420   )
421 
422   as
423     ddp_prgm_ptr_types_rec pv_prgm_ptr_types_pvt.prgm_ptr_types_rec_type;
424     ddx_complete_rec pv_prgm_ptr_types_pvt.prgm_ptr_types_rec_type;
425     ddindx binary_integer; indx binary_integer;
426   begin
427 
428     -- copy data to the local IN or IN-OUT args, if any
429     ddp_prgm_ptr_types_rec.program_partner_types_id := p0_a0;
430     ddp_prgm_ptr_types_rec.program_type_id := p0_a1;
431     ddp_prgm_ptr_types_rec.partner_type := p0_a2;
432     ddp_prgm_ptr_types_rec.last_update_date := rosetta_g_miss_date_in_map(p0_a3);
433     ddp_prgm_ptr_types_rec.last_updated_by := p0_a4;
434     ddp_prgm_ptr_types_rec.creation_date := rosetta_g_miss_date_in_map(p0_a5);
435     ddp_prgm_ptr_types_rec.created_by := p0_a6;
436     ddp_prgm_ptr_types_rec.last_update_login := p0_a7;
437     ddp_prgm_ptr_types_rec.object_version_number := p0_a8;
438 
439 
440     -- here's the delegated call to the old PL/SQL routine
441     pv_prgm_ptr_types_pvt.complete_rec(ddp_prgm_ptr_types_rec,
442       ddx_complete_rec);
443 
444     -- copy data back from the local variables to OUT or IN-OUT args, if any
445 
446     p1_a0 := ddx_complete_rec.program_partner_types_id;
447     p1_a1 := ddx_complete_rec.program_type_id;
448     p1_a2 := ddx_complete_rec.partner_type;
449     p1_a3 := ddx_complete_rec.last_update_date;
450     p1_a4 := ddx_complete_rec.last_updated_by;
451     p1_a5 := ddx_complete_rec.creation_date;
452     p1_a6 := ddx_complete_rec.created_by;
453     p1_a7 := ddx_complete_rec.last_update_login;
454     p1_a8 := ddx_complete_rec.object_version_number;
455   end;
456 
457 end pv_prgm_ptr_types_pvt_w;