[Home] [Help]
PACKAGE BODY: APPS.AS_UTILITY_PUB_W
Source
1 package body as_utility_pub_w as
2 /* $Header: asxwutlb.pls 120.1 2005/11/28 02:29 sumahali 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_p6(t out nocopy as_utility_pub.profile_tbl_type, a0 JTF_VARCHAR2_TABLE_100
23 , a1 JTF_VARCHAR2_TABLE_300
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).profile_name := a0(indx);
33 t(ddindx).profile_value := 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_p6;
43 procedure rosetta_table_copy_out_p6(t as_utility_pub.profile_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_100
44 , a1 out nocopy JTF_VARCHAR2_TABLE_300
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_100();
50 a1 := JTF_VARCHAR2_TABLE_300();
51 else
52 a0 := JTF_VARCHAR2_TABLE_100();
53 a1 := JTF_VARCHAR2_TABLE_300();
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).profile_name;
61 a1(indx) := t(ddindx).profile_value;
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_p6;
71
72 procedure rosetta_table_copy_in_p10(t out nocopy as_utility_pub.item_property_tbl_type, a0 JTF_VARCHAR2_TABLE_100
73 , a1 JTF_VARCHAR2_TABLE_100
74 , a2 JTF_VARCHAR2_TABLE_100
75 , a3 JTF_VARCHAR2_TABLE_400
76 , a4 JTF_NUMBER_TABLE
77 , a5 JTF_DATE_TABLE
78 ) as
79 ddindx binary_integer; indx binary_integer;
80 begin
81 if a0 is not null and a0.count > 0 then
82 if a0.count > 0 then
83 indx := a0.first;
84 ddindx := 1;
85 while true loop
86 t(ddindx).column_name := a0(indx);
87 t(ddindx).required_flag := a1(indx);
88 t(ddindx).alterable_flag := a2(indx);
89 t(ddindx).default_char_val := a3(indx);
90 t(ddindx).default_num_val := rosetta_g_miss_num_map(a4(indx));
91 t(ddindx).default_date_val := rosetta_g_miss_date_in_map(a5(indx));
92 ddindx := ddindx+1;
93 if a0.last =indx
94 then exit;
95 end if;
96 indx := a0.next(indx);
97 end loop;
98 end if;
99 end if;
100 end rosetta_table_copy_in_p10;
101 procedure rosetta_table_copy_out_p10(t as_utility_pub.item_property_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_100
102 , a1 out nocopy JTF_VARCHAR2_TABLE_100
103 , a2 out nocopy JTF_VARCHAR2_TABLE_100
104 , a3 out nocopy JTF_VARCHAR2_TABLE_400
105 , a4 out nocopy JTF_NUMBER_TABLE
106 , a5 out nocopy JTF_DATE_TABLE
107 ) as
108 ddindx binary_integer; indx binary_integer;
109 begin
110 if t is null or t.count = 0 then
111 a0 := JTF_VARCHAR2_TABLE_100();
112 a1 := JTF_VARCHAR2_TABLE_100();
113 a2 := JTF_VARCHAR2_TABLE_100();
114 a3 := JTF_VARCHAR2_TABLE_400();
115 a4 := JTF_NUMBER_TABLE();
116 a5 := JTF_DATE_TABLE();
117 else
118 a0 := JTF_VARCHAR2_TABLE_100();
119 a1 := JTF_VARCHAR2_TABLE_100();
120 a2 := JTF_VARCHAR2_TABLE_100();
121 a3 := JTF_VARCHAR2_TABLE_400();
122 a4 := JTF_NUMBER_TABLE();
123 a5 := JTF_DATE_TABLE();
124 if t.count > 0 then
125 a0.extend(t.count);
126 a1.extend(t.count);
127 a2.extend(t.count);
128 a3.extend(t.count);
129 a4.extend(t.count);
130 a5.extend(t.count);
131 ddindx := t.first;
132 indx := 1;
133 while true loop
134 a0(indx) := t(ddindx).column_name;
135 a1(indx) := t(ddindx).required_flag;
136 a2(indx) := t(ddindx).alterable_flag;
137 a3(indx) := t(ddindx).default_char_val;
138 a4(indx) := rosetta_g_miss_num_map(t(ddindx).default_num_val);
139 a5(indx) := t(ddindx).default_date_val;
140 indx := indx+1;
141 if t.last =ddindx
142 then exit;
143 end if;
144 ddindx := t.next(ddindx);
145 end loop;
146 end if;
147 end if;
148 end rosetta_table_copy_out_p10;
149
150 end as_utility_pub_w;