[Home] [Help]
PACKAGE BODY: APPS.IBY_RISKYINSTR_PKG_WRAP
Source
1 package body iby_riskyinstr_pkg_wrap as
2 /*$Header: ibyrkwrb.pls 115.4 2002/11/20 00:00:26 jleybovi ship $*/
3
4 procedure add_riskyinstr(i_count integer,
5 i_riskyinstr_payeeid JTF_VARCHAR2_TABLE_100,
6 i_riskyinstr_instrtype JTF_VARCHAR2_TABLE_100,
7 i_riskyinstr_routing_num JTF_VARCHAR2_TABLE_100,
8 i_riskyinstr_account_num JTF_VARCHAR2_TABLE_100,
9 i_riskyinstr_creditcard_num JTF_VARCHAR2_TABLE_100,
10 o_results_success out nocopy JTF_NUMBER_TABLE,
11 o_results_errmsg out nocopy JTF_VARCHAR2_TABLE_100)
12
13 is
14
15 ddi_riskyinstr iby_riskyinstr_pkg.riskyinstr_table;
16 ddo_results iby_riskyinstr_pkg.result_table;
17 ddindx binary_integer;
18 indx binary_integer;
19
20 begin
21
22 -- copy data to the local IN or IN-OUT args, if any
23
24 if i_riskyinstr_payeeid is not null and i_riskyinstr_payeeid.count > 0 then
25 if i_riskyinstr_payeeid.count > 0 then
26 indx := i_riskyinstr_payeeid.first;
27 ddindx := 1;
28 while true loop
29 ddi_riskyinstr(ddindx).payeeid := i_riskyinstr_payeeid(indx);
30 ddi_riskyinstr(ddindx).instrtype := i_riskyinstr_instrtype(indx);
31 ddi_riskyinstr(ddindx).routing_num := i_riskyinstr_routing_num(indx);
32 ddi_riskyinstr(ddindx).account_num := i_riskyinstr_account_num(indx);
33 ddi_riskyinstr(ddindx).creditcard_num := i_riskyinstr_creditcard_num(indx);
34 ddindx := ddindx+1;
35 if i_riskyinstr_payeeid.last =indx
36 then exit;
37 end if;
38 indx := i_riskyinstr_payeeid.next(indx);
39 end loop;
40 end if;
41 end if;
42
43
44 -- here's the delegated call to the old PL/SQL routine
45 iby_riskyinstr_pkg.add_riskyinstr(i_count,
46 ddi_riskyinstr,
47 ddo_results);
48
49 -- copy data back from the local OUT or IN-OUT args, if any
50
51
52 if ddo_results is null or ddo_results.count = 0 then
53 o_results_success := JTF_NUMBER_TABLE();
54 o_results_errmsg := JTF_VARCHAR2_TABLE_100();
55 else
56 o_results_success := JTF_NUMBER_TABLE();
57 o_results_errmsg := JTF_VARCHAR2_TABLE_100();
58 if ddo_results.count > 0 then
59 o_results_success.extend(ddo_results.count);
60 o_results_errmsg.extend(ddo_results.count);
61 ddindx := ddo_results.first;
62 indx := 1;
63 while true loop
64 o_results_success(indx) := ddo_results(ddindx).success;
65 o_results_errmsg(indx) := ddo_results(ddindx).errmsg;
66 indx := indx+1;
67 if ddo_results.last =ddindx
68 then exit;
69 end if;
70 ddindx := ddo_results.next(ddindx);
71 end loop;
72 end if;
73 end if;
74 end;
75
76 procedure delete_riskyinstr(i_count integer,
77 i_riskyinstr_payeeid JTF_VARCHAR2_TABLE_100,
78 i_riskyinstr_instrtype JTF_VARCHAR2_TABLE_100,
79 i_riskyinstr_routing_num JTF_VARCHAR2_TABLE_100,
80 i_riskyinstr_account_num JTF_VARCHAR2_TABLE_100,
81 i_riskyinstr_creditcard_num JTF_VARCHAR2_TABLE_100,
82 o_results_success out nocopy JTF_NUMBER_TABLE,
83 o_results_errmsg out nocopy JTF_VARCHAR2_TABLE_100)
84
85 is
86 ddi_riskyinstr iby_riskyinstr_pkg.riskyinstr_table;
87 ddo_results iby_riskyinstr_pkg.result_table;
88 ddindx binary_integer; indx binary_integer;
89 begin
90
91 -- copy data to the local IN or IN-OUT args, if any
92
93 if i_riskyinstr_payeeid is not null and i_riskyinstr_payeeid.count > 0 then
94 if i_riskyinstr_payeeid.count > 0 then
95 indx := i_riskyinstr_payeeid.first;
96 ddindx := 1;
97 while true loop
98 ddi_riskyinstr(ddindx).payeeid := i_riskyinstr_payeeid(indx);
99 ddi_riskyinstr(ddindx).instrtype := i_riskyinstr_instrtype(indx);
100 ddi_riskyinstr(ddindx).routing_num := i_riskyinstr_routing_num(indx);
101 ddi_riskyinstr(ddindx).account_num := i_riskyinstr_account_num(indx);
102 ddi_riskyinstr(ddindx).creditcard_num := i_riskyinstr_creditcard_num(indx);
103 ddindx := ddindx+1;
104 if i_riskyinstr_payeeid.last =indx
105 then exit;
106 end if;
107 indx := i_riskyinstr_payeeid.next(indx);
108 end loop;
109 end if;
110 end if;
111
112
113 -- here's the delegated call to the old PL/SQL routine
114 iby_riskyinstr_pkg.delete_riskyinstr(i_count,
115 ddi_riskyinstr,
116 ddo_results);
117
118 -- copy data back from the local OUT or IN-OUT args, if any
119
120
121 if ddo_results is null or ddo_results.count = 0 then
122 o_results_success := JTF_NUMBER_TABLE();
123 o_results_errmsg := JTF_VARCHAR2_TABLE_100();
124 else
125 o_results_success := JTF_NUMBER_TABLE();
126 o_results_errmsg := JTF_VARCHAR2_TABLE_100();
127 if ddo_results.count > 0 then
128 o_results_success.extend(ddo_results.count);
129 o_results_errmsg.extend(ddo_results.count);
130 ddindx := ddo_results.first;
131 indx := 1;
132 while true loop
133 o_results_success(indx) := ddo_results(ddindx).success;
134 o_results_errmsg(indx) := ddo_results(ddindx).errmsg;
135 indx := indx+1;
136 if ddo_results.last =ddindx
137 then exit;
138 end if;
139 ddindx := ddo_results.next(ddindx);
140 end loop;
141 end if;
142 end if;
143 end;
144
145 end iby_riskyinstr_pkg_wrap;