[Home] [Help]
PACKAGE BODY: APPS.AHL_QA_RESULTS_PVT_W
Source
1 package body ahl_qa_results_pvt_w as
2 /* $Header: AHLWQARB.pls 115.2 2002/11/14 23:06:22 shkalyan 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_qa_results_pvt.qa_results_tbl_type, a0 JTF_NUMBER_TABLE
14 , a1 JTF_VARCHAR2_TABLE_2000
15 , a2 JTF_NUMBER_TABLE
16 ) as
17 ddindx binary_integer; indx binary_integer;
18 begin
19 if a0 is not null and a0.count > 0 then
20 if a0.count > 0 then
21 indx := a0.first;
22 ddindx := 1;
23 while true loop
24 t(ddindx).char_id := a0(indx);
25 t(ddindx).result_value := a1(indx);
26 t(ddindx).result_id := a2(indx);
27 ddindx := ddindx+1;
28 if a0.last =indx
29 then exit;
30 end if;
31 indx := a0.next(indx);
32 end loop;
33 end if;
34 end if;
35 end rosetta_table_copy_in_p1;
36 procedure rosetta_table_copy_out_p1(t ahl_qa_results_pvt.qa_results_tbl_type, a0 out nocopy JTF_NUMBER_TABLE
37 , a1 out nocopy JTF_VARCHAR2_TABLE_2000
38 , a2 out nocopy JTF_NUMBER_TABLE
39 ) as
40 ddindx binary_integer; indx binary_integer;
41 begin
42 if t is null or t.count = 0 then
43 a0 := JTF_NUMBER_TABLE();
44 a1 := JTF_VARCHAR2_TABLE_2000();
45 a2 := JTF_NUMBER_TABLE();
46 else
47 a0 := JTF_NUMBER_TABLE();
48 a1 := JTF_VARCHAR2_TABLE_2000();
49 a2 := JTF_NUMBER_TABLE();
50 if t.count > 0 then
51 a0.extend(t.count);
52 a1.extend(t.count);
53 a2.extend(t.count);
54 ddindx := t.first;
55 indx := 1;
56 while true loop
57 a0(indx) := t(ddindx).char_id;
58 a1(indx) := t(ddindx).result_value;
59 a2(indx) := t(ddindx).result_id;
60 indx := indx+1;
61 if t.last =ddindx
62 then exit;
63 end if;
64 ddindx := t.next(ddindx);
65 end loop;
66 end if;
67 end if;
68 end rosetta_table_copy_out_p1;
69
70 procedure rosetta_table_copy_in_p3(t out nocopy ahl_qa_results_pvt.occurrence_tbl_type, a0 JTF_NUMBER_TABLE
71 , a1 JTF_NUMBER_TABLE
72 ) 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).element_count := a0(indx);
81 t(ddindx).occurrence := a1(indx);
82 ddindx := ddindx+1;
83 if a0.last =indx
84 then exit;
85 end if;
86 indx := a0.next(indx);
87 end loop;
88 end if;
89 end if;
90 end rosetta_table_copy_in_p3;
91 procedure rosetta_table_copy_out_p3(t ahl_qa_results_pvt.occurrence_tbl_type, a0 out nocopy JTF_NUMBER_TABLE
92 , a1 out nocopy JTF_NUMBER_TABLE
93 ) as
94 ddindx binary_integer; indx binary_integer;
95 begin
96 if t is null or t.count = 0 then
97 a0 := JTF_NUMBER_TABLE();
98 a1 := JTF_NUMBER_TABLE();
99 else
100 a0 := JTF_NUMBER_TABLE();
101 a1 := JTF_NUMBER_TABLE();
102 if t.count > 0 then
103 a0.extend(t.count);
104 a1.extend(t.count);
105 ddindx := t.first;
106 indx := 1;
107 while true loop
108 a0(indx) := t(ddindx).element_count;
109 a1(indx) := t(ddindx).occurrence;
110 indx := indx+1;
111 if t.last =ddindx
112 then exit;
113 end if;
114 ddindx := t.next(ddindx);
115 end loop;
116 end if;
117 end if;
118 end rosetta_table_copy_out_p3;
119
120 procedure rosetta_table_copy_in_p5(t out nocopy ahl_qa_results_pvt.qa_context_tbl_type, a0 JTF_VARCHAR2_TABLE_100
121 , a1 JTF_VARCHAR2_TABLE_2000
122 ) as
123 ddindx binary_integer; indx binary_integer;
124 begin
125 if a0 is not null and a0.count > 0 then
126 if a0.count > 0 then
127 indx := a0.first;
128 ddindx := 1;
129 while true loop
130 t(ddindx).name := a0(indx);
131 t(ddindx).value := a1(indx);
132 ddindx := ddindx+1;
133 if a0.last =indx
134 then exit;
135 end if;
136 indx := a0.next(indx);
137 end loop;
138 end if;
139 end if;
140 end rosetta_table_copy_in_p5;
141 procedure rosetta_table_copy_out_p5(t ahl_qa_results_pvt.qa_context_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_100
142 , a1 out nocopy JTF_VARCHAR2_TABLE_2000
143 ) as
144 ddindx binary_integer; indx binary_integer;
145 begin
146 if t is null or t.count = 0 then
147 a0 := JTF_VARCHAR2_TABLE_100();
148 a1 := JTF_VARCHAR2_TABLE_2000();
149 else
150 a0 := JTF_VARCHAR2_TABLE_100();
151 a1 := JTF_VARCHAR2_TABLE_2000();
152 if t.count > 0 then
153 a0.extend(t.count);
154 a1.extend(t.count);
155 ddindx := t.first;
156 indx := 1;
157 while true loop
158 a0(indx) := t(ddindx).name;
159 a1(indx) := t(ddindx).value;
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_p5;
169
170 procedure submit_qa_results(p_api_version NUMBER
171 , p_init_msg_list VARCHAR2
172 , p_commit VARCHAR2
173 , p_validation_level NUMBER
174 , p_default VARCHAR2
175 , p_module_type VARCHAR2
176 , x_return_status out nocopy VARCHAR2
177 , x_msg_count out nocopy NUMBER
178 , x_msg_data out nocopy VARCHAR2
179 , p_plan_id NUMBER
180 , p_organization_id NUMBER
181 , p_transaction_no NUMBER
182 , p_specification_id NUMBER
183 , p13_a0 JTF_NUMBER_TABLE
184 , p13_a1 JTF_VARCHAR2_TABLE_2000
185 , p13_a2 JTF_NUMBER_TABLE
186 , p14_a0 JTF_NUMBER_TABLE
187 , p14_a1 JTF_VARCHAR2_TABLE_2000
188 , p14_a2 JTF_NUMBER_TABLE
189 , p15_a0 JTF_VARCHAR2_TABLE_100
190 , p15_a1 JTF_VARCHAR2_TABLE_2000
191 , p_result_commit_flag NUMBER
192 , p_id_or_value VARCHAR2
193 , p_x_collection_id in out nocopy NUMBER
194 , p19_a0 in out nocopy JTF_NUMBER_TABLE
195 , p19_a1 in out nocopy JTF_NUMBER_TABLE
196 )
197
198 as
199 ddp_results_tbl ahl_qa_results_pvt.qa_results_tbl_type;
200 ddp_hidden_results_tbl ahl_qa_results_pvt.qa_results_tbl_type;
201 ddp_context_tbl ahl_qa_results_pvt.qa_context_tbl_type;
202 ddp_x_occurrence_tbl ahl_qa_results_pvt.occurrence_tbl_type;
203 ddindx binary_integer; indx binary_integer;
204 begin
205
206 -- copy data to the local IN or IN-OUT args, if any
207
208
209
210
211
212
213
214
215
216
217
218
219
220 ahl_qa_results_pvt_w.rosetta_table_copy_in_p1(ddp_results_tbl, p13_a0
221 , p13_a1
222 , p13_a2
223 );
224
225 ahl_qa_results_pvt_w.rosetta_table_copy_in_p1(ddp_hidden_results_tbl, p14_a0
226 , p14_a1
227 , p14_a2
228 );
229
230 ahl_qa_results_pvt_w.rosetta_table_copy_in_p5(ddp_context_tbl, p15_a0
231 , p15_a1
232 );
233
234
235
236
237 ahl_qa_results_pvt_w.rosetta_table_copy_in_p3(ddp_x_occurrence_tbl, p19_a0
238 , p19_a1
239 );
240
241 -- here's the delegated call to the old PL/SQL routine
242 ahl_qa_results_pvt.submit_qa_results(p_api_version,
243 p_init_msg_list,
244 p_commit,
245 p_validation_level,
246 p_default,
247 p_module_type,
248 x_return_status,
249 x_msg_count,
250 x_msg_data,
251 p_plan_id,
252 p_organization_id,
253 p_transaction_no,
254 p_specification_id,
255 ddp_results_tbl,
256 ddp_hidden_results_tbl,
257 ddp_context_tbl,
258 p_result_commit_flag,
259 p_id_or_value,
260 p_x_collection_id,
261 ddp_x_occurrence_tbl);
262
263 -- copy data back from the local variables to OUT or IN-OUT args, if any
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283 ahl_qa_results_pvt_w.rosetta_table_copy_out_p3(ddp_x_occurrence_tbl, p19_a0
284 , p19_a1
285 );
286 end;
287
288 end ahl_qa_results_pvt_w;