[Home] [Help]
PACKAGE BODY: APPS.CN_CALC_SQL_EXPS_PVT_W
Source
1 package body cn_calc_sql_exps_pvt_w as
2 /* $Header: cnwcexpb.pls 120.6 2007/03/14 12:56:53 kjayapau ship $ */
3 procedure rosetta_table_copy_in_p0(t out nocopy cn_calc_sql_exps_pvt.parent_expression_tbl_type, a0 JTF_VARCHAR2_TABLE_100) as
4 ddindx binary_integer; indx binary_integer;
5 begin
6 if a0 is not null and a0.count > 0 then
7 if a0.count > 0 then
8 indx := a0.first;
9 ddindx := 1;
10 while true loop
11 t(ddindx) := a0(indx);
12 ddindx := ddindx+1;
13 if a0.last =indx
14 then exit;
15 end if;
16 indx := a0.next(indx);
17 end loop;
18 end if;
19 end if;
20 end rosetta_table_copy_in_p0;
21 procedure rosetta_table_copy_out_p0(t cn_calc_sql_exps_pvt.parent_expression_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_100) as
22 ddindx binary_integer; indx binary_integer;
23 begin
24 if t is null or t.count = 0 then
25 a0 := JTF_VARCHAR2_TABLE_100();
26 else
27 a0 := JTF_VARCHAR2_TABLE_100();
28 if t.count > 0 then
29 a0.extend(t.count);
30 ddindx := t.first;
31 indx := 1;
32 while true loop
33 a0(indx) := t(ddindx);
34 indx := indx+1;
35 if t.last =ddindx
36 then exit;
37 end if;
38 ddindx := t.next(ddindx);
39 end loop;
40 end if;
41 end if;
42 end rosetta_table_copy_out_p0;
43
44 procedure rosetta_table_copy_in_p2(t out nocopy cn_calc_sql_exps_pvt.calc_expression_tbl_type, a0 JTF_NUMBER_TABLE
45 , a1 JTF_VARCHAR2_TABLE_100
46 , a2 JTF_VARCHAR2_TABLE_100
47 , a3 JTF_VARCHAR2_TABLE_100
48 , a4 JTF_VARCHAR2_TABLE_100
49 ) as
50 ddindx binary_integer; indx binary_integer;
51 begin
52 if a0 is not null and a0.count > 0 then
53 if a0.count > 0 then
54 indx := a0.first;
55 ddindx := 1;
56 while true loop
57 t(ddindx).calc_sql_exp_id := a0(indx);
58 t(ddindx).name := a1(indx);
59 t(ddindx).description := a2(indx);
60 t(ddindx).status := a3(indx);
61 t(ddindx).exp_type_code := a4(indx);
62 ddindx := ddindx+1;
63 if a0.last =indx
64 then exit;
65 end if;
66 indx := a0.next(indx);
67 end loop;
68 end if;
69 end if;
70 end rosetta_table_copy_in_p2;
71 procedure rosetta_table_copy_out_p2(t cn_calc_sql_exps_pvt.calc_expression_tbl_type, a0 out nocopy JTF_NUMBER_TABLE
72 , a1 out nocopy JTF_VARCHAR2_TABLE_100
73 , a2 out nocopy JTF_VARCHAR2_TABLE_100
74 , a3 out nocopy JTF_VARCHAR2_TABLE_100
75 , a4 out nocopy JTF_VARCHAR2_TABLE_100
76 ) as
77 ddindx binary_integer; indx binary_integer;
78 begin
79 if t is null or t.count = 0 then
80 a0 := JTF_NUMBER_TABLE();
81 a1 := JTF_VARCHAR2_TABLE_100();
82 a2 := JTF_VARCHAR2_TABLE_100();
83 a3 := JTF_VARCHAR2_TABLE_100();
84 a4 := JTF_VARCHAR2_TABLE_100();
85 else
86 a0 := JTF_NUMBER_TABLE();
87 a1 := JTF_VARCHAR2_TABLE_100();
88 a2 := JTF_VARCHAR2_TABLE_100();
89 a3 := JTF_VARCHAR2_TABLE_100();
90 a4 := JTF_VARCHAR2_TABLE_100();
91 if t.count > 0 then
92 a0.extend(t.count);
93 a1.extend(t.count);
94 a2.extend(t.count);
95 a3.extend(t.count);
96 a4.extend(t.count);
97 ddindx := t.first;
98 indx := 1;
99 while true loop
100 a0(indx) := t(ddindx).calc_sql_exp_id;
101 a1(indx) := t(ddindx).name;
102 a2(indx) := t(ddindx).description;
103 a3(indx) := t(ddindx).status;
104 a4(indx) := t(ddindx).exp_type_code;
105 indx := indx+1;
106 if t.last =ddindx
107 then exit;
108 end if;
109 ddindx := t.next(ddindx);
110 end loop;
111 end if;
112 end if;
113 end rosetta_table_copy_out_p2;
114
115 procedure rosetta_table_copy_in_p4(t out nocopy cn_calc_sql_exps_pvt.expr_type_tbl_type, a0 JTF_VARCHAR2_TABLE_100
116 , a1 JTF_VARCHAR2_TABLE_100
117 , a2 JTF_VARCHAR2_TABLE_100
118 , a3 JTF_VARCHAR2_TABLE_4000
119 ) as
120 ddindx binary_integer; indx binary_integer;
121 begin
122 if a0 is not null and a0.count > 0 then
123 if a0.count > 0 then
124 indx := a0.first;
125 ddindx := 1;
126 while true loop
127 t(ddindx).node_value := a0(indx);
128 t(ddindx).node_label := a1(indx);
129 t(ddindx).parent_node_value := a2(indx);
130 t(ddindx).element := a3(indx);
131 ddindx := ddindx+1;
132 if a0.last =indx
133 then exit;
134 end if;
135 indx := a0.next(indx);
136 end loop;
137 end if;
138 end if;
139 end rosetta_table_copy_in_p4;
140 procedure rosetta_table_copy_out_p4(t cn_calc_sql_exps_pvt.expr_type_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_100
141 , a1 out nocopy JTF_VARCHAR2_TABLE_100
142 , a2 out nocopy JTF_VARCHAR2_TABLE_100
143 , a3 out nocopy JTF_VARCHAR2_TABLE_4000
144 ) as
145 ddindx binary_integer; indx binary_integer;
146 begin
147 if t is null or t.count = 0 then
148 a0 := JTF_VARCHAR2_TABLE_100();
149 a1 := JTF_VARCHAR2_TABLE_100();
150 a2 := JTF_VARCHAR2_TABLE_100();
151 a3 := JTF_VARCHAR2_TABLE_4000();
152 else
153 a0 := JTF_VARCHAR2_TABLE_100();
154 a1 := JTF_VARCHAR2_TABLE_100();
155 a2 := JTF_VARCHAR2_TABLE_100();
156 a3 := JTF_VARCHAR2_TABLE_4000();
157 if t.count > 0 then
158 a0.extend(t.count);
159 a1.extend(t.count);
160 a2.extend(t.count);
161 a3.extend(t.count);
162 ddindx := t.first;
163 indx := 1;
164 while true loop
165 a0(indx) := t(ddindx).node_value;
166 a1(indx) := t(ddindx).node_label;
167 a2(indx) := t(ddindx).parent_node_value;
168 a3(indx) := t(ddindx).element;
169 indx := indx+1;
170 if t.last =ddindx
171 then exit;
172 end if;
173 ddindx := t.next(ddindx);
174 end loop;
175 end if;
176 end if;
177 end rosetta_table_copy_out_p4;
178
179 procedure rosetta_table_copy_in_p5(t out nocopy cn_calc_sql_exps_pvt.num_tbl_type, a0 JTF_NUMBER_TABLE) as
180 ddindx binary_integer; indx binary_integer;
181 begin
182 if a0 is not null and a0.count > 0 then
183 if a0.count > 0 then
184 indx := a0.first;
185 ddindx := 1;
186 while true loop
187 t(ddindx) := a0(indx);
188 ddindx := ddindx+1;
189 if a0.last =indx
190 then exit;
191 end if;
192 indx := a0.next(indx);
193 end loop;
194 end if;
195 end if;
196 end rosetta_table_copy_in_p5;
197 procedure rosetta_table_copy_out_p5(t cn_calc_sql_exps_pvt.num_tbl_type, a0 out nocopy JTF_NUMBER_TABLE) as
198 ddindx binary_integer; indx binary_integer;
199 begin
200 if t is null or t.count = 0 then
201 a0 := JTF_NUMBER_TABLE();
202 else
203 a0 := JTF_NUMBER_TABLE();
204 if t.count > 0 then
205 a0.extend(t.count);
206 ddindx := t.first;
207 indx := 1;
208 while true loop
209 a0(indx) := t(ddindx);
210 indx := indx+1;
211 if t.last =ddindx
212 then exit;
213 end if;
214 ddindx := t.next(ddindx);
215 end loop;
216 end if;
217 end if;
218 end rosetta_table_copy_out_p5;
219
220 procedure parse_plan_elements(p_sql_select VARCHAR2
221 , x_plan_elt_tbl out nocopy JTF_NUMBER_TABLE
222 , x_parsed_sql_select out nocopy VARCHAR2
223 )
224
225 as
226 ddx_plan_elt_tbl cn_calc_sql_exps_pvt.num_tbl_type;
227 ddindx binary_integer; indx binary_integer;
228 begin
229
230 -- copy data to the local IN or IN-OUT args, if any
231
232
233
234 -- here's the delegated call to the old PL/SQL routine
235 cn_calc_sql_exps_pvt.parse_plan_elements(p_sql_select,
236 ddx_plan_elt_tbl,
237 x_parsed_sql_select);
238
239 -- copy data back from the local variables to OUT or IN-OUT args, if any
240
241 cn_calc_sql_exps_pvt_w.rosetta_table_copy_out_p5(ddx_plan_elt_tbl, x_plan_elt_tbl);
242
243 end;
244
245 procedure get_dependent_plan_elts(p_api_version NUMBER
246 , p_init_msg_list VARCHAR2
247 , p_commit VARCHAR2
248 , p_validation_level NUMBER
249 , p_node_type VARCHAR2
250 , p_node_id NUMBER
251 , x_plan_elt_id_tbl out nocopy JTF_NUMBER_TABLE
252 , x_return_status out nocopy VARCHAR2
253 , x_msg_count out nocopy NUMBER
254 , x_msg_data out nocopy VARCHAR2
255 )
256
257 as
258 ddx_plan_elt_id_tbl cn_calc_sql_exps_pvt.num_tbl_type;
259 ddindx binary_integer; indx binary_integer;
260 begin
261
262 -- copy data to the local IN or IN-OUT args, if any
263
264
265
266
267
268
269
270
271
272
273 -- here's the delegated call to the old PL/SQL routine
274 cn_calc_sql_exps_pvt.get_dependent_plan_elts(p_api_version,
275 p_init_msg_list,
276 p_commit,
277 p_validation_level,
278 p_node_type,
279 p_node_id,
280 ddx_plan_elt_id_tbl,
281 x_return_status,
282 x_msg_count,
283 x_msg_data);
284
285 -- copy data back from the local variables to OUT or IN-OUT args, if any
286
287
288
289
290
291
292 cn_calc_sql_exps_pvt_w.rosetta_table_copy_out_p5(ddx_plan_elt_id_tbl, x_plan_elt_id_tbl);
293
294
295
296 end;
297
298 procedure get_parent_plan_elts(p_api_version NUMBER
299 , p_init_msg_list VARCHAR2
300 , p_commit VARCHAR2
301 , p_validation_level NUMBER
302 , p_node_type VARCHAR2
303 , p_node_id NUMBER
304 , x_plan_elt_id_tbl out nocopy JTF_NUMBER_TABLE
305 , x_return_status out nocopy VARCHAR2
306 , x_msg_count out nocopy NUMBER
307 , x_msg_data out nocopy VARCHAR2
308 )
309
310 as
311 ddx_plan_elt_id_tbl cn_calc_sql_exps_pvt.num_tbl_type;
312 ddindx binary_integer; indx binary_integer;
313 begin
314
315 -- copy data to the local IN or IN-OUT args, if any
316
317
318
319
320
321
322
323
324
325
326 -- here's the delegated call to the old PL/SQL routine
327 cn_calc_sql_exps_pvt.get_parent_plan_elts(p_api_version,
328 p_init_msg_list,
329 p_commit,
330 p_validation_level,
331 p_node_type,
332 p_node_id,
333 ddx_plan_elt_id_tbl,
334 x_return_status,
335 x_msg_count,
336 x_msg_data);
337
338 -- copy data back from the local variables to OUT or IN-OUT args, if any
339
340
341
342
343
344
345 cn_calc_sql_exps_pvt_w.rosetta_table_copy_out_p5(ddx_plan_elt_id_tbl, x_plan_elt_id_tbl);
346
347
348
349 end;
350
351 end cn_calc_sql_exps_pvt_w;