1 package body ozf_time_api_pvt_w as
2 /* $Header: ozfwtiab.pls 115.0 2004/03/10 01:45:30 mkothari 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_p0(t out nocopy ozf_time_api_pvt.g_period_tbl_type, a0 JTF_NUMBER_TABLE) as
14 ddindx binary_integer; indx binary_integer;
15 begin
16 if a0 is not null and a0.count > 0 then
17 if a0.count > 0 then
18 indx := a0.first;
19 ddindx := 1;
20 while true loop
21 t(ddindx) := a0(indx);
22 ddindx := ddindx+1;
23 if a0.last =indx
24 then exit;
25 end if;
26 indx := a0.next(indx);
27 end loop;
28 end if;
29 end if;
30 end rosetta_table_copy_in_p0;
31 procedure rosetta_table_copy_out_p0(t ozf_time_api_pvt.g_period_tbl_type, a0 out nocopy JTF_NUMBER_TABLE) as
32 ddindx binary_integer; indx binary_integer;
33 begin
34 if t is null or t.count = 0 then
35 a0 := JTF_NUMBER_TABLE();
36 else
37 a0 := JTF_NUMBER_TABLE();
38 if t.count > 0 then
39 a0.extend(t.count);
40 ddindx := t.first;
41 indx := 1;
42 while true loop
43 a0(indx) := t(ddindx);
44 indx := indx+1;
45 if t.last =ddindx
46 then exit;
47 end if;
48 ddindx := t.next(ddindx);
49 end loop;
50 end if;
51 end if;
52 end rosetta_table_copy_out_p0;
53
54 function is_quarter_allowed(p_start_date date
55 , p_end_date date
56 ) return char
57
58 as
59 ddp_start_date date;
60 ddp_end_date date;
61 ddindx binary_integer; indx binary_integer;
62 ddrosetta_retval char(4000);
63 begin
64
65 -- copy data to the local IN or IN-OUT args, if any
66 ddp_start_date := rosetta_g_miss_date_in_map(p_start_date);
67
68 ddp_end_date := rosetta_g_miss_date_in_map(p_end_date);
69
70 -- here's the delegated call to the old PL/SQL routine
71 ddrosetta_retval := ozf_time_api_pvt.is_quarter_allowed(ddp_start_date,
72 ddp_end_date);
73
74 -- copy data back from the local variables to OUT or IN-OUT args, if any
75
76
77 return ddrosetta_retval;
78 end;
79
80 function is_period_range_valid(p_start_date date
81 , p_end_date date
82 ) return char
83
84 as
85 ddp_start_date date;
86 ddp_end_date date;
87 ddindx binary_integer; indx binary_integer;
88 ddrosetta_retval char(4000);
89 begin
90
91 -- copy data to the local IN or IN-OUT args, if any
92 ddp_start_date := rosetta_g_miss_date_in_map(p_start_date);
93
94 ddp_end_date := rosetta_g_miss_date_in_map(p_end_date);
95
96 -- here's the delegated call to the old PL/SQL routine
97 ddrosetta_retval := ozf_time_api_pvt.is_period_range_valid(ddp_start_date,
98 ddp_end_date);
99
100 -- copy data back from the local variables to OUT or IN-OUT args, if any
101
102
103 return ddrosetta_retval;
104 end;
105
106 end ozf_time_api_pvt_w;