DBA Data[Home] [Help]

PACKAGE BODY: APPS.CN_IMPORT_PVT_W

Source


1 package body cn_import_pvt_w as
2   /* $Header: cnwimps.pls 120.3 2005/09/14 03:39 vensrini 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 cn_import_pvt.char_data_set_type, a0 JTF_VARCHAR2_TABLE_2000) 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 cn_import_pvt.char_data_set_type, a0 out nocopy JTF_VARCHAR2_TABLE_2000) as
32     ddindx binary_integer; indx binary_integer;
33   begin
34   if t is null or t.count = 0 then
35     a0 := JTF_VARCHAR2_TABLE_2000();
36   else
37       a0 := JTF_VARCHAR2_TABLE_2000();
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   procedure rosetta_table_copy_in_p1(t out nocopy cn_import_pvt.num_data_set_type, a0 JTF_NUMBER_TABLE) as
55     ddindx binary_integer; indx binary_integer;
56   begin
57   if a0 is not null and a0.count > 0 then
58       if a0.count > 0 then
59         indx := a0.first;
60         ddindx := 1;
61         while true loop
62           t(ddindx) := a0(indx);
63           ddindx := ddindx+1;
64           if a0.last =indx
65             then exit;
66           end if;
67           indx := a0.next(indx);
68         end loop;
69       end if;
70    end if;
71   end rosetta_table_copy_in_p1;
72   procedure rosetta_table_copy_out_p1(t cn_import_pvt.num_data_set_type, a0 out nocopy JTF_NUMBER_TABLE) as
73     ddindx binary_integer; indx binary_integer;
74   begin
75   if t is null or t.count = 0 then
76     a0 := JTF_NUMBER_TABLE();
77   else
78       a0 := JTF_NUMBER_TABLE();
79       if t.count > 0 then
80         a0.extend(t.count);
81         ddindx := t.first;
82         indx := 1;
83         while true loop
84           a0(indx) := t(ddindx);
85           indx := indx+1;
86           if t.last =ddindx
87             then exit;
88           end if;
89           ddindx := t.next(ddindx);
90         end loop;
91       end if;
92    end if;
93   end rosetta_table_copy_out_p1;
94 
95   procedure client_stage_data(p_api_version  NUMBER
96     , p_init_msg_list  VARCHAR2
97     , p_commit  VARCHAR2
98     , p_validation_level  NUMBER
99     , x_return_status out nocopy  VARCHAR2
100     , x_msg_count out nocopy  NUMBER
101     , x_msg_data out nocopy  VARCHAR2
102     , p_imp_header_id  NUMBER
103     , p_data JTF_VARCHAR2_TABLE_2000
104     , p_row_count  NUMBER
105     , p_map_obj_ver  NUMBER
106     , p_org_id  NUMBER
107   )
108 
109   as
110     ddp_data cn_import_pvt.char_data_set_type;
111     ddindx binary_integer; indx binary_integer;
112   begin
113 
114     -- copy data to the local IN or IN-OUT args, if any
115 
116 
117 
118 
119 
120 
121 
122 
123     cn_import_pvt_w.rosetta_table_copy_in_p0(ddp_data, p_data);
124 
125 
126 
127 
128     -- here's the delegated call to the old PL/SQL routine
129     cn_import_pvt.client_stage_data(p_api_version,
130       p_init_msg_list,
131       p_commit,
132       p_validation_level,
133       x_return_status,
134       x_msg_count,
135       x_msg_data,
136       p_imp_header_id,
137       ddp_data,
138       p_row_count,
139       p_map_obj_ver,
140       p_org_id);
141 
142     -- copy data back from the local variables to OUT or IN-OUT args, if any
143 
144 
145 
146 
147 
148 
149 
150 
151 
152 
153 
154   end;
155 
156 end cn_import_pvt_w;