DBA Data[Home] [Help]

PACKAGE BODY: APPS.JTF_PERZ_PROFILE_PUB_W

Source


1 package body jtf_perz_profile_pub_w as
2   /* $Header: jtfzwpfb.pls 120.2 2005/11/02 23:48:35 skothe ship $ */
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   function rosetta_g_miss_num_map(n number) return number as
7     a number := fnd_api.g_miss_num;
8     b number := 0-1962.0724;
9   begin
10     if n=a then return b; end if;
11     if n=b then return a; end if;
12     return n;
13   end;
14 
15   -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
16   function rosetta_g_miss_date_in_map(d date) return date as
17   begin
18     if d = rosetta_g_mistake_date then return fnd_api.g_miss_date; end if;
19     return d;
20   end;
21 
22   procedure rosetta_table_copy_in_p1(t OUT NOCOPY /* file.sql.39 change */ jtf_perz_profile_pub.profile_attrib_tbl_type, a0 JTF_NUMBER_TABLE
23     , a1 JTF_NUMBER_TABLE
24     , a2 JTF_VARCHAR2_TABLE_100
25     , a3 JTF_VARCHAR2_TABLE_100
26     , a4 JTF_VARCHAR2_TABLE_100
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).attribute_id := a0(indx);
36           t(ddindx).profile_id := a1(indx);
37           t(ddindx).profile_attribute := a2(indx);
38           t(ddindx).attribute_type := a3(indx);
39           t(ddindx).attribute_value := 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_p1;
49   procedure rosetta_table_copy_out_p1(t jtf_perz_profile_pub.profile_attrib_tbl_type, a0 OUT NOCOPY /* file.sql.39 change */ JTF_NUMBER_TABLE
50     , a1 OUT NOCOPY /* file.sql.39 change */ JTF_NUMBER_TABLE
51     , a2 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
52     , a3 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
53     , a4 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
54     ) as
55     ddindx binary_integer; indx binary_integer;
56   begin
57   if t is null or t.count = 0 then
58     a0 := JTF_NUMBER_TABLE();
59     a1 := JTF_NUMBER_TABLE();
60     a2 := JTF_VARCHAR2_TABLE_100();
61     a3 := JTF_VARCHAR2_TABLE_100();
62     a4 := JTF_VARCHAR2_TABLE_100();
63   else
64       a0 := JTF_NUMBER_TABLE();
65       a1 := JTF_NUMBER_TABLE();
66       a2 := JTF_VARCHAR2_TABLE_100();
67       a3 := JTF_VARCHAR2_TABLE_100();
68       a4 := JTF_VARCHAR2_TABLE_100();
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).attribute_id;
79           a1(indx) := t(ddindx).profile_id;
80           a2(indx) := t(ddindx).profile_attribute;
81           a3(indx) := t(ddindx).attribute_type;
82           a4(indx) := t(ddindx).attribute_value;
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_p1;
92 
93   procedure rosetta_table_copy_in_p4(t OUT NOCOPY /* file.sql.39 change */ jtf_perz_profile_pub.profile_out_tbl_type, a0 JTF_NUMBER_TABLE
94     , a1 JTF_VARCHAR2_TABLE_100
95     , a2 JTF_VARCHAR2_TABLE_100
96     , a3 JTF_VARCHAR2_TABLE_300
97     , a4 JTF_VARCHAR2_TABLE_100
98     , a5 JTF_VARCHAR2_TABLE_100
99     , a6 JTF_VARCHAR2_TABLE_100
100     , a7 JTF_VARCHAR2_TABLE_100
101     ) as
102     ddindx binary_integer; indx binary_integer;
103   begin
104   if a0 is not null and a0.count > 0 then
105       if a0.count > 0 then
106         indx := a0.first;
107         ddindx := 1;
108         while true loop
109           t(ddindx).profile_id := a0(indx);
110           t(ddindx).profile_name := a1(indx);
111           t(ddindx).profile_type := a2(indx);
112           t(ddindx).profile_description := a3(indx);
113           t(ddindx).active_flag := a4(indx);
114           t(ddindx).profile_attribute := a5(indx);
115           t(ddindx).attribute_type := a6(indx);
116           t(ddindx).attribute_value := a7(indx);
117           ddindx := ddindx+1;
118           if a0.last =indx
119             then exit;
120           end if;
121           indx := a0.next(indx);
122         end loop;
123       end if;
124    end if;
125   end rosetta_table_copy_in_p4;
126   procedure rosetta_table_copy_out_p4(t jtf_perz_profile_pub.profile_out_tbl_type, a0 OUT NOCOPY /* file.sql.39 change */ JTF_NUMBER_TABLE
127     , a1 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
128     , a2 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
129     , a3 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_300
130     , a4 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
131     , a5 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
132     , a6 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
133     , a7 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
134     ) as
135     ddindx binary_integer; indx binary_integer;
136   begin
137   if t is null or t.count = 0 then
138     a0 := JTF_NUMBER_TABLE();
139     a1 := JTF_VARCHAR2_TABLE_100();
140     a2 := JTF_VARCHAR2_TABLE_100();
141     a3 := JTF_VARCHAR2_TABLE_300();
142     a4 := JTF_VARCHAR2_TABLE_100();
143     a5 := JTF_VARCHAR2_TABLE_100();
144     a6 := JTF_VARCHAR2_TABLE_100();
145     a7 := JTF_VARCHAR2_TABLE_100();
146   else
147       a0 := JTF_NUMBER_TABLE();
148       a1 := JTF_VARCHAR2_TABLE_100();
149       a2 := JTF_VARCHAR2_TABLE_100();
150       a3 := JTF_VARCHAR2_TABLE_300();
151       a4 := JTF_VARCHAR2_TABLE_100();
152       a5 := JTF_VARCHAR2_TABLE_100();
153       a6 := JTF_VARCHAR2_TABLE_100();
154       a7 := JTF_VARCHAR2_TABLE_100();
155       if t.count > 0 then
156         a0.extend(t.count);
157         a1.extend(t.count);
158         a2.extend(t.count);
159         a3.extend(t.count);
160         a4.extend(t.count);
161         a5.extend(t.count);
162         a6.extend(t.count);
163         a7.extend(t.count);
164         ddindx := t.first;
165         indx := 1;
166         while true loop
167           a0(indx) := t(ddindx).profile_id;
168           a1(indx) := t(ddindx).profile_name;
169           a2(indx) := t(ddindx).profile_type;
170           a3(indx) := t(ddindx).profile_description;
171           a4(indx) := t(ddindx).active_flag;
172           a5(indx) := t(ddindx).profile_attribute;
173           a6(indx) := t(ddindx).attribute_type;
174           a7(indx) := t(ddindx).attribute_value;
175           indx := indx+1;
176           if t.last =ddindx
177             then exit;
178           end if;
179           ddindx := t.next(ddindx);
180         end loop;
181       end if;
182    end if;
183   end rosetta_table_copy_out_p4;
184 
185   procedure create_profile(p_api_version_number  NUMBER
186     , p_init_msg_list  VARCHAR2
187     , p_commit  VARCHAR2
188     , p_profile_id  NUMBER
189     , p_profile_name  VARCHAR2
190     , p_profile_type  VARCHAR2
191     , p_profile_desc  VARCHAR2
192     , p7_a0 JTF_NUMBER_TABLE
193     , p7_a1 JTF_NUMBER_TABLE
194     , p7_a2 JTF_VARCHAR2_TABLE_100
195     , p7_a3 JTF_VARCHAR2_TABLE_100
196     , p7_a4 JTF_VARCHAR2_TABLE_100
197     , x_profile_name OUT NOCOPY /* file.sql.39 change */  VARCHAR2
198     , x_profile_id OUT NOCOPY /* file.sql.39 change */  NUMBER
199     , x_return_status OUT NOCOPY /* file.sql.39 change */  VARCHAR2
200     , x_msg_count OUT NOCOPY /* file.sql.39 change */  NUMBER
201     , x_msg_data OUT NOCOPY /* file.sql.39 change */  VARCHAR2
202   )
203 
204   as
205     ddp_profile_attrib_tbl jtf_perz_profile_pub.profile_attrib_tbl_type;
206     ddindx binary_integer; indx binary_integer;
207   begin
208 
209     -- copy data to the local IN or IN-OUT args, if any
210 
211 
212 
213 
214 
215 
216 
217     jtf_perz_profile_pub_w.rosetta_table_copy_in_p1(ddp_profile_attrib_tbl, p7_a0
218       , p7_a1
219       , p7_a2
220       , p7_a3
221       , p7_a4
222       );
223 
224 
225 
226 
227 
228 
229     -- here's the delegated call to the old PL/SQL routine
230     jtf_perz_profile_pub.create_profile(p_api_version_number,
231       p_init_msg_list,
232       p_commit,
233       p_profile_id,
234       p_profile_name,
235       p_profile_type,
236       p_profile_desc,
237       ddp_profile_attrib_tbl,
238       x_profile_name,
239       x_profile_id,
240       x_return_status,
241       x_msg_count,
242       x_msg_data);
243 
244     -- copy data back from the local variables to OUT  or IN-OUT args, if any
245 
246 
247 
248 
249 
250 
251 
252 
253 
254 
255 
256 
257   end;
258 
259   procedure get_profile(p_api_version_number  NUMBER
260     , p_init_msg_list  VARCHAR2
261     , p_profile_id  NUMBER
262     , p_profile_name  VARCHAR2
263     , p_profile_type  VARCHAR2
264     , p5_a0 JTF_NUMBER_TABLE
265     , p5_a1 JTF_NUMBER_TABLE
266     , p5_a2 JTF_VARCHAR2_TABLE_100
267     , p5_a3 JTF_VARCHAR2_TABLE_100
268     , p5_a4 JTF_VARCHAR2_TABLE_100
269     , p6_a0 OUT NOCOPY /* file.sql.39 change */ JTF_NUMBER_TABLE
270     , p6_a1 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
271     , p6_a2 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
272     , p6_a3 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_300
273     , p6_a4 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
274     , p6_a5 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
275     , p6_a6 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
276     , p6_a7 OUT NOCOPY /* file.sql.39 change */ JTF_VARCHAR2_TABLE_100
277     , x_return_status OUT NOCOPY /* file.sql.39 change */  VARCHAR2
278     , x_msg_count OUT NOCOPY /* file.sql.39 change */  NUMBER
279     , x_msg_data OUT NOCOPY /* file.sql.39 change */  VARCHAR2
280   )
281 
282   as
283     ddp_profile_attrib_tbl jtf_perz_profile_pub.profile_attrib_tbl_type;
284     ddx_profile_tbl jtf_perz_profile_pub.profile_out_tbl_type;
285     ddindx binary_integer; indx binary_integer;
286   begin
287 
288     -- copy data to the local IN or IN-OUT args, if any
289 
290 
291 
292 
293 
294     jtf_perz_profile_pub_w.rosetta_table_copy_in_p1(ddp_profile_attrib_tbl, p5_a0
295       , p5_a1
296       , p5_a2
297       , p5_a3
298       , p5_a4
299       );
300 
301 
302 
303 
304 
305     -- here's the delegated call to the old PL/SQL routine
306     jtf_perz_profile_pub.get_profile(p_api_version_number,
307       p_init_msg_list,
308       p_profile_id,
309       p_profile_name,
310       p_profile_type,
311       ddp_profile_attrib_tbl,
312       ddx_profile_tbl,
313       x_return_status,
314       x_msg_count,
315       x_msg_data);
316 
317     -- copy data back from the local variables to OUT or IN-OUT args, if any
318 
319 
320 
321 
322 
323 
324     jtf_perz_profile_pub_w.rosetta_table_copy_out_p4(ddx_profile_tbl, p6_a0
325       , p6_a1
326       , p6_a2
327       , p6_a3
328       , p6_a4
329       , p6_a5
330       , p6_a6
331       , p6_a7
332       );
333 
334 
335 
336   end;
337 
338   procedure update_profile(p_api_version_number  NUMBER
339     , p_init_msg_list  VARCHAR2
340     , p_commit  VARCHAR2
341     , p_profile_id  NUMBER
342     , p_profile_name  VARCHAR2
343     , p_profile_type  VARCHAR2
344     , p_profile_desc  VARCHAR2
345     , p_active_flag  VARCHAR2
346     , p8_a0 JTF_NUMBER_TABLE
347     , p8_a1 JTF_NUMBER_TABLE
348     , p8_a2 JTF_VARCHAR2_TABLE_100
349     , p8_a3 JTF_VARCHAR2_TABLE_100
350     , p8_a4 JTF_VARCHAR2_TABLE_100
351     , x_profile_id OUT NOCOPY /* file.sql.39 change */  NUMBER
352     , x_return_status OUT NOCOPY /* file.sql.39 change */  VARCHAR2
353     , x_msg_count OUT NOCOPY /* file.sql.39 change */  NUMBER
354     , x_msg_data OUT NOCOPY /* file.sql.39 change */  VARCHAR2
355   )
356 
357   as
358     ddp_profile_attrib_tbl jtf_perz_profile_pub.profile_attrib_tbl_type;
359     ddindx binary_integer; indx binary_integer;
360   begin
361 
362     -- copy data to the local IN or IN-OUT args, if any
363 
364 
365 
366 
367 
368 
369 
370 
371     jtf_perz_profile_pub_w.rosetta_table_copy_in_p1(ddp_profile_attrib_tbl, p8_a0
372       , p8_a1
373       , p8_a2
374       , p8_a3
375       , p8_a4
376       );
377 
378 
379 
380 
381 
382     -- here's the delegated call to the old PL/SQL routine
383     jtf_perz_profile_pub.update_profile(p_api_version_number,
384       p_init_msg_list,
385       p_commit,
386       p_profile_id,
387       p_profile_name,
388       p_profile_type,
389       p_profile_desc,
390       p_active_flag,
391       ddp_profile_attrib_tbl,
392       x_profile_id,
393       x_return_status,
394       x_msg_count,
395       x_msg_data);
396 
397     -- copy data back from the local variables to OUT  or IN-OUT args, if any
398 
399 
400 
401 
402 
403 
404 
405 
406 
407 
408 
409 
410   end;
411 
412 end jtf_perz_profile_pub_w;