DBA Data[Home] [Help]

PACKAGE BODY: APPS.JTF_UM_RESP_INFO_PVT_W

Source


1 package body jtf_um_resp_info_pvt_w as
2   /* $Header: JTFWRESB.pls 120.2 2005/09/02 18:35:55 applrt 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   -- 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 jtf_um_resp_info_pvt.resp_info_table_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_4000
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).resp_id := rosetta_g_miss_num_map(a0(indx));
36           t(ddindx).app_id := rosetta_g_miss_num_map(a1(indx));
37           t(ddindx).resp_name := a2(indx);
38           t(ddindx).resp_key := a3(indx);
39           t(ddindx).resp_source := 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_um_resp_info_pvt.resp_info_table_type, a0 out nocopy JTF_NUMBER_TABLE
50     , a1 out nocopy JTF_NUMBER_TABLE
51     , a2 out nocopy JTF_VARCHAR2_TABLE_100
52     , a3 out nocopy JTF_VARCHAR2_TABLE_100
53     , a4 out nocopy JTF_VARCHAR2_TABLE_4000
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_4000();
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_4000();
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) := rosetta_g_miss_num_map(t(ddindx).resp_id);
79           a1(indx) := rosetta_g_miss_num_map(t(ddindx).app_id);
80           a2(indx) := t(ddindx).resp_name;
81           a3(indx) := t(ddindx).resp_key;
82           a4(indx) := t(ddindx).resp_source;
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 get_resp_info_source(p_user_id  NUMBER
94     , p1_a0 out nocopy JTF_NUMBER_TABLE
95     , p1_a1 out nocopy JTF_NUMBER_TABLE
96     , p1_a2 out nocopy JTF_VARCHAR2_TABLE_100
97     , p1_a3 out nocopy JTF_VARCHAR2_TABLE_100
98     , p1_a4 out nocopy JTF_VARCHAR2_TABLE_4000
99   )
100 
101   as
102     ddx_result jtf_um_resp_info_pvt.resp_info_table_type;
103     ddindx binary_integer; indx binary_integer;
104   begin
105 
106     -- copy data to the local IN or IN-OUT args, if any
107 
108 
109     -- here's the delegated call to the old PL/SQL routine
110     jtf_um_resp_info_pvt.get_resp_info_source(p_user_id,
111       ddx_result);
112 
113     -- copy data back from the local variables to OUT or IN-OUT args, if any
114 
115     jtf_um_resp_info_pvt_w.rosetta_table_copy_out_p1(ddx_result, p1_a0
116       , p1_a1
117       , p1_a2
118       , p1_a3
119       , p1_a4
120       );
121   end;
122 
123 end jtf_um_resp_info_pvt_w;