DBA Data[Home] [Help]

PACKAGE BODY: APPS.CS_SERVICE_AVAILABILITY_PKG

Source


1 PACKAGE BODY CS_SERVICE_AVAILABILITY_PKG as
2 /* $Header: csxsisab.pls 115.0 99/07/16 09:08:56 porting ship $ */
3 
4 
5   PROCEDURE Lock_Row(X_Rowid                            VARCHAR2,
6                      X_Service_Inventory_Item_Id        NUMBER,
7                      X_Service_Manufacturing_Org_Id     NUMBER,
8                      X_Inventory_Item_Id                NUMBER DEFAULT NULL,
9                      X_Item_Manufacturing_Org_Id        NUMBER DEFAULT NULL,
10                      X_Serviceable_Item_Class_Id        NUMBER DEFAULT NULL,
11                      X_Customer_Id                      NUMBER DEFAULT NULL,
12                      X_Customer_Set_Code                VARCHAR2 DEFAULT NULL,
13                      X_Serial_Number_Low                VARCHAR2 DEFAULT NULL,
14                      X_Serial_Number_High               VARCHAR2 DEFAULT NULL,
15                      X_Revision_Low                     VARCHAR2 DEFAULT NULL,
16                      X_Revision_High                    VARCHAR2 DEFAULT NULL,
17                      X_Start_Date_Active                DATE DEFAULT NULL,
18                      X_End_Date_Active                  DATE DEFAULT NULL,
19                      X_Attribute1                       VARCHAR2 DEFAULT NULL,
20                      X_Attribute2                       VARCHAR2 DEFAULT NULL,
21                      X_Attribute3                       VARCHAR2 DEFAULT NULL,
22                      X_Attribute4                       VARCHAR2 DEFAULT NULL,
23                      X_Attribute5                       VARCHAR2 DEFAULT NULL,
24                      X_Attribute6                       VARCHAR2 DEFAULT NULL,
25                      X_Attribute7                       VARCHAR2 DEFAULT NULL,
26                      X_Attribute8                       VARCHAR2 DEFAULT NULL,
27                      X_Attribute9                       VARCHAR2 DEFAULT NULL,
28                      X_Attribute10                      VARCHAR2 DEFAULT NULL,
29                      X_Attribute11                      VARCHAR2 DEFAULT NULL,
30                      X_Attribute12                      VARCHAR2 DEFAULT NULL,
31                      X_Attribute13                      VARCHAR2 DEFAULT NULL,
32                      X_Attribute14                      VARCHAR2 DEFAULT NULL,
33                      X_Attribute15                      VARCHAR2 DEFAULT NULL,
34                      X_Context                          VARCHAR2 DEFAULT NULL,
35                      X_Service_Available_Flag           VARCHAR2 DEFAULT NULL
36   ) IS
37     CURSOR C IS
38         SELECT *
39         FROM   cs_service_availability
40         WHERE  rowid = X_Rowid
41         FOR UPDATE  NOWAIT;
42     Recinfo C%ROWTYPE;
43   BEGIN
44     OPEN C;
45     FETCH C INTO Recinfo;
46     if (C%NOTFOUND) then
47       CLOSE C;
48       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
49       APP_EXCEPTION.Raise_Exception;
50     end if;
51     CLOSE C;
52    if (
53                (Recinfo.service_inventory_item_id = X_Service_Inventory_Item_Id)
54 
55 
56            AND (Recinfo.service_manufacturing_org_id = X_Service_Manufacturing_Org_Id)
57            AND (   (Recinfo.inventory_item_id = X_Inventory_Item_Id)
58                 OR (    (Recinfo.inventory_item_id IS NULL)
59                     AND (X_Inventory_Item_Id IS NULL)))
60            AND (   (Recinfo.item_manufacturing_org_id = X_Item_Manufacturing_Org_Id)
61                 OR (    (Recinfo.item_manufacturing_org_id IS NULL)
62                     AND (X_Item_Manufacturing_Org_Id IS NULL)))
63            AND (   (Recinfo.serviceable_item_class_id = X_Serviceable_Item_Class_Id)
64                 OR (    (Recinfo.serviceable_item_class_id IS NULL)
65                     AND (X_Serviceable_Item_Class_Id IS NULL)))
66            AND (   (Recinfo.customer_id = X_Customer_Id)
67                 OR (    (Recinfo.customer_id IS NULL)
68                     AND (X_Customer_Id IS NULL)))
69            AND (   (Recinfo.customer_set_code = X_Customer_Set_Code)
70                 OR (    (Recinfo.customer_set_code IS NULL)
71                     AND (X_Customer_Set_Code IS NULL)))
72            AND (   (Recinfo.serial_number_low = X_Serial_Number_Low)
73                 OR (    (Recinfo.serial_number_low IS NULL)
74                     AND (X_Serial_Number_Low IS NULL)))
75            AND (   (Recinfo.serial_number_high = X_Serial_Number_High)
76                 OR (    (Recinfo.serial_number_high IS NULL)
77                     AND (X_Serial_Number_High IS NULL)))
78            AND (   (Recinfo.revision_low = X_Revision_Low)
79                 OR (    (Recinfo.revision_low IS NULL)
80                     AND (X_Revision_Low IS NULL)))
81            AND (   (Recinfo.revision_high = X_Revision_High)
82                 OR (    (Recinfo.revision_high IS NULL)
83                     AND (X_Revision_High IS NULL)))
84            AND (   (Recinfo.start_date_active = X_Start_Date_Active)
85                 OR (    (Recinfo.start_date_active IS NULL)
86                     AND (X_Start_Date_Active IS NULL)))
87            AND (   (Recinfo.end_date_active = X_End_Date_Active)
88                 OR (    (Recinfo.end_date_active IS NULL)
89                     AND (X_End_Date_Active IS NULL)))
90            AND (   (Recinfo.attribute1 = X_Attribute1)
91                 OR (    (Recinfo.attribute1 IS NULL)
92                     AND (X_Attribute1 IS NULL)))
93            AND (   (Recinfo.attribute2 = X_Attribute2)
94                 OR (    (Recinfo.attribute2 IS NULL)
95                     AND (X_Attribute2 IS NULL)))
96            AND (Recinfo.Service_Available_Flag = X_Service_Available_Flag ) )THEN
97          null;
98     else
99       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
100       APP_EXCEPTION.RAISE_EXCEPTION;
101     end if;
102      if (
103             (   (Recinfo.attribute3 = X_Attribute3)
104                 OR (    (Recinfo.attribute3 IS NULL)
105                     AND (X_Attribute3 IS NULL)))
106            AND (   (Recinfo.attribute4 = X_Attribute4)
107                 OR (    (Recinfo.attribute4 IS NULL)
108                     AND (X_Attribute4 IS NULL)))
109            AND (   (Recinfo.attribute5 = X_Attribute5)
110                 OR (    (Recinfo.attribute5 IS NULL)
111                     AND (X_Attribute5 IS NULL)))
112            AND (   (Recinfo.attribute6 = X_Attribute6)
113                 OR (    (Recinfo.attribute6 IS NULL)
114                     AND (X_Attribute6 IS NULL)))
115 	   AND (   (Recinfo.attribute7 = X_Attribute7)
116                 OR (    (Recinfo.attribute7 IS NULL)
117                     AND (X_Attribute7 IS NULL)))
118            AND (   (Recinfo.attribute8 = X_Attribute8)
119                 OR (    (Recinfo.attribute8 IS NULL)
120                     AND (X_Attribute8 IS NULL)))
121            AND (   (Recinfo.attribute9 = X_Attribute9)
122                 OR (    (Recinfo.attribute9 IS NULL)
123                     AND (X_Attribute9 IS NULL)))
124            AND (   (Recinfo.attribute10 = X_Attribute10)
125                 OR (    (Recinfo.attribute10 IS NULL)
126                     AND (X_Attribute10 IS NULL)))
127            AND (   (Recinfo.attribute11 = X_Attribute11)
128                 OR (    (Recinfo.attribute11 IS NULL)
129                     AND (X_Attribute11 IS NULL)))
130            AND (   (Recinfo.attribute12 = X_Attribute12)
131                 OR (    (Recinfo.attribute12 IS NULL)
132                     AND (X_Attribute12 IS NULL)))
133            AND (   (Recinfo.attribute13 = X_Attribute13)
134                 OR (    (Recinfo.attribute13 IS NULL)
135                     AND (X_Attribute13 IS NULL)))
136            AND (   (Recinfo.attribute14 = X_Attribute14)
137                 OR (    (Recinfo.attribute14 IS NULL)
138                     AND (X_Attribute14 IS NULL)))
139            AND (   (Recinfo.attribute15 = X_Attribute15)
140                 OR (    (Recinfo.attribute15 IS NULL)
141                     AND (X_Attribute15 IS NULL)))
142            AND (   (Recinfo.context = X_Context)
143                 OR (    (Recinfo.context IS NULL)
144                     AND (X_Context IS NULL)))
145             ) then
146       return;
147     else
148       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
149       APP_EXCEPTION.RAISE_EXCEPTION;
150     end if;
151   END Lock_Row;
152   PROCEDURE Update_Row(X_Rowid                          VARCHAR2,
153                        X_Service_Inventory_Item_Id      NUMBER,
154                        X_Service_Manufacturing_Org_Id   NUMBER,
155                        X_Last_Update_Date               DATE,
156                        X_Last_Updated_By                NUMBER,
157                        X_Last_Update_Login              NUMBER DEFAULT NULL,
158                        X_Inventory_Item_Id              NUMBER DEFAULT NULL,
159                        X_Item_Manufacturing_Org_Id      NUMBER DEFAULT NULL,
160                        X_Serviceable_Item_Class_Id      NUMBER DEFAULT NULL,
161                        X_Customer_Id                    NUMBER DEFAULT NULL,
162                        X_Customer_Set_Code              VARCHAR2 DEFAULT NULL,
163                        X_Serial_Number_Low              VARCHAR2 DEFAULT NULL,
164                        X_Serial_Number_High             VARCHAR2 DEFAULT NULL,
165                        X_Revision_Low                   VARCHAR2 DEFAULT NULL,
166                        X_Revision_High                  VARCHAR2 DEFAULT NULL,
167                        X_Start_Date_Active              DATE DEFAULT NULL,
168                        X_End_Date_Active                DATE DEFAULT NULL,
169                        X_Attribute1                     VARCHAR2 DEFAULT NULL,
170                        X_Attribute2                     VARCHAR2 DEFAULT NULL,
171                        X_Attribute3                     VARCHAR2 DEFAULT NULL,
172                        X_Attribute4                     VARCHAR2 DEFAULT NULL,
173                        X_Attribute5                     VARCHAR2 DEFAULT NULL,
174                        X_Attribute6                     VARCHAR2 DEFAULT NULL,
175                        X_Attribute7                     VARCHAR2 DEFAULT NULL,
176                        X_Attribute8                     VARCHAR2 DEFAULT NULL,
177                        X_Attribute9                     VARCHAR2 DEFAULT NULL,
178                        X_Attribute10                    VARCHAR2 DEFAULT NULL,
179                        X_Attribute11                    VARCHAR2 DEFAULT NULL,
180                        X_Attribute12                    VARCHAR2 DEFAULT NULL,
181                        X_Attribute13                    VARCHAR2 DEFAULT NULL,
182                        X_Attribute14                    VARCHAR2 DEFAULT NULL,
183                        X_Attribute15                    VARCHAR2 DEFAULT NULL,
184                        X_Context                        VARCHAR2 DEFAULT NULL,
185                        X_Service_Available_Flag         VARCHAR2 DEFAULT NULL
186 ) IS
187  BEGIN
188    UPDATE cs_service_availability
189    SET
190      service_inventory_item_id         =     X_Service_Inventory_Item_Id,
191      service_manufacturing_org_id      =     X_Service_Manufacturing_Org_Id,
192      last_update_date                  =     X_Last_Update_Date,
193      last_updated_by                   =     X_Last_Updated_By,
194      last_update_login                 =     X_Last_Update_Login,
195      inventory_item_id                 =     X_Inventory_Item_Id,
196      item_manufacturing_org_id         =     X_Item_Manufacturing_Org_Id,
197      serviceable_item_class_id         =     X_Serviceable_Item_Class_Id,
198      customer_id                       =     X_Customer_Id,
199      customer_set_code                 =     X_Customer_Set_Code,
200      serial_number_low                 =     X_Serial_Number_Low,
201      serial_number_high                =     X_Serial_Number_High,
202      revision_low                      =     X_Revision_Low,
203      revision_high                     =     X_Revision_High,
204      start_date_active                 =     X_Start_Date_Active,
205      end_date_active                   =     X_End_Date_Active,
206      attribute1                        =     X_Attribute1,
207      attribute2                        =     X_Attribute2,
208      attribute3                        =     X_Attribute3,
209      attribute4                        =     X_Attribute4,
210      attribute5                        =     X_Attribute5,
211      attribute6                        =     X_Attribute6,
212      attribute7                        =     X_Attribute7,
213      attribute8                        =     X_Attribute8,
214      attribute9                        =     X_Attribute9,
215      attribute10                       =     X_Attribute10,
216      attribute11                       =     X_Attribute11,
217      attribute12                       =     X_Attribute12,
221      context                           =     X_Context,
218      attribute13                       =     X_Attribute13,
219      attribute14                       =     X_Attribute14,
220      attribute15                       =     X_Attribute15,
222 	Service_Available_Flag            =     X_Service_Available_Flag
223    WHERE rowid = X_rowid;
224     if (SQL%NOTFOUND) then
225       Raise NO_DATA_FOUND;
226     end if;
227   END Update_Row;
228 
229 PROCEDURE Delete_Row(X_Rowid VARCHAR2) IS
230   BEGIN
231     DELETE FROM cs_service_availability
232     WHERE  rowid = X_Rowid;
233     if (SQL%NOTFOUND) then
234       Raise NO_DATA_FOUND;
235     end if;
236 END Delete_Row;
237 
238 PROCEDURE Insert_Row(X_Rowid                          IN OUT VARCHAR2,
239                      X_service_availability_id        IN OUT NUMBER,
240                      X_Service_Inventory_Item_Id      NUMBER,
241                      X_Service_Manufacturing_Org_Id   NUMBER,
242                      X_Last_Update_Date               DATE,
243                      X_Last_Updated_By                NUMBER,
244                      X_Creation_Date                  DATE,
245                      X_Created_By                     NUMBER,
246                      X_Last_Update_Login              NUMBER DEFAULT NULL,
247                      X_Inventory_Item_Id              NUMBER DEFAULT NULL,
248                      X_Item_Manufacturing_Org_Id      NUMBER DEFAULT NULL,
249                      X_Customer_Id                    NUMBER DEFAULT NULL,
250                      X_Serial_Number_Low              VARCHAR2 DEFAULT NULL,
251                      X_Serial_Number_High             VARCHAR2 DEFAULT NULL,
252                      X_Revision_Low                   VARCHAR2 DEFAULT NULL,
253                      X_Revision_High                  VARCHAR2 DEFAULT NULL,
254                      X_Start_Date_Active              DATE DEFAULT NULL,
255                      X_End_Date_Active                DATE DEFAULT NULL,
256                      X_Attribute1                     VARCHAR2 DEFAULT NULL,
257                      X_Attribute2                     VARCHAR2 DEFAULT NULL,
258                      X_Attribute3                     VARCHAR2 DEFAULT NULL,
259                      X_Attribute4                     VARCHAR2 DEFAULT NULL,
260                      X_Attribute5                     VARCHAR2 DEFAULT NULL,
261                      X_Attribute6                     VARCHAR2 DEFAULT NULL,
262                      X_Attribute7                     VARCHAR2 DEFAULT NULL,
263                      X_Attribute8                     VARCHAR2 DEFAULT NULL,
264                      X_Attribute9                     VARCHAR2 DEFAULT NULL,
265                      X_Attribute10                    VARCHAR2 DEFAULT NULL,
266                      X_Attribute11                    VARCHAR2 DEFAULT NULL,
267                      X_Attribute12                    VARCHAR2 DEFAULT NULL,
268                      X_Attribute13                    VARCHAR2 DEFAULT NULL,
269                      X_Attribute14                    VARCHAR2 DEFAULT NULL,
270                      X_Attribute15                    VARCHAR2 DEFAULT NULL,
271                      X_Context                        VARCHAR2 DEFAULT NULL,
272                      X_Service_Available_Flag         VARCHAR2 DEFAULT NULL
273 ) IS
274  BEGIN
275    INSERT INTO cs_service_availability
276     ( Service_Availability_id,
277       Service_Inventory_Item_Id,
278       Service_Manufacturing_Org_Id,
279       Last_Update_Date,
280       Last_Updated_By,
281       Creation_Date,
282       Created_By,
283       Last_Update_Login,
284       Inventory_Item_Id,
285       Item_Manufacturing_Org_Id,
286       Serviceable_Item_Class_Id,
287       Customer_Id,
288       Customer_Set_Code,
289       Serial_Number_Low,
290       Serial_Number_High,
291       Revision_Low,
292       Revision_High,
293       Start_Date_Active,
294       End_Date_Active,
295       Attribute1,
296       Attribute2,
297       Attribute3,
298       Attribute4,
299       Attribute5,
300       Attribute6,
301       Attribute7,
302       Attribute8,
303       Attribute9,
304       Attribute10,
305       Attribute11,
306       Attribute12,
307       Attribute13,
308       Attribute14,
309       Attribute15,
310       Context,
311       Service_Available_Flag )
312   VALUES (
313       X_service_availability_id,
314       X_Service_Inventory_Item_Id,
315       X_Service_Manufacturing_Org_Id,
316       X_Last_Update_Date,
317       X_Last_Updated_By,
318       X_Creation_Date,
319       X_Created_By,
320       X_Last_Update_Login,
321       X_Inventory_Item_Id,
322       X_Item_Manufacturing_Org_Id,
323       null,
324       X_Customer_Id,
325       null,
326       X_Serial_Number_Low,
327       X_Serial_Number_High,
328       X_Revision_Low,
329       X_Revision_High,
330       X_Start_Date_Active,
331       X_END_Date_Active,
332       X_Attribute1,
333       X_Attribute2,
334       X_Attribute3,
335       X_Attribute4,
336       X_Attribute5,
337       X_Attribute6,
338       X_Attribute7,
339       X_Attribute8,
340       X_Attribute9,
341       X_Attribute10,
342       X_Attribute11,
343       X_Attribute12,
344       X_Attribute13,
345       X_Attribute14,
346       X_Attribute15,
347       X_Context,
348       X_Service_Available_Flag);
349 
350   IF (SQL%NOTFOUND) THEN
351 	Raise NO_DATA_FOUND;
352   END IF;
353 
354   SELECT rowid
355     INTO X_rowid
356     FROM CS_SERVICE_AVAILABILITY
357    WHERE service_availability_id = X_service_availability_id;
358 
359 END Insert_Row;
360 
361 END CS_SERVICE_AVAILABILITY_PKG;