[Home] [Help]
PACKAGE BODY: APPS.OKL_API_W
Source
1 package body okl_api_w as
2 /* $Header: OKLIAPIB.pls 120.3 2005/09/22 23:32:06 fmiao 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_p1(t out nocopy okl_api.msg_tbl_type, a0 JTF_NUMBER_TABLE
23 , a1 JTF_VARCHAR2_TABLE_2000
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).error_status := rosetta_g_miss_num_map(a0(indx));
33 t(ddindx).data := 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_p1;
43 procedure rosetta_table_copy_out_p1(t okl_api.msg_tbl_type, a0 out nocopy JTF_NUMBER_TABLE
44 , a1 out nocopy JTF_VARCHAR2_TABLE_2000
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_VARCHAR2_TABLE_2000();
51 else
52 a0 := JTF_NUMBER_TABLE();
53 a1 := JTF_VARCHAR2_TABLE_2000();
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).error_status);
61 a1(indx) := t(ddindx).data;
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_p1;
71
72 procedure rosetta_table_copy_in_p3(t out nocopy okl_api.error_tbl_type, a0 JTF_NUMBER_TABLE
73 , a1 JTF_VARCHAR2_TABLE_100
74 , a2 JTF_NUMBER_TABLE
75 , a3 JTF_VARCHAR2_TABLE_2000
76 , a4 JTF_NUMBER_TABLE
77 , a5 JTF_VARCHAR2_TABLE_100
78 , a6 JTF_VARCHAR2_TABLE_100
79 ) as
80 ddindx binary_integer; indx binary_integer;
81 begin
82 if a0 is not null and a0.count > 0 then
83 if a0.count > 0 then
84 indx := a0.first;
85 ddindx := 1;
86 while true loop
87 t(ddindx).idx := rosetta_g_miss_num_map(a0(indx));
88 t(ddindx).error_type := a1(indx);
89 t(ddindx).msg_count := rosetta_g_miss_num_map(a2(indx));
90 t(ddindx).msg_data := a3(indx);
91 t(ddindx).sqlcode := rosetta_g_miss_num_map(a4(indx));
92 t(ddindx).api_name := a5(indx);
93 t(ddindx).api_package := a6(indx);
94 ddindx := ddindx+1;
95 if a0.last =indx
96 then exit;
97 end if;
98 indx := a0.next(indx);
99 end loop;
100 end if;
101 end if;
102 end rosetta_table_copy_in_p3;
103 procedure rosetta_table_copy_out_p3(t okl_api.error_tbl_type, a0 out nocopy JTF_NUMBER_TABLE
104 , a1 out nocopy JTF_VARCHAR2_TABLE_100
105 , a2 out nocopy JTF_NUMBER_TABLE
106 , a3 out nocopy JTF_VARCHAR2_TABLE_2000
107 , a4 out nocopy JTF_NUMBER_TABLE
108 , a5 out nocopy JTF_VARCHAR2_TABLE_100
109 , a6 out nocopy JTF_VARCHAR2_TABLE_100
110 ) as
111 ddindx binary_integer; indx binary_integer;
112 begin
113 if t is null or t.count = 0 then
114 a0 := JTF_NUMBER_TABLE();
115 a1 := JTF_VARCHAR2_TABLE_100();
116 a2 := JTF_NUMBER_TABLE();
117 a3 := JTF_VARCHAR2_TABLE_2000();
118 a4 := JTF_NUMBER_TABLE();
119 a5 := JTF_VARCHAR2_TABLE_100();
120 a6 := JTF_VARCHAR2_TABLE_100();
121 else
122 a0 := JTF_NUMBER_TABLE();
123 a1 := JTF_VARCHAR2_TABLE_100();
124 a2 := JTF_NUMBER_TABLE();
125 a3 := JTF_VARCHAR2_TABLE_2000();
126 a4 := JTF_NUMBER_TABLE();
127 a5 := JTF_VARCHAR2_TABLE_100();
128 a6 := JTF_VARCHAR2_TABLE_100();
129 if t.count > 0 then
130 a0.extend(t.count);
131 a1.extend(t.count);
132 a2.extend(t.count);
133 a3.extend(t.count);
134 a4.extend(t.count);
135 a5.extend(t.count);
136 a6.extend(t.count);
137 ddindx := t.first;
138 indx := 1;
139 while true loop
140 a0(indx) := rosetta_g_miss_num_map(t(ddindx).idx);
141 a1(indx) := t(ddindx).error_type;
142 a2(indx) := rosetta_g_miss_num_map(t(ddindx).msg_count);
143 a3(indx) := t(ddindx).msg_data;
144 a4(indx) := rosetta_g_miss_num_map(t(ddindx).sqlcode);
145 a5(indx) := t(ddindx).api_name;
146 a6(indx) := t(ddindx).api_package;
147 indx := indx+1;
148 if t.last =ddindx
149 then exit;
150 end if;
151 ddindx := t.next(ddindx);
152 end loop;
153 end if;
154 end if;
155 end rosetta_table_copy_out_p3;
156
157 end okl_api_w;