DBA Data[Home] [Help]

PACKAGE BODY: APPS.CN_SRP_ROLLOVER_QUOTA_PVT_W

Source


1 package body cn_srp_rollover_quota_pvt_w as
2   /* $Header: cnwsrb.pls 115.1 2002/12/04 02:56:03 clku 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_p1(t out nocopy cn_srp_rollover_quota_pvt.srp_rollover_quota_tbl_type, a0 JTF_NUMBER_TABLE
14     , a1 JTF_NUMBER_TABLE
15     , a2 JTF_NUMBER_TABLE
16     , a3 JTF_NUMBER_TABLE
17     , a4 JTF_NUMBER_TABLE
18     , a5 JTF_NUMBER_TABLE
19     , a6 JTF_VARCHAR2_TABLE_100
20     , a7 JTF_VARCHAR2_TABLE_200
21     , a8 JTF_VARCHAR2_TABLE_200
22     , a9 JTF_VARCHAR2_TABLE_200
23     , a10 JTF_VARCHAR2_TABLE_200
24     , a11 JTF_VARCHAR2_TABLE_200
25     , a12 JTF_VARCHAR2_TABLE_200
26     , a13 JTF_VARCHAR2_TABLE_200
27     , a14 JTF_VARCHAR2_TABLE_200
28     , a15 JTF_VARCHAR2_TABLE_200
29     , a16 JTF_VARCHAR2_TABLE_200
30     , a17 JTF_VARCHAR2_TABLE_200
31     , a18 JTF_VARCHAR2_TABLE_200
32     , a19 JTF_VARCHAR2_TABLE_200
33     , a20 JTF_VARCHAR2_TABLE_200
34     , a21 JTF_VARCHAR2_TABLE_200
35     , a22 JTF_NUMBER_TABLE
36     ) as
37     ddindx binary_integer; indx binary_integer;
38   begin
39   if a0 is not null and a0.count > 0 then
40       if a0.count > 0 then
41         indx := a0.first;
42         ddindx := 1;
43         while true loop
44           t(ddindx).srp_rollover_quota_id := a0(indx);
45           t(ddindx).srp_quota_assign_id := a1(indx);
46           t(ddindx).rollover_quota_id := a2(indx);
47           t(ddindx).quota_id := a3(indx);
48           t(ddindx).source_quota_id := a4(indx);
49           t(ddindx).rollover := a5(indx);
50           t(ddindx).attribute_category := a6(indx);
51           t(ddindx).attribute1 := a7(indx);
52           t(ddindx).attribute2 := a8(indx);
53           t(ddindx).attribute3 := a9(indx);
54           t(ddindx).attribute4 := a10(indx);
55           t(ddindx).attribute5 := a11(indx);
56           t(ddindx).attribute6 := a12(indx);
57           t(ddindx).attribute7 := a13(indx);
58           t(ddindx).attribute8 := a14(indx);
59           t(ddindx).attribute9 := a15(indx);
60           t(ddindx).attribute10 := a16(indx);
61           t(ddindx).attribute11 := a17(indx);
62           t(ddindx).attribute12 := a18(indx);
63           t(ddindx).attribute13 := a19(indx);
64           t(ddindx).attribute14 := a20(indx);
65           t(ddindx).attribute15 := a21(indx);
66           t(ddindx).object_version_number := a22(indx);
67           ddindx := ddindx+1;
68           if a0.last =indx
69             then exit;
70           end if;
71           indx := a0.next(indx);
72         end loop;
73       end if;
74    end if;
75   end rosetta_table_copy_in_p1;
76   procedure rosetta_table_copy_out_p1(t cn_srp_rollover_quota_pvt.srp_rollover_quota_tbl_type, a0 out nocopy JTF_NUMBER_TABLE
77     , a1 out nocopy JTF_NUMBER_TABLE
78     , a2 out nocopy JTF_NUMBER_TABLE
79     , a3 out nocopy JTF_NUMBER_TABLE
80     , a4 out nocopy JTF_NUMBER_TABLE
81     , a5 out nocopy JTF_NUMBER_TABLE
82     , a6 out nocopy JTF_VARCHAR2_TABLE_100
83     , a7 out nocopy JTF_VARCHAR2_TABLE_200
84     , a8 out nocopy JTF_VARCHAR2_TABLE_200
85     , a9 out nocopy JTF_VARCHAR2_TABLE_200
86     , a10 out nocopy JTF_VARCHAR2_TABLE_200
87     , a11 out nocopy JTF_VARCHAR2_TABLE_200
88     , a12 out nocopy JTF_VARCHAR2_TABLE_200
89     , a13 out nocopy JTF_VARCHAR2_TABLE_200
90     , a14 out nocopy JTF_VARCHAR2_TABLE_200
91     , a15 out nocopy JTF_VARCHAR2_TABLE_200
92     , a16 out nocopy JTF_VARCHAR2_TABLE_200
93     , a17 out nocopy JTF_VARCHAR2_TABLE_200
94     , a18 out nocopy JTF_VARCHAR2_TABLE_200
95     , a19 out nocopy JTF_VARCHAR2_TABLE_200
96     , a20 out nocopy JTF_VARCHAR2_TABLE_200
97     , a21 out nocopy JTF_VARCHAR2_TABLE_200
98     , a22 out nocopy JTF_NUMBER_TABLE
99     ) as
100     ddindx binary_integer; indx binary_integer;
101   begin
102   if t is null or t.count = 0 then
103     a0 := JTF_NUMBER_TABLE();
104     a1 := JTF_NUMBER_TABLE();
105     a2 := JTF_NUMBER_TABLE();
106     a3 := JTF_NUMBER_TABLE();
107     a4 := JTF_NUMBER_TABLE();
108     a5 := JTF_NUMBER_TABLE();
109     a6 := JTF_VARCHAR2_TABLE_100();
110     a7 := JTF_VARCHAR2_TABLE_200();
111     a8 := JTF_VARCHAR2_TABLE_200();
112     a9 := JTF_VARCHAR2_TABLE_200();
113     a10 := JTF_VARCHAR2_TABLE_200();
114     a11 := JTF_VARCHAR2_TABLE_200();
115     a12 := JTF_VARCHAR2_TABLE_200();
116     a13 := JTF_VARCHAR2_TABLE_200();
117     a14 := JTF_VARCHAR2_TABLE_200();
118     a15 := JTF_VARCHAR2_TABLE_200();
119     a16 := JTF_VARCHAR2_TABLE_200();
120     a17 := JTF_VARCHAR2_TABLE_200();
121     a18 := JTF_VARCHAR2_TABLE_200();
122     a19 := JTF_VARCHAR2_TABLE_200();
123     a20 := JTF_VARCHAR2_TABLE_200();
124     a21 := JTF_VARCHAR2_TABLE_200();
125     a22 := JTF_NUMBER_TABLE();
126   else
127       a0 := JTF_NUMBER_TABLE();
128       a1 := JTF_NUMBER_TABLE();
129       a2 := JTF_NUMBER_TABLE();
130       a3 := JTF_NUMBER_TABLE();
131       a4 := JTF_NUMBER_TABLE();
132       a5 := JTF_NUMBER_TABLE();
133       a6 := JTF_VARCHAR2_TABLE_100();
134       a7 := JTF_VARCHAR2_TABLE_200();
135       a8 := JTF_VARCHAR2_TABLE_200();
136       a9 := JTF_VARCHAR2_TABLE_200();
137       a10 := JTF_VARCHAR2_TABLE_200();
138       a11 := JTF_VARCHAR2_TABLE_200();
139       a12 := JTF_VARCHAR2_TABLE_200();
140       a13 := JTF_VARCHAR2_TABLE_200();
141       a14 := JTF_VARCHAR2_TABLE_200();
142       a15 := JTF_VARCHAR2_TABLE_200();
143       a16 := JTF_VARCHAR2_TABLE_200();
144       a17 := JTF_VARCHAR2_TABLE_200();
145       a18 := JTF_VARCHAR2_TABLE_200();
146       a19 := JTF_VARCHAR2_TABLE_200();
147       a20 := JTF_VARCHAR2_TABLE_200();
148       a21 := JTF_VARCHAR2_TABLE_200();
149       a22 := JTF_NUMBER_TABLE();
150       if t.count > 0 then
151         a0.extend(t.count);
152         a1.extend(t.count);
153         a2.extend(t.count);
154         a3.extend(t.count);
155         a4.extend(t.count);
156         a5.extend(t.count);
157         a6.extend(t.count);
158         a7.extend(t.count);
159         a8.extend(t.count);
160         a9.extend(t.count);
161         a10.extend(t.count);
162         a11.extend(t.count);
163         a12.extend(t.count);
164         a13.extend(t.count);
165         a14.extend(t.count);
166         a15.extend(t.count);
167         a16.extend(t.count);
168         a17.extend(t.count);
169         a18.extend(t.count);
170         a19.extend(t.count);
171         a20.extend(t.count);
172         a21.extend(t.count);
173         a22.extend(t.count);
174         ddindx := t.first;
175         indx := 1;
176         while true loop
177           a0(indx) := t(ddindx).srp_rollover_quota_id;
178           a1(indx) := t(ddindx).srp_quota_assign_id;
179           a2(indx) := t(ddindx).rollover_quota_id;
180           a3(indx) := t(ddindx).quota_id;
181           a4(indx) := t(ddindx).source_quota_id;
182           a5(indx) := t(ddindx).rollover;
183           a6(indx) := t(ddindx).attribute_category;
184           a7(indx) := t(ddindx).attribute1;
185           a8(indx) := t(ddindx).attribute2;
186           a9(indx) := t(ddindx).attribute3;
187           a10(indx) := t(ddindx).attribute4;
188           a11(indx) := t(ddindx).attribute5;
189           a12(indx) := t(ddindx).attribute6;
190           a13(indx) := t(ddindx).attribute7;
191           a14(indx) := t(ddindx).attribute8;
192           a15(indx) := t(ddindx).attribute9;
193           a16(indx) := t(ddindx).attribute10;
194           a17(indx) := t(ddindx).attribute11;
195           a18(indx) := t(ddindx).attribute12;
196           a19(indx) := t(ddindx).attribute13;
197           a20(indx) := t(ddindx).attribute14;
198           a21(indx) := t(ddindx).attribute15;
199           a22(indx) := t(ddindx).object_version_number;
200           indx := indx+1;
201           if t.last =ddindx
202             then exit;
203           end if;
204           ddindx := t.next(ddindx);
205         end loop;
206       end if;
207    end if;
208   end rosetta_table_copy_out_p1;
209 
210   procedure update_srp_rollover_quota(p_api_version  NUMBER
211     , p_init_msg_list  VARCHAR2
212     , p_commit  VARCHAR2
213     , p_validation_level  NUMBER
214     , p4_a0  NUMBER
215     , p4_a1  NUMBER
216     , p4_a2  NUMBER
217     , p4_a3  NUMBER
218     , p4_a4  NUMBER
219     , p4_a5  NUMBER
220     , p4_a6  VARCHAR2
221     , p4_a7  VARCHAR2
222     , p4_a8  VARCHAR2
223     , p4_a9  VARCHAR2
224     , p4_a10  VARCHAR2
225     , p4_a11  VARCHAR2
226     , p4_a12  VARCHAR2
227     , p4_a13  VARCHAR2
228     , p4_a14  VARCHAR2
229     , p4_a15  VARCHAR2
230     , p4_a16  VARCHAR2
231     , p4_a17  VARCHAR2
232     , p4_a18  VARCHAR2
233     , p4_a19  VARCHAR2
234     , p4_a20  VARCHAR2
235     , p4_a21  VARCHAR2
236     , p4_a22  NUMBER
237     , x_return_status out nocopy  VARCHAR2
238     , x_msg_count out nocopy  NUMBER
239     , x_msg_data out nocopy  VARCHAR2
240   )
241 
242   as
243     ddp_srp_rollover_quota cn_srp_rollover_quota_pvt.srp_rollover_quota_rec_type;
244     ddindx binary_integer; indx binary_integer;
245   begin
246 
247     -- copy data to the local IN or IN-OUT args, if any
248 
249 
250 
251 
252     ddp_srp_rollover_quota.srp_rollover_quota_id := p4_a0;
253     ddp_srp_rollover_quota.srp_quota_assign_id := p4_a1;
254     ddp_srp_rollover_quota.rollover_quota_id := p4_a2;
255     ddp_srp_rollover_quota.quota_id := p4_a3;
256     ddp_srp_rollover_quota.source_quota_id := p4_a4;
257     ddp_srp_rollover_quota.rollover := p4_a5;
258     ddp_srp_rollover_quota.attribute_category := p4_a6;
259     ddp_srp_rollover_quota.attribute1 := p4_a7;
260     ddp_srp_rollover_quota.attribute2 := p4_a8;
261     ddp_srp_rollover_quota.attribute3 := p4_a9;
262     ddp_srp_rollover_quota.attribute4 := p4_a10;
263     ddp_srp_rollover_quota.attribute5 := p4_a11;
264     ddp_srp_rollover_quota.attribute6 := p4_a12;
265     ddp_srp_rollover_quota.attribute7 := p4_a13;
266     ddp_srp_rollover_quota.attribute8 := p4_a14;
267     ddp_srp_rollover_quota.attribute9 := p4_a15;
268     ddp_srp_rollover_quota.attribute10 := p4_a16;
269     ddp_srp_rollover_quota.attribute11 := p4_a17;
270     ddp_srp_rollover_quota.attribute12 := p4_a18;
271     ddp_srp_rollover_quota.attribute13 := p4_a19;
272     ddp_srp_rollover_quota.attribute14 := p4_a20;
273     ddp_srp_rollover_quota.attribute15 := p4_a21;
274     ddp_srp_rollover_quota.object_version_number := p4_a22;
275 
276 
277 
278 
279     -- here's the delegated call to the old PL/SQL routine
280     cn_srp_rollover_quota_pvt.update_srp_rollover_quota(p_api_version,
281       p_init_msg_list,
282       p_commit,
283       p_validation_level,
284       ddp_srp_rollover_quota,
285       x_return_status,
286       x_msg_count,
287       x_msg_data);
288 
289     -- copy data back from the local variables to OUT or IN-OUT args, if any
290 
291 
292 
293 
294 
295 
296 
297   end;
298 
299 end cn_srp_rollover_quota_pvt_w;