1 package body ams_list_purge_pvt_w as
2 /* $Header: amswimcb.pls 120.0 2006/03/29 05:40 rmbhanda noship $ */
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 -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
7 function rosetta_g_miss_date_in_map(d date) return date as
8 begin
9 if d = rosetta_g_mistake_date then return fnd_api.g_miss_date; end if;
10 return d;
11 end;
12
13 function rosetta_g_miss_num_map(n number) return number as
14 a number := fnd_api.g_miss_num;
15 b number := 0-1962.0724;
16 begin
17 if n=a then return b; end if;
18 if n=b then return a; end if;
19 return n;
20 end;
21
22 procedure rosetta_table_copy_in_p0(t out nocopy ams_list_purge_pvt.t_rec_table, a0 JTF_NUMBER_TABLE) as
23 ddindx binary_integer; indx binary_integer;
24 begin
25 if a0 is not null and a0.count > 0 then
26 if a0.count > 0 then
27 indx := a0.first;
28 ddindx := 1;
29 while true loop
30 t(ddindx) := rosetta_g_miss_num_map(a0(indx));
31 ddindx := ddindx+1;
32 if a0.last =indx
33 then exit;
34 end if;
35 indx := a0.next(indx);
36 end loop;
37 end if;
38 end if;
39 end rosetta_table_copy_in_p0;
40 procedure rosetta_table_copy_out_p0(t ams_list_purge_pvt.t_rec_table, a0 out nocopy JTF_NUMBER_TABLE) as
41 ddindx binary_integer; indx binary_integer;
42 begin
43 if t is null or t.count = 0 then
44 a0 := JTF_NUMBER_TABLE();
45 else
46 a0 := JTF_NUMBER_TABLE();
47 if t.count > 0 then
48 a0.extend(t.count);
49 ddindx := t.first;
50 indx := 1;
51 while true loop
52 a0(indx) := rosetta_g_miss_num_map(t(ddindx));
53 indx := indx+1;
54 if t.last =ddindx
55 then exit;
56 end if;
57 ddindx := t.next(ddindx);
58 end loop;
59 end if;
60 end if;
61 end rosetta_table_copy_out_p0;
62
63 procedure rosetta_table_copy_in_p2(t out nocopy ams_list_purge_pvt.list_header_id_tbl, a0 JTF_NUMBER_TABLE
64 ) as
65 ddindx binary_integer; indx binary_integer;
66 begin
67 if a0 is not null and a0.count > 0 then
68 if a0.count > 0 then
69 indx := a0.first;
70 ddindx := 1;
71 while true loop
72 t(ddindx).l_list_header_id := rosetta_g_miss_num_map(a0(indx));
73 ddindx := ddindx+1;
74 if a0.last =indx
75 then exit;
76 end if;
77 indx := a0.next(indx);
78 end loop;
79 end if;
80 end if;
81 end rosetta_table_copy_in_p2;
82 procedure rosetta_table_copy_out_p2(t ams_list_purge_pvt.list_header_id_tbl, a0 out nocopy JTF_NUMBER_TABLE
83 ) as
84 ddindx binary_integer; indx binary_integer;
85 begin
86 if t is null or t.count = 0 then
87 a0 := JTF_NUMBER_TABLE();
88 else
89 a0 := JTF_NUMBER_TABLE();
90 if t.count > 0 then
91 a0.extend(t.count);
92 ddindx := t.first;
93 indx := 1;
94 while true loop
95 a0(indx) := rosetta_g_miss_num_map(t(ddindx).l_list_header_id);
96 indx := indx+1;
97 if t.last =ddindx
98 then exit;
99 end if;
100 ddindx := t.next(ddindx);
101 end loop;
102 end if;
103 end if;
104 end rosetta_table_copy_out_p2;
105
106 procedure delete_entries_soft(p0_a0 JTF_NUMBER_TABLE
107 , x_return_status out nocopy VARCHAR2
108 , x_msg_count out nocopy NUMBER
109 , x_msg_data out nocopy VARCHAR2
110 )
111
112 as
113 ddp_list_header_id_tbl ams_list_purge_pvt.list_header_id_tbl;
114 ddindx binary_integer; indx binary_integer;
115 begin
116
117 -- copy data to the local IN or IN-OUT args, if any
118 ams_list_purge_pvt_w.rosetta_table_copy_in_p2(ddp_list_header_id_tbl, p0_a0
119 );
120
121
122
123
124 -- here's the delegated call to the old PL/SQL routine
125 ams_list_purge_pvt.delete_entries_soft(ddp_list_header_id_tbl,
126 x_return_status,
127 x_msg_count,
128 x_msg_data);
129
130 -- copy data back from the local variables to OUT or IN-OUT args, if any
131
132
133
134 end;
135
136 procedure delete_entries_online(p0_a0 JTF_NUMBER_TABLE
137 , x_return_status out nocopy VARCHAR2
138 , x_msg_count out nocopy NUMBER
139 , x_msg_data out nocopy VARCHAR2
140 )
141
142 as
143 ddp_list_header_id_tbl ams_list_purge_pvt.list_header_id_tbl;
144 ddindx binary_integer; indx binary_integer;
145 begin
146
147 -- copy data to the local IN or IN-OUT args, if any
148 ams_list_purge_pvt_w.rosetta_table_copy_in_p2(ddp_list_header_id_tbl, p0_a0
149 );
150
151
152
153
154 -- here's the delegated call to the old PL/SQL routine
155 ams_list_purge_pvt.delete_entries_online(ddp_list_header_id_tbl,
156 x_return_status,
157 x_msg_count,
158 x_msg_data);
159
160 -- copy data back from the local variables to OUT or IN-OUT args, if any
161
162
163
164 end;
165
166 end ams_list_purge_pvt_w;