[Home] [Help]
PACKAGE BODY: APPS.CN_SEASONALITIES_PVT_W
Source
1 package body cn_seasonalities_pvt_w as
2 /* $Header: cnwseasb.pls 115.4 2002/11/25 22:30:20 nkodkani 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_p2(t out nocopy cn_seasonalities_pvt.seasonalities_tbl_type, a0 JTF_NUMBER_TABLE
14 , a1 JTF_NUMBER_TABLE
15 , a2 JTF_NUMBER_TABLE
16 , a3 JTF_NUMBER_TABLE
17 ) as
18 ddindx binary_integer; indx binary_integer;
19 begin
20 if a0 is not null and a0.count > 0 then
21 if a0.count > 0 then
22 indx := a0.first;
23 ddindx := 1;
24 while true loop
25 t(ddindx).seas_schedule_id := a0(indx);
26 t(ddindx).seasonality_id := a1(indx);
27 t(ddindx).pct_seasonality := a2(indx);
28 t(ddindx).object_version_number := a3(indx);
29 ddindx := ddindx+1;
30 if a0.last =indx
31 then exit;
32 end if;
33 indx := a0.next(indx);
34 end loop;
35 end if;
36 end if;
37 end rosetta_table_copy_in_p2;
38 procedure rosetta_table_copy_out_p2(t cn_seasonalities_pvt.seasonalities_tbl_type, a0 out nocopy JTF_NUMBER_TABLE
39 , a1 out nocopy JTF_NUMBER_TABLE
40 , a2 out nocopy JTF_NUMBER_TABLE
41 , a3 out nocopy JTF_NUMBER_TABLE
42 ) as
43 ddindx binary_integer; indx binary_integer;
44 begin
45 if t is null or t.count = 0 then
46 a0 := JTF_NUMBER_TABLE();
47 a1 := JTF_NUMBER_TABLE();
48 a2 := JTF_NUMBER_TABLE();
49 a3 := JTF_NUMBER_TABLE();
50 else
51 a0 := JTF_NUMBER_TABLE();
52 a1 := JTF_NUMBER_TABLE();
53 a2 := JTF_NUMBER_TABLE();
54 a3 := JTF_NUMBER_TABLE();
55 if t.count > 0 then
56 a0.extend(t.count);
57 a1.extend(t.count);
58 a2.extend(t.count);
59 a3.extend(t.count);
60 ddindx := t.first;
61 indx := 1;
62 while true loop
63 a0(indx) := t(ddindx).seas_schedule_id;
64 a1(indx) := t(ddindx).seasonality_id;
65 a2(indx) := t(ddindx).pct_seasonality;
66 a3(indx) := t(ddindx).object_version_number;
67 indx := indx+1;
68 if t.last =ddindx
69 then exit;
70 end if;
71 ddindx := t.next(ddindx);
72 end loop;
73 end if;
74 end if;
75 end rosetta_table_copy_out_p2;
76
77 procedure update_seasonalities(p_api_version NUMBER
78 , p_init_msg_list VARCHAR2
79 , p_commit VARCHAR2
80 , p_validation_level NUMBER
81 , p4_a0 NUMBER
82 , p4_a1 NUMBER
83 , p4_a2 NUMBER
84 , p4_a3 NUMBER
85 , x_return_status out nocopy VARCHAR2
86 , x_msg_count out nocopy NUMBER
87 , x_msg_data out nocopy VARCHAR2
88 )
89
90 as
91 ddp_seasonalities_rec_type cn_seasonalities_pvt.seasonalities_rec_type;
92 ddindx binary_integer; indx binary_integer;
93 begin
94
95 -- copy data to the local IN or IN-OUT args, if any
96
97
98
99
100 ddp_seasonalities_rec_type.seas_schedule_id := p4_a0;
101 ddp_seasonalities_rec_type.seasonality_id := p4_a1;
102 ddp_seasonalities_rec_type.pct_seasonality := p4_a2;
103 ddp_seasonalities_rec_type.object_version_number := p4_a3;
104
105
106
107
108 -- here's the delegated call to the old PL/SQL routine
109 cn_seasonalities_pvt.update_seasonalities(p_api_version,
110 p_init_msg_list,
111 p_commit,
112 p_validation_level,
113 ddp_seasonalities_rec_type,
114 x_return_status,
115 x_msg_count,
116 x_msg_data);
117
118 -- copy data back from the local variables to OUT or IN-OUT args, if any
119
120
121
122
123
124
125
126 end;
127
128 procedure validate_seasonalities(p_api_version NUMBER
129 , p_init_msg_list VARCHAR2
130 , p_commit VARCHAR2
131 , p_validation_level NUMBER
132 , p4_a0 NUMBER
133 , p4_a1 VARCHAR2
134 , p4_a2 VARCHAR2
135 , p4_a3 NUMBER
136 , p4_a4 DATE
137 , p4_a5 DATE
138 , p4_a6 VARCHAR2
139 , p4_a7 NUMBER
140 , x_return_status out nocopy VARCHAR2
141 , x_msg_count out nocopy NUMBER
142 , x_msg_data out nocopy VARCHAR2
143 )
144
145 as
146 ddp_seas_schedule_rec_type cn_seasonalities_pvt.cp_seas_schedules_rec_type;
147 ddindx binary_integer; indx binary_integer;
148 begin
149
150 -- copy data to the local IN or IN-OUT args, if any
151
152
153
154
155 ddp_seas_schedule_rec_type.seas_schedule_id := p4_a0;
156 ddp_seas_schedule_rec_type.name := p4_a1;
157 ddp_seas_schedule_rec_type.description := p4_a2;
158 ddp_seas_schedule_rec_type.period_year := p4_a3;
159 ddp_seas_schedule_rec_type.start_date := rosetta_g_miss_date_in_map(p4_a4);
160 ddp_seas_schedule_rec_type.end_date := rosetta_g_miss_date_in_map(p4_a5);
161 ddp_seas_schedule_rec_type.validation_status := p4_a6;
162 ddp_seas_schedule_rec_type.object_version_number := p4_a7;
163
164
165
166
167 -- here's the delegated call to the old PL/SQL routine
168 cn_seasonalities_pvt.validate_seasonalities(p_api_version,
169 p_init_msg_list,
170 p_commit,
171 p_validation_level,
172 ddp_seas_schedule_rec_type,
173 x_return_status,
174 x_msg_count,
175 x_msg_data);
176
177 -- copy data back from the local variables to OUT or IN-OUT args, if any
178
179
180
181
182
183
184
185 end;
186
187 end cn_seasonalities_pvt_w;