1 package body pv_enty_attr_value_pub_w as
2 /* $Header: pvxwavpb.pls 120.2 2005/11/11 15:27 amaram 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 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_p2(t out nocopy pv_enty_attr_value_pub.attr_value_tbl_type, a0 JTF_VARCHAR2_TABLE_2000
23 , a1 JTF_VARCHAR2_TABLE_4000
24 ) as
25 ddindx binary_integer; indx binary_integer;
26 begin
27 if a0 is not null and a0.count > 0 then
28 if a0.count > 0 then
29 indx := a0.first;
30 ddindx := 1;
31 while true loop
32 t(ddindx).attr_value := a0(indx);
33 t(ddindx).attr_value_extn := a1(indx);
34 ddindx := ddindx+1;
35 if a0.last =indx
36 then exit;
37 end if;
38 indx := a0.next(indx);
39 end loop;
40 end if;
41 end if;
42 end rosetta_table_copy_in_p2;
43 procedure rosetta_table_copy_out_p2(t pv_enty_attr_value_pub.attr_value_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_2000
44 , a1 out nocopy JTF_VARCHAR2_TABLE_4000
45 ) as
46 ddindx binary_integer; indx binary_integer;
47 begin
48 if t is null or t.count = 0 then
49 a0 := JTF_VARCHAR2_TABLE_2000();
50 a1 := JTF_VARCHAR2_TABLE_4000();
51 else
52 a0 := JTF_VARCHAR2_TABLE_2000();
53 a1 := JTF_VARCHAR2_TABLE_4000();
54 if t.count > 0 then
55 a0.extend(t.count);
56 a1.extend(t.count);
57 ddindx := t.first;
58 indx := 1;
59 while true loop
60 a0(indx) := t(ddindx).attr_value;
61 a1(indx) := t(ddindx).attr_value_extn;
62 indx := indx+1;
63 if t.last =ddindx
64 then exit;
65 end if;
66 ddindx := t.next(ddindx);
67 end loop;
68 end if;
69 end if;
70 end rosetta_table_copy_out_p2;
71
72 procedure rosetta_table_copy_in_p4(t out nocopy pv_enty_attr_value_pub.number_table, a0 JTF_NUMBER_TABLE) as
73 ddindx binary_integer; indx binary_integer;
74 begin
75 if a0 is null then
76 t := null;
77 elsif a0.count = 0 then
78 t := pv_enty_attr_value_pub.number_table();
79 else
80 if a0.count > 0 then
81 t := pv_enty_attr_value_pub.number_table();
82 t.extend(a0.count);
83 indx := a0.first;
84 ddindx := 1;
85 while true loop
86 t(ddindx) := rosetta_g_miss_num_map(a0(indx));
87 ddindx := ddindx+1;
88 if a0.last =indx
89 then exit;
90 end if;
91 indx := a0.next(indx);
92 end loop;
93 end if;
94 end if;
95 end rosetta_table_copy_in_p4;
96 procedure rosetta_table_copy_out_p4(t pv_enty_attr_value_pub.number_table, a0 out nocopy JTF_NUMBER_TABLE) as
97 ddindx binary_integer; indx binary_integer;
98 begin
99 if t is null then
100 a0 := null;
101 elsif t.count = 0 then
102 a0 := JTF_NUMBER_TABLE();
103 else
104 a0 := JTF_NUMBER_TABLE();
105 if t.count > 0 then
106 a0.extend(t.count);
107 ddindx := t.first;
108 indx := 1;
109 while true loop
110 a0(indx) := rosetta_g_miss_num_map(t(ddindx));
111 indx := indx+1;
112 if t.last =ddindx
113 then exit;
114 end if;
115 ddindx := t.next(ddindx);
116 end loop;
117 end if;
118 end if;
119 end rosetta_table_copy_out_p4;
120
121 procedure upsert_attr_value(p_api_version_number NUMBER
122 , p_init_msg_list VARCHAR2
123 , p_commit VARCHAR2
124 , p_validation_level NUMBER
125 , x_return_status out nocopy VARCHAR2
126 , x_msg_count out nocopy NUMBER
127 , x_msg_data out nocopy VARCHAR2
128 , p_attribute_id NUMBER
129 , p_entity VARCHAR2
130 , p_entity_id NUMBER
131 , p_version NUMBER
132 , p11_a0 JTF_VARCHAR2_TABLE_2000
133 , p11_a1 JTF_VARCHAR2_TABLE_4000
134 )
135
136 as
137 ddp_attr_val_tbl pv_enty_attr_value_pub.attr_value_tbl_type;
138 ddindx binary_integer; indx binary_integer;
139 begin
140
141 -- copy data to the local IN or IN-OUT args, if any
142
143
144
145
146
147
148
149
150
151
152
153 pv_enty_attr_value_pub_w.rosetta_table_copy_in_p2(ddp_attr_val_tbl, p11_a0
154 , p11_a1
155 );
156
157 -- here's the delegated call to the old PL/SQL routine
158 pv_enty_attr_value_pub.upsert_attr_value(p_api_version_number,
159 p_init_msg_list,
160 p_commit,
161 p_validation_level,
162 x_return_status,
163 x_msg_count,
164 x_msg_data,
165 p_attribute_id,
166 p_entity,
167 p_entity_id,
168 p_version,
169 ddp_attr_val_tbl);
170
171 -- copy data back from the local variables to OUT or IN-OUT args, if any
172
173
174
175
176
177
178
179
180
181
182
183 end;
184
185 procedure copy_partner_attr_values(p_api_version_number NUMBER
186 , p_init_msg_list VARCHAR2
187 , p_commit VARCHAR2
188 , p_validation_level NUMBER
189 , x_return_status out nocopy VARCHAR2
190 , x_msg_count out nocopy NUMBER
191 , x_msg_data out nocopy VARCHAR2
192 , p_attr_id_tbl JTF_NUMBER_TABLE
193 , p_entity VARCHAR2
194 , p_entity_id NUMBER
195 , p_partner_id NUMBER
196 )
197
198 as
199 ddp_attr_id_tbl pv_enty_attr_value_pub.number_table;
200 ddindx binary_integer; indx binary_integer;
201 begin
202
203 -- copy data to the local IN or IN-OUT args, if any
204
205
206
207
208
209
210
211 pv_enty_attr_value_pub_w.rosetta_table_copy_in_p4(ddp_attr_id_tbl, p_attr_id_tbl);
212
213
214
215
216 -- here's the delegated call to the old PL/SQL routine
217 pv_enty_attr_value_pub.copy_partner_attr_values(p_api_version_number,
218 p_init_msg_list,
219 p_commit,
220 p_validation_level,
221 x_return_status,
222 x_msg_count,
223 x_msg_data,
224 ddp_attr_id_tbl,
225 p_entity,
226 p_entity_id,
227 p_partner_id);
228
229 -- copy data back from the local variables to OUT or IN-OUT args, if any
230
231
232
233
234
235
236
237
238
239
240 end;
241
242 procedure upsert_partner_types(p_api_version_number NUMBER
243 , p_init_msg_list VARCHAR2
244 , p_commit VARCHAR2
245 , p_validation_level NUMBER
246 , x_return_status out nocopy VARCHAR2
247 , x_msg_count out nocopy NUMBER
248 , x_msg_data out nocopy VARCHAR2
249 , p_entity_id NUMBER
250 , p_version NUMBER
251 , p9_a0 JTF_VARCHAR2_TABLE_2000
252 , p9_a1 JTF_VARCHAR2_TABLE_4000
253 )
254
255 as
256 ddp_attr_val_tbl pv_enty_attr_value_pub.attr_value_tbl_type;
257 ddindx binary_integer; indx binary_integer;
258 begin
259
260 -- copy data to the local IN or IN-OUT args, if any
261
262
263
264
265
266
267
268
269
270 pv_enty_attr_value_pub_w.rosetta_table_copy_in_p2(ddp_attr_val_tbl, p9_a0
271 , p9_a1
272 );
273
274 -- here's the delegated call to the old PL/SQL routine
275 pv_enty_attr_value_pub.upsert_partner_types(p_api_version_number,
276 p_init_msg_list,
277 p_commit,
278 p_validation_level,
279 x_return_status,
280 x_msg_count,
281 x_msg_data,
282 p_entity_id,
283 p_version,
284 ddp_attr_val_tbl);
285
286 -- copy data back from the local variables to OUT or IN-OUT args, if any
287
288
289
290
291
292
293
294
295
296 end;
297
298 end pv_enty_attr_value_pub_w;