DBA Data[Home] [Help]

PACKAGE BODY: APPS.OKE_POOL_PARTIES_PKG

Source


1 package body OKE_POOL_PARTIES_PKG as
2 /* $Header: OKEPLPTB.pls 115.5 2002/11/27 19:53:49 syho ship $ */
3 
4 PROCEDURE Insert_Row(X_Rowid          IN OUT NOCOPY   VARCHAR2,
5    		     X_Pool_Party_Id		      NUMBER,
6      		     X_Funding_Pool_Id		      NUMBER,
7      		     X_Party_Id			      NUMBER,
8                      X_Currency_Code		      VARCHAR2,
9                      X_Conversion_Type		      VARCHAR2,
10                      X_Conversion_Date		      DATE,
11                      X_Conversion_Rate		      NUMBER,
12                      X_Initial_Amount		      NUMBER,
13                      X_Amount			      NUMBER,
14                      X_Available_Amount		      NUMBER,
15                      X_Start_Date_Active	      DATE,
16                      X_End_Date_Active		      DATE,
17                      X_Last_Update_Date               DATE,
18                      X_Last_Updated_By                NUMBER,
19                      X_Creation_Date                  DATE,
20                      X_Created_By                     NUMBER,
21                      X_Last_Update_Login              NUMBER,
22                      X_Attribute_Category             VARCHAR2,
23                      X_Attribute1                     VARCHAR2,
24                      X_Attribute2                     VARCHAR2,
25                      X_Attribute3                     VARCHAR2,
26                      X_Attribute4                     VARCHAR2,
27                      X_Attribute5                     VARCHAR2,
28                      X_Attribute6                     VARCHAR2,
29                      X_Attribute7                     VARCHAR2,
30                      X_Attribute8                     VARCHAR2,
31                      X_Attribute9                     VARCHAR2,
32                      X_Attribute10                    VARCHAR2,
33                      X_Attribute11                    VARCHAR2,
34                      X_Attribute12                    VARCHAR2,
35                      X_Attribute13                    VARCHAR2,
36                      X_Attribute14                    VARCHAR2,
37                      X_Attribute15                    VARCHAR2
38   ) is
39 
40     cursor C is
41     select rowid
42     from   OKE_POOL_PARTIES
43     where  pool_party_id = X_Pool_Party_Id;
44 
45 begin
46 
47        insert into OKE_POOL_PARTIES(
48               pool_party_id,
49               funding_pool_id,
50               party_id,
51               currency_code,
52               conversion_type,
53               conversion_date,
54               conversion_rate,
55               initial_amount,
56               amount,
57               available_amount,
58               start_date_active,
59               end_date_active,
60               last_update_date,
61               last_updated_by,
62               creation_date,
63               created_by,
64               last_update_login,
65               attribute_category,
66               attribute1,
67               attribute2,
68               attribute3,
69               attribute4,
70               attribute5,
71               attribute6,
72               attribute7,
73               attribute8,
74               attribute9,
75               attribute10,
76               attribute11,
77               attribute12,
78               attribute13,
79               attribute14,
80               attribute15
81              ) VALUES (
82               X_Pool_Party_Id,
83               X_Funding_Pool_Id,
84               X_Party_Id,
85               X_Currency_Code,
86               X_Conversion_Type,
87               X_Conversion_Date,
88               X_Conversion_Rate,
89               X_Initial_Amount,
90               X_Amount,
91               X_Available_Amount,
92               X_Start_Date_Active,
93               X_End_Date_Active,
94               X_Last_Update_Date,
95               X_Last_Updated_By,
96               X_Creation_Date,
97               X_Created_By,
98               X_Last_Update_Login,
99               X_Attribute_Category,
100               X_Attribute1,
101               X_Attribute2,
102               X_Attribute3,
103               X_Attribute4,
104               X_Attribute5,
105               X_Attribute6,
106               X_Attribute7,
107               X_Attribute8,
108               X_Attribute9,
109               X_Attribute10,
110               X_Attribute11,
111               X_Attribute12,
112               X_Attribute13,
113               X_Attribute14,
114               X_Attribute15
115              );
116 
117   	open c;
118  	fetch c into X_Rowid;
119     	if (c%notfound) then
120    	   close c;
121     	   raise no_data_found;
122         end if;
123         close c;
124 
125 end Insert_Row;
126 
127 
128 PROCEDURE Lock_Row(X_Pool_Party_Id			NUMBER,
129      		   X_Funding_Pool_Id			NUMBER,
130      		   X_Party_Id				NUMBER,
131                    X_Currency_Code			VARCHAR2,
132                    X_Conversion_Type			VARCHAR2,
133                    X_Conversion_Date			DATE,
134                    X_Conversion_Rate			NUMBER,
135                    X_Initial_Amount			NUMBER,
136                    X_Amount				NUMBER,
137                    X_Available_Amount			NUMBER,
138                    X_Start_Date_Active			DATE,
139                    X_End_Date_Active			DATE,
140                    X_Attribute_Category                 VARCHAR2,
141                    X_Attribute1                         VARCHAR2,
142                    X_Attribute2                         VARCHAR2,
143                    X_Attribute3                         VARCHAR2,
144                    X_Attribute4                         VARCHAR2,
145                    X_Attribute5                         VARCHAR2,
146                    X_Attribute6                         VARCHAR2,
147                    X_Attribute7                         VARCHAR2,
148                    X_Attribute8                         VARCHAR2,
149                    X_Attribute9                         VARCHAR2,
150                    X_Attribute10                        VARCHAR2,
151                    X_Attribute11                        VARCHAR2,
152                    X_Attribute12                        VARCHAR2,
153                    X_Attribute13                        VARCHAR2,
154                    X_Attribute14                        VARCHAR2,
155                    X_Attribute15                        VARCHAR2
156   ) is
157 
158     cursor c is
159     select pool_party_id,
160            funding_pool_id,
161            party_id,
162            currency_code,
163            conversion_type,
164            conversion_date,
165            conversion_rate,
166            initial_amount,
167            amount,
168            available_amount,
169            start_date_active,
170            end_date_active,
171            attribute_category,
172            attribute1,
173            attribute2,
174            attribute3,
175            attribute4,
176            attribute5,
177            attribute6,
178            attribute7,
179            attribute8,
180            attribute9,
181            attribute10,
182            attribute11,
183            attribute12,
184            attribute13,
185            attribute14,
186            attribute15
187     from   OKE_POOL_PARTIES
188     where  pool_party_id = X_Pool_Party_Id
189     for update of pool_party_id nowait;
190 
191     recinfo c%rowtype;
192 
193 begin
194 
195     open c;
196     fetch c into recinfo;
197     if (c%notfound) then
198        close c;
199        fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
200        app_exception.raise_exception;
201     end if;
202     close c;
203 
204     if (   (rtrim(recinfo.currency_code) = rtrim(X_Currency_Code))
205        AND ((rtrim(recinfo.conversion_type) = rtrim(X_Conversion_Type))
206            OR ((recinfo.conversion_type is null) AND (X_Conversion_Type is null)))
207        AND ((recinfo.conversion_date = X_Conversion_Date)
208            OR ((recinfo.conversion_date is null) AND (X_Conversion_Date is null)))
209        AND ((recinfo.conversion_rate = X_Conversion_Rate)
210            OR ((recinfo.conversion_rate is null) AND (X_Conversion_Rate is null)))
211        AND ((recinfo.start_date_active = X_Start_Date_Active)
212            OR ((recinfo.start_date_active is null) AND (X_Start_Date_Active is null)))
213        AND ((recinfo.end_date_active = X_End_Date_Active)
214            OR ((recinfo.end_date_active is null) AND (X_End_Date_Active is null)))
215        AND ((recinfo.initial_amount = X_Initial_Amount)
216            OR ((recinfo.initial_amount is null) AND (X_Initial_Amount is null)))
217        AND ((recinfo.available_amount = X_Available_Amount)
218            OR ((recinfo.available_amount is null) AND (X_Available_Amount is null)))
219        AND (recinfo.amount = X_Amount)
220        AND (recinfo.party_id = X_Party_Id)
221        AND (recinfo.pool_party_id = X_Pool_Party_Id)
222        AND (recinfo.funding_pool_id = X_Funding_Pool_Id)
223        AND ((rtrim(recinfo.attribute_category) = rtrim(X_Attribute_Category))
224            OR ((recinfo.attribute_category is null) AND (X_Attribute_Category is null)))
225        AND ((rtrim(recinfo.attribute1) = rtrim(X_Attribute1))
226            OR ((recinfo.attribute1 is null) AND (X_Attribute1 is null)))
227        AND ((rtrim(recinfo.attribute2) = rtrim(X_Attribute2))
228            OR ((recinfo.attribute2 is null) AND (X_Attribute2 is null)))
229        AND ((rtrim(recinfo.attribute3) = rtrim(X_Attribute3))
230            OR ((recinfo.attribute3 is null) AND (X_Attribute3 is null)))
231        AND ((rtrim(recinfo.attribute4) = rtrim(X_Attribute4))
232            OR ((recinfo.attribute4 is null) AND (X_Attribute4 is null)))
233        AND ((rtrim(recinfo.attribute5) = rtrim(X_Attribute5))
234            OR ((recinfo.attribute5 is null) AND (X_Attribute5 is null)))
235        AND ((rtrim(recinfo.attribute6) = rtrim(X_Attribute6))
236            OR ((recinfo.attribute6 is null) AND (X_Attribute6 is null)))
237        AND ((rtrim(recinfo.attribute7) = rtrim(X_Attribute7))
238            OR ((recinfo.attribute7 is null) AND (X_Attribute7 is null)))
239        AND ((rtrim(recinfo.attribute8) = rtrim(X_Attribute8))
240            OR ((recinfo.attribute8 is null) AND (X_Attribute8 is null)))
241        AND ((rtrim(recinfo.attribute9) = rtrim(X_Attribute9))
242            OR ((recinfo.attribute9 is null) AND (X_Attribute9 is null)))
243        AND ((rtrim(recinfo.attribute10) = rtrim(X_Attribute10))
244            OR ((recinfo.attribute10 is null) AND (X_Attribute10 is null)))
245        AND ((rtrim(recinfo.attribute11) = rtrim(X_Attribute11))
246            OR ((recinfo.attribute11 is null) AND (X_Attribute11 is null)))
247        AND ((rtrim(recinfo.attribute12) = rtrim(X_Attribute12))
248            OR ((recinfo.attribute12 is null) AND (X_Attribute12 is null)))
249        AND ((rtrim(recinfo.attribute13) = rtrim(X_Attribute13))
250            OR ((recinfo.attribute13 is null) AND (X_Attribute13 is null)))
251        AND ((rtrim(recinfo.attribute14) = rtrim(X_Attribute14))
252            OR ((recinfo.attribute14 is null) AND (X_Attribute14 is null)))
253        AND ((rtrim(recinfo.attribute15) = rtrim(X_Attribute15))
254            OR ((recinfo.attribute15 is null) AND (X_Attribute15 is null)))
255   ) then
256     null;
257   else
258     fnd_message.set_name('FND', 'FORM_RECORD_CHANGED');
259     app_exception.raise_exception;
260   end if;
261 
262 end Lock_Row;
263 
264 
265 PROCEDURE Update_Row(X_Pool_Party_Id			NUMBER,
266      		     X_Party_Id				NUMBER,
267      		     X_Currency_Code			VARCHAR2,
268                      X_Conversion_Type			VARCHAR2,
269                      X_Conversion_Date			DATE,
270                      X_Conversion_Rate			NUMBER,
271                      X_Amount				NUMBER,
272                      X_Available_Amount			NUMBER,
273                      X_Start_Date_Active		DATE,
274                      X_End_Date_Active			DATE,
275                      X_Last_Update_Date                 DATE,
276                      X_Last_Updated_By                  NUMBER,
277                      X_Last_Update_Login                NUMBER,
278                      X_Attribute_Category               VARCHAR2,
279                      X_Attribute1                       VARCHAR2,
280                      X_Attribute2                       VARCHAR2,
281                      X_Attribute3                       VARCHAR2,
282                      X_Attribute4                       VARCHAR2,
283                      X_Attribute5                       VARCHAR2,
284                      X_Attribute6                       VARCHAR2,
285                      X_Attribute7                       VARCHAR2,
286                      X_Attribute8                       VARCHAR2,
287                      X_Attribute9                       VARCHAR2,
288                      X_Attribute10                      VARCHAR2,
289                      X_Attribute11                      VARCHAR2,
290                      X_Attribute12                      VARCHAR2,
291                      X_Attribute13                      VARCHAR2,
292                      X_Attribute14                      VARCHAR2,
293                      X_Attribute15                      VARCHAR2
294   ) is
295 
296 begin
297 
298     update OKE_POOL_PARTIES
299     set
300        party_id		       	       =     X_Party_Id,
301        currency_code		       =     X_Currency_Code,
302        conversion_type	               =     X_Conversion_Type,
303        conversion_date		       =     X_Conversion_Date,
304        conversion_rate	               =     X_Conversion_Rate,
305        amount		      	       =     X_Amount,
306        available_amount		       =     X_Available_Amount,
307        start_date_active	       =     X_Start_Date_Active,
308        end_date_active		       =     X_End_Date_Active,
309        last_update_date                =     X_Last_Update_Date,
310        last_updated_by                 =     X_Last_Updated_By,
311        last_update_login               =     X_Last_Update_Login,
312        attribute_Category              =     X_Attribute_Category,
313        attribute1                      =     X_Attribute1,
314        attribute2                      =     X_Attribute2,
315        attribute3                      =     X_Attribute3,
316        attribute4                      =     X_Attribute4,
317        attribute5                      =     X_Attribute5,
318        attribute6                      =     X_Attribute6,
319        attribute7                      =     X_Attribute7,
320        attribute8                      =     X_Attribute8,
321        attribute9                      =     X_Attribute9,
322        attribute10                     =     X_Attribute10,
323        attribute11                     =     X_Attribute11,
324        attribute12                     =     X_Attribute12,
325        attribute13                     =     X_Attribute13,
326        attribute14                     =     X_Attribute14,
327        attribute15                     =     X_Attribute15
328     where pool_party_id = X_Pool_Party_Id;
329 
330     if (sql%notfound) then
331         raise no_data_found;
332     end if;
333 
334 end Update_Row;
335 
336 PROCEDURE Delete_Row(X_Rowid VARCHAR2) IS
337 BEGIN
338 
339    DELETE FROM OKE_POOL_PARTIES
340    WHERE rowid = X_Rowid;
341 
342    if (SQL%NOTFOUND) then
343       Raise NO_DATA_FOUND;
344    end if;
345 
346 EXCEPTION
347    WHEN OTHERS THEN
348         raise;
349 
350 END Delete_Row;
351 
352 end OKE_POOL_PARTIES_PKG;