1 package body oe_globals_w as
2 /* $Header: OERSGLBB.pls 120.0 2005/06/01 01:06:52 appldev 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_p199(t out NOCOPY /* file.sql.39 change */ oe_globals.line_id_list, a0 JTF_NUMBER_TABLE
23 , a1 JTF_NUMBER_TABLE
24 ) as
25 ddindx binary_integer; indx binary_integer;
26 begin
27 if a0 is not null and a0.count > 0 then
28 if a0.count > 0 then
29 indx := a0.first;
30 ddindx := 1;
31 while true loop
32 t(ddindx).line_id := rosetta_g_miss_num_map(a0(indx));
33 t(ddindx).post_write_ato_line_id := rosetta_g_miss_num_map(a1(indx));
34 ddindx := ddindx+1;
35 if a0.last =indx
36 then exit;
37 end if;
38 indx := a0.next(indx);
39 end loop;
40 end if;
41 end if;
42 end rosetta_table_copy_in_p199;
43 procedure rosetta_table_copy_out_p199(t oe_globals.line_id_list, a0 out NOCOPY /* file.sql.39 change */ JTF_NUMBER_TABLE
44 , a1 out NOCOPY /* file.sql.39 change */ JTF_NUMBER_TABLE
45 ) as
46 ddindx binary_integer; indx binary_integer;
47 begin
48 if t is null or t.count = 0 then
49 a0 := JTF_NUMBER_TABLE();
50 a1 := JTF_NUMBER_TABLE();
51 else
52 a0 := JTF_NUMBER_TABLE();
53 a1 := JTF_NUMBER_TABLE();
54 if t.count > 0 then
55 a0.extend(t.count);
56 a1.extend(t.count);
57 ddindx := t.first;
58 indx := 1;
59 while true loop
60 a0(indx) := rosetta_g_miss_num_map(t(ddindx).line_id);
61 a1(indx) := rosetta_g_miss_num_map(t(ddindx).post_write_ato_line_id);
62 indx := indx+1;
63 if t.last =ddindx
64 then exit;
65 end if;
66 ddindx := t.next(ddindx);
67 end loop;
68 end if;
69 end if;
70 end rosetta_table_copy_out_p199;
71
72 procedure rosetta_table_copy_in_p222(t out NOCOPY /* file.sql.39 change */ oe_globals.index_tbl_type, a0 JTF_NUMBER_TABLE) as
73 ddindx binary_integer; indx binary_integer;
74 begin
75 if a0 is not null and a0.count > 0 then
76 if a0.count > 0 then
77 indx := a0.first;
78 ddindx := 1;
79 while true loop
80 t(ddindx) := rosetta_g_miss_num_map(a0(indx));
81 ddindx := ddindx+1;
82 if a0.last =indx
83 then exit;
84 end if;
85 indx := a0.next(indx);
86 end loop;
87 end if;
88 end if;
89 end rosetta_table_copy_in_p222;
90 procedure rosetta_table_copy_out_p222(t oe_globals.index_tbl_type, a0 out NOCOPY /* file.sql.39 change */ JTF_NUMBER_TABLE) as
91 ddindx binary_integer; indx binary_integer;
92 begin
93 if t is null or t.count = 0 then
94 a0 := JTF_NUMBER_TABLE();
95 else
96 a0 := JTF_NUMBER_TABLE();
97 if t.count > 0 then
98 a0.extend(t.count);
99 ddindx := t.first;
100 indx := 1;
101 while true loop
102 a0(indx) := rosetta_g_miss_num_map(t(ddindx));
103 indx := indx+1;
104 if t.last =ddindx
105 then exit;
106 end if;
107 ddindx := t.next(ddindx);
108 end loop;
109 end if;
110 end if;
111 end rosetta_table_copy_out_p222;
112
113 procedure rosetta_table_copy_in_p226(t out NOCOPY /* file.sql.39 change */ oe_globals.oe_audit_trail_history_tbl, a0 JTF_NUMBER_TABLE
114 , a1 JTF_NUMBER_TABLE
115 , a2 JTF_VARCHAR2_TABLE_100
116 ) as
117 ddindx binary_integer; indx binary_integer;
118 begin
119 if a0 is not null and a0.count > 0 then
120 if a0.count > 0 then
121 indx := a0.first;
122 ddindx := 1;
123 while true loop
124 t(ddindx).header_id := rosetta_g_miss_num_map(a0(indx));
125 t(ddindx).line_id := rosetta_g_miss_num_map(a1(indx));
126 t(ddindx).history_type := a2(indx);
127 ddindx := ddindx+1;
128 if a0.last =indx
129 then exit;
130 end if;
131 indx := a0.next(indx);
132 end loop;
133 end if;
134 end if;
135 end rosetta_table_copy_in_p226;
136 procedure rosetta_table_copy_out_p226(t oe_globals.oe_audit_trail_history_tbl, a0 out NOCOPY /* file.sql.39 change */ JTF_NUMBER_TABLE
137 , a1 out NOCOPY /* file.sql.39 change */ JTF_NUMBER_TABLE
138 , a2 out NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
139 ) as
140 ddindx binary_integer; indx binary_integer;
141 begin
142 if t is null or t.count = 0 then
143 a0 := JTF_NUMBER_TABLE();
144 a1 := JTF_NUMBER_TABLE();
145 a2 := JTF_VARCHAR2_TABLE_100();
146 else
147 a0 := JTF_NUMBER_TABLE();
148 a1 := JTF_NUMBER_TABLE();
149 a2 := JTF_VARCHAR2_TABLE_100();
150 if t.count > 0 then
151 a0.extend(t.count);
152 a1.extend(t.count);
153 a2.extend(t.count);
154 ddindx := t.first;
155 indx := 1;
156 while true loop
157 a0(indx) := rosetta_g_miss_num_map(t(ddindx).header_id);
158 a1(indx) := rosetta_g_miss_num_map(t(ddindx).line_id);
159 a2(indx) := t(ddindx).history_type;
160 indx := indx+1;
161 if t.last =ddindx
162 then exit;
163 end if;
164 ddindx := t.next(ddindx);
165 end loop;
166 end if;
167 end if;
168 end rosetta_table_copy_out_p226;
169
170 procedure rosetta_table_copy_in_p228(t out NOCOPY /* file.sql.39 change */ oe_globals.boolean_tbl_type, a0 JTF_NUMBER_TABLE) as
171 ddindx binary_integer; indx binary_integer;
172 begin
173 if a0 is not null and a0.count > 0 then
174 if a0.count > 0 then
175 indx := a0.first;
176 ddindx := 1;
177 while true loop
178 if a0(indx) is null
179 then t(ddindx) := null;
180 elsif a0(indx) = 0
181 then t(ddindx) := false;
182 else t(ddindx) := true;
183 end if;
184 ddindx := ddindx+1;
185 if a0.last =indx
186 then exit;
187 end if;
188 indx := a0.next(indx);
189 end loop;
190 end if;
191 end if;
192 end rosetta_table_copy_in_p228;
193 procedure rosetta_table_copy_out_p228(t oe_globals.boolean_tbl_type, a0 out NOCOPY /* file.sql.39 change */ JTF_NUMBER_TABLE) as
194 ddindx binary_integer; indx binary_integer;
195 begin
196 if t is null or t.count = 0 then
197 a0 := JTF_NUMBER_TABLE();
198 else
199 a0 := JTF_NUMBER_TABLE();
200 if t.count > 0 then
201 a0.extend(t.count);
202 ddindx := t.first;
203 indx := 1;
204 while true loop
205 if t(ddindx) is null
206 then a0(indx) := null;
207 elsif t(ddindx)
208 then a0(indx) := 1;
209 else a0(indx) := 0;
210 end if;
211 indx := indx+1;
212 if t.last =ddindx
213 then exit;
214 end if;
215 ddindx := t.next(ddindx);
216 end loop;
217 end if;
218 end if;
219 end rosetta_table_copy_out_p228;
220
221 procedure rosetta_table_copy_in_p229(t out NOCOPY /* file.sql.39 change */ oe_globals.number_tbl_type, a0 JTF_NUMBER_TABLE) as
222 ddindx binary_integer; indx binary_integer;
223 begin
224 if a0 is not null and a0.count > 0 then
225 if a0.count > 0 then
226 indx := a0.first;
227 ddindx := 1;
228 while true loop
229 t(ddindx) := rosetta_g_miss_num_map(a0(indx));
230 ddindx := ddindx+1;
231 if a0.last =indx
232 then exit;
233 end if;
234 indx := a0.next(indx);
235 end loop;
236 end if;
237 end if;
238 end rosetta_table_copy_in_p229;
239 procedure rosetta_table_copy_out_p229(t oe_globals.number_tbl_type, a0 out NOCOPY /* file.sql.39 change */ JTF_NUMBER_TABLE) as
240 ddindx binary_integer; indx binary_integer;
241 begin
242 if t is null or t.count = 0 then
243 a0 := JTF_NUMBER_TABLE();
244 else
245 a0 := JTF_NUMBER_TABLE();
246 if t.count > 0 then
247 a0.extend(t.count);
248 ddindx := t.first;
249 indx := 1;
250 while true loop
251 a0(indx) := rosetta_g_miss_num_map(t(ddindx));
252 indx := indx+1;
253 if t.last =ddindx
254 then exit;
255 end if;
256 ddindx := t.next(ddindx);
257 end loop;
258 end if;
259 end if;
260 end rosetta_table_copy_out_p229;
261
262 procedure rosetta_table_copy_in_p232(t out NOCOPY /* file.sql.39 change */ oe_globals.access_list, a0 JTF_VARCHAR2_TABLE_100) as
263 ddindx binary_integer; indx binary_integer;
264 begin
265 if a0 is not null and a0.count > 0 then
266 if a0.count > 0 then
267 indx := a0.first;
268 ddindx := 1;
269 while true loop
270 t(ddindx) := a0(indx);
271 ddindx := ddindx+1;
272 if a0.last =indx
273 then exit;
274 end if;
275 indx := a0.next(indx);
276 end loop;
277 end if;
278 end if;
279 end rosetta_table_copy_in_p232;
280 procedure rosetta_table_copy_out_p232(t oe_globals.access_list, a0 out NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100) as
281 ddindx binary_integer; indx binary_integer;
282 begin
283 if t is null or t.count = 0 then
284 a0 := JTF_VARCHAR2_TABLE_100();
285 else
286 a0 := JTF_VARCHAR2_TABLE_100();
287 if t.count > 0 then
288 a0.extend(t.count);
289 ddindx := t.first;
290 indx := 1;
291 while true loop
292 a0(indx) := t(ddindx);
293 indx := indx+1;
294 if t.last =ddindx
295 then exit;
296 end if;
297 ddindx := t.next(ddindx);
298 end loop;
299 end if;
300 end if;
301 end rosetta_table_copy_out_p232;
302
303 procedure equal(p_attribute1 NUMBER
304 , p_attribute2 NUMBER
305 , ddrosetta_retval_bool OUT NOCOPY /* file.sql.39 change */ NUMBER
306 )
307
308 as
309 ddindx binary_integer; indx binary_integer;
310 ddrosetta_retval boolean;
311 begin
312
313 -- copy data to the local IN or IN-OUT args, if any
314
315
316 -- here's the delegated call to the old PL/SQL routine
317 ddrosetta_retval := oe_globals.equal(p_attribute1,
318 p_attribute2);
319
320 -- copy data back from the local variables to OUT NOCOPY /* file.sql.39 change */ or IN-OUT args, if any
321 if ddrosetta_retval is null
322 then ddrosetta_retval_bool := null;
323 elsif ddrosetta_retval
324 then ddrosetta_retval_bool := 1;
325 else ddrosetta_retval_bool := 0;
326 end if;
327
328 end;
329
330 procedure equal(p_attribute1 VARCHAR2
331 , p_attribute2 VARCHAR2
332 , ddrosetta_retval_bool OUT NOCOPY /* file.sql.39 change */ NUMBER
333 )
334
335 as
336 ddindx binary_integer; indx binary_integer;
337 ddrosetta_retval boolean;
338 begin
339
340 -- copy data to the local IN or IN-OUT args, if any
341
342
343 -- here's the delegated call to the old PL/SQL routine
344 ddrosetta_retval := oe_globals.equal(p_attribute1,
345 p_attribute2);
346
347 -- copy data back from the local variables to OUT NOCOPY /* file.sql.39 change */ or IN-OUT args, if any
348 if ddrosetta_retval is null
349 then ddrosetta_retval_bool := null;
350 elsif ddrosetta_retval
351 then ddrosetta_retval_bool := 1;
352 else ddrosetta_retval_bool := 0;
353 end if;
354
355 end;
356
357 procedure equal(p_attribute1 date
358 , p_attribute2 date
359 , ddrosetta_retval_bool OUT NOCOPY /* file.sql.39 change */ NUMBER
360 )
361
362 as
363 ddp_attribute1 date;
364 ddp_attribute2 date;
365 ddindx binary_integer; indx binary_integer;
366 ddrosetta_retval boolean;
367 begin
368
369 -- copy data to the local IN or IN-OUT args, if any
370 ddp_attribute1 := rosetta_g_miss_date_in_map(p_attribute1);
371
372 ddp_attribute2 := rosetta_g_miss_date_in_map(p_attribute2);
373
374 -- here's the delegated call to the old PL/SQL routine
375 ddrosetta_retval := oe_globals.equal(ddp_attribute1,
376 ddp_attribute2);
377
378 -- copy data back from the local variables to OUT NOCOPY /* file.sql.39 change */ or IN-OUT args, if any
379 if ddrosetta_retval is null
380 then ddrosetta_retval_bool := null;
381 elsif ddrosetta_retval
382 then ddrosetta_retval_bool := 1;
383 else ddrosetta_retval_bool := 0;
384 end if;
385
386 end;
387
388 end oe_globals_w;