DBA Data[Home] [Help]

PACKAGE BODY: APPS.FTP_BR_RATE_INDEX_PVT

Source


1 PACKAGE BODY FTP_BR_RATE_INDEX_PVT AS
2 /* $Header: ftpbrrib.pls 120.1 2006/05/17 21:51:19 appldev noship $ */
3 
4 --------------------------------------------------------------------------------
5 -- PRIVATE CONSTANTS
6 --------------------------------------------------------------------------------
7 G_PKG_NAME constant varchar2(30) := 'FTP_BR_RATE_INDEX_PVT';
8 --------------------------------------------------------------------------------
9 -- PRIVATE SPECIFICATIONS
10 --------------------------------------------------------------------------------
11 PROCEDURE DeleteRateIndexRuleRec(
12   p_obj_def_id          in          number
13 );
14 PROCEDURE DeleteRIValuationCurveRecs(
15   p_obj_def_id          in          number
16 );
17 PROCEDURE CopyRateIndexRuleRec(
18   p_source_obj_def_id   in          number
19   ,p_target_obj_def_id  in          number
20   ,p_created_by         in          number
21   ,p_creation_date      in          date
22 );
23 PROCEDURE CopyRiValuationCurveRecs(
24   p_source_obj_def_id   in          number
25   ,p_target_obj_def_id  in          number
26   ,p_created_by         in          number
27   ,p_creation_date      in          date
28 );
29 --------------------------------------------------------------------------------
30 -- PUBLIC BODIES
31 --------------------------------------------------------------------------------
32 --
33 -- PROCEDURE
34 --       DeleteObjectDefinition
35 --
36 -- DESCRIPTION
37 --   Deletes all the details records of a Rate Index  Rule Definition.
38 --
39 -- IN
40 --   p_obj_def_id    - Object Definition ID.
41 --
42 --------------------------------------------------------------------------------
43 PROCEDURE DeleteObjectDefinition(
44   p_obj_def_id          in          number
45 )
46 --------------------------------------------------------------------------------
47 IS
48   g_api_name    constant varchar2(30)   := 'DeleteObjectDefinition';
49 BEGIN
50   DeleteRIValuationCurveRecs(
51     p_obj_def_id     => p_obj_def_id
52   );
53   DeleteRateIndexRuleRec(
54     p_obj_def_id     => p_obj_def_id
55   );
56 EXCEPTION
57   when others then
58     FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, g_api_name);
59     raise FND_API.G_EXC_UNEXPECTED_ERROR;
60 END DeleteObjectDefinition;
61 --
62 -- PROCEDURE
63 --       CopyObjectDefinition
64 --
65 -- DESCRIPTION
66 --   Creates all the detail records of a new Rate Index Rule Definition (target)
67 --   by copying the detail records of another Rate Index Rule Definition (source).
68 --
69 -- IN
70 --   p_source_obj_def_id    - Source Object Definition ID.
71 --   p_target_obj_def_id    - Target Object Definition ID.
72 --   p_created_by           - FND User ID (optional).
73 --   p_creation_date        - System Date (optional).
74 --
75 --------------------------------------------------------------------------------
76 PROCEDURE CopyObjectDefinition(
77   p_source_obj_def_id   in          number
78   ,p_target_obj_def_id  in          number
79   ,p_created_by         in          number
80   ,p_creation_date      in          date
81 )
82 --------------------------------------------------------------------------------
83 IS
84   g_api_name    constant varchar2(30)   := 'CopyObjectDefinition';
85 BEGIN
86   CopyRateIndexRuleRec(
87     p_source_obj_def_id   => p_source_obj_def_id
88     ,p_target_obj_def_id  => p_target_obj_def_id
89     ,p_created_by         => p_created_by
90     ,p_creation_date      => p_creation_date
91 );
92   CopyRiValuationCurveRecs(
93     p_source_obj_def_id   => p_source_obj_def_id
94     ,p_target_obj_def_id  => p_target_obj_def_id
95     ,p_created_by         => p_created_by
96     ,p_creation_date      => p_creation_date
97 );
98 EXCEPTION
99   when others then
100     FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, g_api_name);
101     raise FND_API.G_EXC_UNEXPECTED_ERROR;
102 END CopyObjectDefinition;
103 --------------------------------------------------------------------------------
104 -- PRIVATE BODIES
105 --------------------------------------------------------------------------------
106 --
107 -- PROCEDURE
108 --       DeleteRateIndexRuleRec
109 --
110 -- DESCRIPTION
111 --   Deletes a Rate Index Rule Definition by performing deletes on records
112 --   in the FTP_RATE_INDEX_RULE table.
113 --
114 -- IN
115 --   p_obj_def_id    - Object Definition ID.
116 --
117 --------------------------------------------------------------------------------
118 PROCEDURE DeleteRateIndexRuleRec(
119   p_obj_def_id in number
120 )
121 --------------------------------------------------------------------------------
122 IS
123 BEGIN
124   delete from ftp_rate_index_rule
125   where object_definition_id = p_obj_def_id;
126 END DeleteRateIndexRuleRec;
127 --
128 -- PROCEDURE
129 --       DeleteRIValuationCurveRecs
130 --
131 -- DESCRIPTION
132 --   Deletes Rate Index Rule Definition records by performing deletes on records
133 --   in the FTP_RI_VALUATION_CURVE table.
134 --
135 -- IN
136 --   p_obj_def_id    - Object Definition ID.
137 --
138 --------------------------------------------------------------------------------
139 PROCEDURE DeleteRIValuationCurveRecs(
140   p_obj_def_id in number
141 )
142 --------------------------------------------------------------------------------
143 IS
144 BEGIN
145   delete from ftp_ri_valuation_curve
146   where object_definition_id = p_obj_def_id;
147 END DeleteRIValuationCurveRecs;
148 --
149 -- PROCEDURE
150 --       CopyRateIndexRuleRec
151 --
152 -- DESCRIPTION
153 --   Creates a new Rate Index Rule Definition by copying records in the
154 --   FTP_RATE_INDEX_RULE table.
155 --
156 -- IN
157 --   p_source_obj_def_id    - Source Object Definition ID.
158 --   p_target_obj_def_id    - Target Object Definition ID.
159 --   p_created_by           - FND User ID (optional).
160 --   p_creation_date        - System Date (optional).
161 --
162 --------------------------------------------------------------------------------
163 PROCEDURE CopyRateIndexRuleRec(
164   p_source_obj_def_id   in          number
165   ,p_target_obj_def_id  in          number
166   ,p_created_by         in          number
167   ,p_creation_date      in          date
168 )
169 --------------------------------------------------------------------------------
170 IS
171 BEGIN
172   insert into ftp_rate_index_rule (
173     object_definition_id
174     ,currency
175     ,interest_rate_code
176     ,yield_cv_term
177     ,yield_cv_term_mult
178     ,element_number
179     ,coefficient
180     ,exponent
181     ,val_yc_term
182     ,val_yc_term_mult
183     ,creation_date
184     ,created_by
185     ,last_updated_by
186     ,last_update_date
187     ,last_update_login
188   ) select
189     p_target_obj_def_id
190      ,currency
191      ,interest_rate_code
192      ,yield_cv_term
193      ,yield_cv_term_mult
194      ,element_number
195      ,coefficient
196      ,exponent
197      ,val_yc_term
198      ,val_yc_term_mult
199      ,nvl(p_creation_date,creation_date)
200      ,nvl(p_created_by,created_by)
201      ,FND_GLOBAL.user_id
202      ,sysdate
203      ,FND_GLOBAL.login_id
204   from ftp_rate_index_rule
205   where object_definition_id = p_source_obj_def_id;
206 END CopyRateIndexRuleRec;
207 --
208 -- PROCEDURE
209 --       CopyRiValuationCurveRecs
210 --
211 -- DESCRIPTION
212 --   Creates a new RI Valuation records by copying records in the
213 --   FTP_RI_VALUATION_CURVE table.
214 --
215 -- IN
216 --   p_source_obj_def_id    - Source Object Definition ID.
217 --   p_target_obj_def_id    - Target Object Definition ID.
218 --   p_created_by           - FND User ID (optional).
219 --   p_creation_date        - System Date (optional).
220 --
221 --------------------------------------------------------------------------------
222 PROCEDURE CopyRiValuationCurveRecs(
223   p_source_obj_def_id   in          number
224   ,p_target_obj_def_id  in          number
225   ,p_created_by         in          number
226   ,p_creation_date      in          date
227 )
228 --------------------------------------------------------------------------------
229 IS
230 BEGIN
231   insert into ftp_ri_valuation_curve (
232     object_definition_id
233     ,currency
234     ,interest_rate_code
235     ,creation_date
236     ,created_by
237     ,last_updated_by
238     ,last_update_date
239     ,last_update_login
240   ) select
241     p_target_obj_def_id
242     ,currency
243     ,interest_rate_code
244     ,nvl(p_creation_date,creation_date)
245     ,nvl(p_created_by,created_by)
246     ,FND_GLOBAL.user_id
247     ,sysdate
248     ,FND_GLOBAL.login_id
249   from ftp_ri_valuation_curve
250   where object_definition_id = p_source_obj_def_id;
251 END CopyRiValuationCurveRecs;
252 END FTP_BR_RATE_INDEX_PVT;