[Home] [Help]
PACKAGE BODY: APPS.OKL_POPULATE_PRCENG_RST_PUB_W
Source
1 package body okl_populate_prceng_rst_pub_w as
2 /* $Header: OKLUPRSB.pls 120.1 2005/05/30 12:32:04 kthiruva 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_p19(t out nocopy okl_populate_prceng_rst_pub.strm_tbl_type, a0 JTF_VARCHAR2_TABLE_200
23 , a1 JTF_VARCHAR2_TABLE_200
24 , a2 JTF_VARCHAR2_TABLE_100
25 , a3 JTF_NUMBER_TABLE
26 , a4 JTF_NUMBER_TABLE
27 ) as
28 ddindx binary_integer; indx binary_integer;
29 begin
30 if a0 is not null and a0.count > 0 then
31 if a0.count > 0 then
32 indx := a0.first;
33 ddindx := 1;
34 while true loop
35 t(ddindx).strm_name := a0(indx);
36 t(ddindx).strm_desc := a1(indx);
37 t(ddindx).sre_date := a2(indx);
38 t(ddindx).amount := rosetta_g_miss_num_map(a3(indx));
39 t(ddindx).index_number := rosetta_g_miss_num_map(a4(indx));
40 ddindx := ddindx+1;
41 if a0.last =indx
42 then exit;
43 end if;
44 indx := a0.next(indx);
45 end loop;
46 end if;
47 end if;
48 end rosetta_table_copy_in_p19;
49 procedure rosetta_table_copy_out_p19(t okl_populate_prceng_rst_pub.strm_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_200
50 , a1 out nocopy JTF_VARCHAR2_TABLE_200
51 , a2 out nocopy JTF_VARCHAR2_TABLE_100
52 , a3 out nocopy JTF_NUMBER_TABLE
53 , a4 out nocopy JTF_NUMBER_TABLE
54 ) as
55 ddindx binary_integer; indx binary_integer;
56 begin
57 if t is null or t.count = 0 then
58 a0 := JTF_VARCHAR2_TABLE_200();
59 a1 := JTF_VARCHAR2_TABLE_200();
60 a2 := JTF_VARCHAR2_TABLE_100();
61 a3 := JTF_NUMBER_TABLE();
62 a4 := JTF_NUMBER_TABLE();
63 else
64 a0 := JTF_VARCHAR2_TABLE_200();
65 a1 := JTF_VARCHAR2_TABLE_200();
66 a2 := JTF_VARCHAR2_TABLE_100();
67 a3 := JTF_NUMBER_TABLE();
68 a4 := JTF_NUMBER_TABLE();
69 if t.count > 0 then
70 a0.extend(t.count);
71 a1.extend(t.count);
72 a2.extend(t.count);
73 a3.extend(t.count);
74 a4.extend(t.count);
75 ddindx := t.first;
76 indx := 1;
77 while true loop
78 a0(indx) := t(ddindx).strm_name;
79 a1(indx) := t(ddindx).strm_desc;
80 a2(indx) := t(ddindx).sre_date;
81 a3(indx) := rosetta_g_miss_num_map(t(ddindx).amount);
82 a4(indx) := rosetta_g_miss_num_map(t(ddindx).index_number);
83 indx := indx+1;
84 if t.last =ddindx
85 then exit;
86 end if;
87 ddindx := t.next(ddindx);
88 end loop;
89 end if;
90 end if;
91 end rosetta_table_copy_out_p19;
92
93 procedure rosetta_table_copy_in_p21(t out nocopy okl_populate_prceng_rst_pub.strm_excp_tbl_type, a0 JTF_VARCHAR2_TABLE_100
94 , a1 JTF_VARCHAR2_TABLE_300
95 , a2 JTF_VARCHAR2_TABLE_1000
96 ) as
97 ddindx binary_integer; indx binary_integer;
98 begin
99 if a0 is not null and a0.count > 0 then
100 if a0.count > 0 then
101 indx := a0.first;
102 ddindx := 1;
103 while true loop
104 t(ddindx).error_code := a0(indx);
105 t(ddindx).error_message := a1(indx);
106 t(ddindx).tag_name := a2(indx);
107 ddindx := ddindx+1;
108 if a0.last =indx
109 then exit;
110 end if;
111 indx := a0.next(indx);
112 end loop;
113 end if;
114 end if;
115 end rosetta_table_copy_in_p21;
116 procedure rosetta_table_copy_out_p21(t okl_populate_prceng_rst_pub.strm_excp_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_100
117 , a1 out nocopy JTF_VARCHAR2_TABLE_300
118 , a2 out nocopy JTF_VARCHAR2_TABLE_1000
119 ) as
120 ddindx binary_integer; indx binary_integer;
121 begin
122 if t is null or t.count = 0 then
123 a0 := JTF_VARCHAR2_TABLE_100();
124 a1 := JTF_VARCHAR2_TABLE_300();
125 a2 := JTF_VARCHAR2_TABLE_1000();
126 else
127 a0 := JTF_VARCHAR2_TABLE_100();
128 a1 := JTF_VARCHAR2_TABLE_300();
129 a2 := JTF_VARCHAR2_TABLE_1000();
130 if t.count > 0 then
131 a0.extend(t.count);
132 a1.extend(t.count);
133 a2.extend(t.count);
134 ddindx := t.first;
135 indx := 1;
136 while true loop
137 a0(indx) := t(ddindx).error_code;
138 a1(indx) := t(ddindx).error_message;
139 a2(indx) := t(ddindx).tag_name;
140 indx := indx+1;
141 if t.last =ddindx
142 then exit;
143 end if;
144 ddindx := t.next(ddindx);
145 end loop;
146 end if;
147 end if;
148 end rosetta_table_copy_out_p21;
149
150 procedure populate_sif_ret_strms(x_return_status out nocopy VARCHAR2
151 , p_index_number NUMBER
152 , p2_a0 JTF_VARCHAR2_TABLE_200
153 , p2_a1 JTF_VARCHAR2_TABLE_200
154 , p2_a2 JTF_VARCHAR2_TABLE_100
155 , p2_a3 JTF_NUMBER_TABLE
156 , p2_a4 JTF_NUMBER_TABLE
157 , p_sir_id NUMBER
158 )
159
160 as
161 ddp_strm_tbl okl_populate_prceng_rst_pub.strm_tbl_type;
162 ddindx binary_integer; indx binary_integer;
163 begin
164
165 -- copy data to the local IN or IN-OUT args, if any
166
167
168 okl_populate_prceng_rst_pub_w.rosetta_table_copy_in_p19(ddp_strm_tbl, p2_a0
169 , p2_a1
170 , p2_a2
171 , p2_a3
172 , p2_a4
173 );
174
175
176 -- here's the delegated call to the old PL/SQL routine
177 okl_populate_prceng_rst_pub.populate_sif_ret_strms(x_return_status,
178 p_index_number,
179 ddp_strm_tbl,
180 p_sir_id);
181
182 -- copy data back from the local variables to OUT or IN-OUT args, if any
183
184
185
186 end;
187
188 procedure populate_sif_ret_errors(x_return_status out nocopy VARCHAR2
189 , x_id out nocopy NUMBER
190 , p_sir_id NUMBER
191 , p3_a0 JTF_VARCHAR2_TABLE_100
192 , p3_a1 JTF_VARCHAR2_TABLE_300
193 , p3_a2 JTF_VARCHAR2_TABLE_1000
194 , p_tag_attribute_name VARCHAR2
195 , p_tag_attribute_value VARCHAR2
196 , p_description VARCHAR2
197 )
198
199 as
200 ddp_strm_excp_tbl okl_populate_prceng_rst_pub.strm_excp_tbl_type;
201 ddindx binary_integer; indx binary_integer;
202 begin
203
204 -- copy data to the local IN or IN-OUT args, if any
205
206
207
208 okl_populate_prceng_rst_pub_w.rosetta_table_copy_in_p21(ddp_strm_excp_tbl, p3_a0
209 , p3_a1
210 , p3_a2
211 );
212
213
214
215
216 -- here's the delegated call to the old PL/SQL routine
217 okl_populate_prceng_rst_pub.populate_sif_ret_errors(x_return_status,
218 x_id,
219 p_sir_id,
220 ddp_strm_excp_tbl,
221 p_tag_attribute_name,
222 p_tag_attribute_value,
223 p_description);
224
225 -- copy data back from the local variables to OUT or IN-OUT args, if any
226
227
228
229
230
231
232 end;
233
234 end okl_populate_prceng_rst_pub_w;