DBA Data[Home] [Help]

PACKAGE BODY: APPS.AMS_LIST_SRC_MAPPING_W

Source


1 package body ams_list_src_mapping_w as
2   /* $Header: amswlsrb.pls 120.1 2006/01/12 22:09 rmbhanda 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_p1(t out nocopy ams_list_src_mapping.l_tbl_type, a0 JTF_VARCHAR2_TABLE_1000) as
23     ddindx binary_integer; indx binary_integer;
24   begin
25   if a0 is not null and a0.count > 0 then
26       if a0.count > 0 then
27         indx := a0.first;
28         ddindx := 1;
29         while true loop
30           t(ddindx) := a0(indx);
31           ddindx := ddindx+1;
32           if a0.last =indx
33             then exit;
34           end if;
35           indx := a0.next(indx);
36         end loop;
37       end if;
38    end if;
39   end rosetta_table_copy_in_p1;
40   procedure rosetta_table_copy_out_p1(t ams_list_src_mapping.l_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_1000) as
41     ddindx binary_integer; indx binary_integer;
42   begin
43   if t is null or t.count = 0 then
44     a0 := JTF_VARCHAR2_TABLE_1000();
45   else
46       a0 := JTF_VARCHAR2_TABLE_1000();
47       if t.count > 0 then
48         a0.extend(t.count);
49         ddindx := t.first;
50         indx := 1;
51         while true loop
52           a0(indx) := t(ddindx);
53           indx := indx+1;
54           if t.last =ddindx
55             then exit;
56           end if;
57           ddindx := t.next(ddindx);
58         end loop;
59       end if;
60    end if;
61   end rosetta_table_copy_out_p1;
62 
63   procedure create_mapping(p_api_version  NUMBER
64     , p_init_msg_list  VARCHAR2
65     , p_commit  VARCHAR2
66     , p_validation_level  NUMBER
67     , x_return_status out nocopy  VARCHAR2
68     , x_msg_count out nocopy  NUMBER
69     , x_msg_data out nocopy  VARCHAR2
70     , p_imp_list_header_id  NUMBER
71     , p_source_name  VARCHAR2
72     , p_table_name  VARCHAR2
73     , p_list_src_fields JTF_VARCHAR2_TABLE_1000
74     , p_list_target_fields JTF_VARCHAR2_TABLE_1000
75     , px_src_type_id in out nocopy  NUMBER
76   )
77 
78   as
79     ddp_list_src_fields ams_list_src_mapping.l_tbl_type;
80     ddp_list_target_fields ams_list_src_mapping.l_tbl_type;
81     ddindx binary_integer; indx binary_integer;
82   begin
83 
84     -- copy data to the local IN or IN-OUT args, if any
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95     ams_list_src_mapping_w.rosetta_table_copy_in_p1(ddp_list_src_fields, p_list_src_fields);
96 
97     ams_list_src_mapping_w.rosetta_table_copy_in_p1(ddp_list_target_fields, p_list_target_fields);
98 
99 
100     -- here's the delegated call to the old PL/SQL routine
101     ams_list_src_mapping.create_mapping(p_api_version,
102       p_init_msg_list,
103       p_commit,
104       p_validation_level,
105       x_return_status,
106       x_msg_count,
107       x_msg_data,
108       p_imp_list_header_id,
109       p_source_name,
110       p_table_name,
111       ddp_list_src_fields,
112       ddp_list_target_fields,
113       px_src_type_id);
114 
115     -- copy data back from the local variables to OUT or IN-OUT args, if any
116 
117 
118 
119 
120 
121 
122 
123 
124 
125 
126 
127 
128   end;
129 
130 end ams_list_src_mapping_w;