1 package body ahl_util_pkg_w as
2 /* $Header: AHLUTLWB.pls 115.7 2003/03/20 10:45:56 sjayacha 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 procedure rosetta_table_copy_in_p1(t out nocopy ahl_util_pkg.err_tbl_type, a0 JTF_NUMBER_TABLE
14 , a1 JTF_VARCHAR2_TABLE_2000
15 ) as
16 ddindx binary_integer; indx binary_integer;
17 begin
18 if a0 is not null and a0.count > 0 then
19 if a0.count > 0 then
20 indx := a0.first;
21 ddindx := 1;
22 while true loop
23 t(ddindx).msg_index := a0(indx);
24 t(ddindx).msg_data := a1(indx);
25 ddindx := ddindx+1;
26 if a0.last =indx
27 then exit;
28 end if;
29 indx := a0.next(indx);
30 end loop;
31 end if;
32 end if;
33 end rosetta_table_copy_in_p1;
34 procedure rosetta_table_copy_out_p1(t ahl_util_pkg.err_tbl_type, a0 out nocopy JTF_NUMBER_TABLE
35 , a1 out nocopy JTF_VARCHAR2_TABLE_2000
36 ) as
37 ddindx binary_integer; indx binary_integer;
38 begin
39 if t is null or t.count = 0 then
40 a0 := JTF_NUMBER_TABLE();
41 a1 := JTF_VARCHAR2_TABLE_2000();
42 else
43 a0 := JTF_NUMBER_TABLE();
44 a1 := JTF_VARCHAR2_TABLE_2000();
45 if t.count > 0 then
46 a0.extend(t.count);
47 a1.extend(t.count);
48 ddindx := t.first;
49 indx := 1;
50 while true loop
51 a0(indx) := t(ddindx).msg_index;
52 a1(indx) := t(ddindx).msg_data;
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_p1;
62
63 procedure err_mesg_to_table(p0_a0 out nocopy JTF_NUMBER_TABLE
64 , p0_a1 out nocopy JTF_VARCHAR2_TABLE_2000
65 )
66
67 as
68 ddx_err_table ahl_util_pkg.err_tbl_type;
69 ddindx binary_integer; indx binary_integer;
70 begin
71
72 -- copy data to the local IN or IN-OUT args, if any
73
74 -- here's the delegated call to the old PL/SQL routine
75 ahl_util_pkg.err_mesg_to_table(ddx_err_table);
76
77 -- copy data back from the local variables to OUT or IN-OUT args, if any
78 ahl_util_pkg_w.rosetta_table_copy_out_p1(ddx_err_table, p0_a0
79 , p0_a1
80 );
81 end;
82
83 end ahl_util_pkg_w;