1 package body ams_iba_segments_pub_w as
2 /* $Header: ibatsegb.pls 115.3 2000/03/07 13:53:02 pkm ship $ */
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 function rosetta_g_miss_num_map(n number) return number as
7 a number := fnd_api.g_miss_num;
8 b number := 0-1962.0724;
9 begin
10 if n=a then return b; end if;
11 if n=b then return a; end if;
12 return n;
13 end;
14
15 -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
16 function rosetta_g_miss_date_in_map(d date) return date as
17 begin
18 if d = rosetta_g_mistake_date then return fnd_api.g_miss_date; end if;
19 return d;
20 end;
21
22 procedure rosetta_table_copy_in_p1(t out ams_mkt_segments_pvt.partymktsegtabtyp, a0 JTF_NUMBER_TABLE
23 , a1 JTF_NUMBER_TABLE
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).target_segment_id := rosetta_g_miss_num_map(a0(indx));
33 t(ddindx).campaign_id := rosetta_g_miss_num_map(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_p1;
43 procedure rosetta_table_copy_out_p1(t ams_mkt_segments_pvt.partymktsegtabtyp, a0 out JTF_NUMBER_TABLE
44 , a1 out JTF_NUMBER_TABLE
45 ) as
46 ddindx binary_integer; indx binary_integer;
47 begin
48 if t is null or t.count = 0 then
49 a0 := JTF_NUMBER_TABLE();
50 a1 := JTF_NUMBER_TABLE();
51 else
52 a0 := JTF_NUMBER_TABLE();
53 a1 := JTF_NUMBER_TABLE();
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) := rosetta_g_miss_num_map(t(ddindx).target_segment_id);
61 a1(indx) := rosetta_g_miss_num_map(t(ddindx).campaign_id);
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_p1;
71 procedure get_mkt_segments_w(p_party_id NUMBER
72 , p_target_segment_id NUMBER
73 , p2_a0 out JTF_NUMBER_TABLE
74 , p2_a1 out JTF_NUMBER_TABLE
75 )
76 as
77 ddp_segtabtyp ams_mkt_segments_pvt.partymktsegtabtyp;
78 ddindx binary_integer; indx binary_integer;
79 begin
80
81 -- copy data to the local IN or IN-OUT args, if any
82
83
84
85 -- here's the delegated call to the old PL/SQL routine
86 ams_iba_segments_pub.get_mkt_segments_w(p_party_id,
87 p_target_segment_id,
88 ddp_segtabtyp);
89
90 -- copy data back from the local OUT or IN-OUT args, if any
91
92
93 rosetta_table_copy_out_p1(ddp_segtabtyp, p2_a0
94 , p2_a1
95 );
96 end;
97
98 end ams_iba_segments_pub_w;