DBA Data[Home] [Help]

PACKAGE BODY: APPS.JTF_CAL_GRANTS_PVT_W

Source


1 package body jtf_cal_grants_pvt_w as
2   /* $Header: jtfwcgtb.pls 115.5 2002/11/15 00:23:08 jawang 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   procedure rosetta_table_copy_in_p1(t out nocopy jtf_cal_grants_pvt.granteetbl, a0 JTF_VARCHAR2_TABLE_300
14     , a1 JTF_NUMBER_TABLE
15     , a2 JTF_VARCHAR2_TABLE_100
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).granteekey := a0(indx);
25           t(ddindx).granttype := a1(indx);
26           t(ddindx).accesslevel := 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 jtf_cal_grants_pvt.granteetbl, a0 out nocopy JTF_VARCHAR2_TABLE_300
37     , a1 out nocopy JTF_NUMBER_TABLE
38     , a2 out nocopy JTF_VARCHAR2_TABLE_100
39     ) as
40     ddindx binary_integer; indx binary_integer;
41   begin
42   if t is null or t.count = 0 then
43     a0 := JTF_VARCHAR2_TABLE_300();
44     a1 := JTF_NUMBER_TABLE();
45     a2 := JTF_VARCHAR2_TABLE_100();
46   else
47       a0 := JTF_VARCHAR2_TABLE_300();
48       a1 := JTF_NUMBER_TABLE();
49       a2 := JTF_VARCHAR2_TABLE_100();
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).granteekey;
58           a1(indx) := t(ddindx).granttype;
59           a2(indx) := t(ddindx).accesslevel;
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 has_access_level(p_resourceid  VARCHAR2
71     , p_groupid  VARCHAR2
72     , ddrosetta_retval_bool OUT NOCOPY NUMBER
73   )
74 
75   as
76     ddindx binary_integer; indx binary_integer;
77     ddrosetta_retval boolean;
78   begin
79 
80     -- copy data to the local IN or IN-OUT args, if any
81 
82 
83     -- here's the delegated call to the old PL/SQL routine
84     ddrosetta_retval := jtf_cal_grants_pvt.has_access_level(p_resourceid,
85       p_groupid);
86 
87     -- copy data back from the local variables to OUT or IN-OUT args, if any
88     if ddrosetta_retval is null
89       then ddrosetta_retval_bool := null;
90     elsif ddrosetta_retval
91       then ddrosetta_retval_bool := 1;
92     else ddrosetta_retval_bool := 0;
93     end if;
94 
95   end;
96 
97 end jtf_cal_grants_pvt_w;