[Home] [Help]
PACKAGE BODY: APPS.RG_DSS_VAR_TEMPLATES_PKG
Source
1 PACKAGE BODY RG_DSS_VAR_TEMPLATES_PKG as
2 /*$Header: rgidvtlb.pls 120.3 2003/04/29 00:47:35 djogg ship $*/
3
4 FUNCTION validate_templates(X_Variable_Id NUMBER) RETURN VARCHAR2 IS
5 X_Segment1 VARCHAR2(25);
6 X_Segment2 VARCHAR2(25);
7 X_Segment3 VARCHAR2(25);
8 X_Segment4 VARCHAR2(25);
9 X_Segment5 VARCHAR2(25);
10 X_Segment6 VARCHAR2(25);
11 X_Segment7 VARCHAR2(25);
12 X_Segment8 VARCHAR2(25);
13 X_Segment9 VARCHAR2(25);
14 X_Segment10 VARCHAR2(25);
15 X_Segment11 VARCHAR2(25);
16 X_Segment12 VARCHAR2(25);
17 X_Segment13 VARCHAR2(25);
18 X_Segment14 VARCHAR2(25);
19 X_Segment15 VARCHAR2(25);
20 X_Segment16 VARCHAR2(25);
21 X_Segment17 VARCHAR2(25);
22 X_Segment18 VARCHAR2(25);
23 X_Segment19 VARCHAR2(25);
24 X_Segment20 VARCHAR2(25);
25 X_Segment21 VARCHAR2(25);
26 X_Segment22 VARCHAR2(25);
27 X_Segment23 VARCHAR2(25);
28 X_Segment24 VARCHAR2(25);
29 X_Segment25 VARCHAR2(25);
30 X_Segment26 VARCHAR2(25);
31 X_Segment27 VARCHAR2(25);
32 X_Segment28 VARCHAR2(25);
33 X_Segment29 VARCHAR2(25);
34 X_Segment30 VARCHAR2(25);
35 dummy VARCHAR2(10);
36 BEGIN
37 SELECT
38 segment1_type,
39 segment2_type,
40 segment3_type,
41 segment4_type,
42 segment5_type,
43 segment6_type,
44 segment7_type,
45 segment8_type,
46 segment9_type,
47 segment10_type,
48 segment11_type,
49 segment12_type,
50 segment13_type,
51 segment14_type,
52 segment15_type,
53 segment16_type,
54 segment17_type,
55 segment18_type,
56 segment19_type,
57 segment20_type,
58 segment21_type,
59 segment22_type,
60 segment23_type,
61 segment24_type,
62 segment25_type,
63 segment26_type,
64 segment27_type,
65 segment28_type,
66 segment29_type,
67 segment30_type
68 INTO
69 X_Segment1,
70 X_Segment2,
71 X_Segment3,
72 X_Segment4,
73 X_Segment5,
74 X_Segment6,
75 X_Segment7,
76 X_Segment8,
77 X_Segment9,
78 X_Segment10,
79 X_Segment11,
80 X_Segment12,
81 X_Segment13,
82 X_Segment14,
83 X_Segment15,
84 X_Segment16,
85 X_Segment17,
86 X_Segment18,
87 X_Segment19,
88 X_Segment20,
89 X_Segment21,
90 X_Segment22,
91 X_Segment23,
92 X_Segment24,
93 X_Segment25,
94 X_Segment26,
95 X_Segment27,
96 X_Segment28,
97 X_Segment29,
98 X_Segment30
99 FROM rg_dss_variables
100 WHERE variable_id = X_Variable_Id;
101
102 BEGIN
103 SELECT 'exist'
104 INTO dummy
105 FROM dual
106 WHERE exists (
107 SELECT 'x'
108 FROM rg_dss_var_templates
109 WHERE variable_id = X_Variable_Id );
110 EXCEPTION
111 WHEN NO_DATA_FOUND THEN
112 return('I');
113 END;
114
115 BEGIN
116 SELECT 'Invalid'
117 INTO dummy
118 FROM dual
119 WHERE exists (
120 SELECT 'Bad'
121 FROM rg_dss_var_templates
122 WHERE
123 variable_id = X_Variable_Id
124 AND ( instr(decode(X_Segment1,'ANY','DTR',X_Segment1),
125 decode(Segment1_Type,'D','D','T','T','R')) = 0
126 OR instr(decode(X_Segment2,'ANY','DTR',X_Segment2),
127 decode(Segment2_Type,'D','D','T','T','R')) = 0
128 OR instr(decode(X_Segment3,'ANY','DTR',X_Segment3),
129 decode(Segment3_Type,'D','D','T','T','R')) = 0
130 OR instr(decode(X_Segment4,'ANY','DTR',X_Segment4),
131 decode(Segment4_Type,'D','D','T','T','R')) = 0
132 OR instr(decode(X_Segment5,'ANY','DTR',X_Segment5),
133 decode(Segment5_Type,'D','D','T','T','R')) = 0
134 OR instr(decode(X_Segment6,'ANY','DTR',X_Segment6),
135 decode(Segment6_Type,'D','D','T','T','R')) = 0
136 OR instr(decode(X_Segment7,'ANY','DTR',X_Segment7),
137 decode(Segment7_Type,'D','D','T','T','R')) = 0
138 OR instr(decode(X_Segment8,'ANY','DTR',X_Segment8),
139 decode(Segment8_Type,'D','D','T','T','R')) = 0
140 OR instr(decode(X_Segment9,'ANY','DTR',X_Segment9),
141 decode(Segment9_Type,'D','D','T','T','R')) = 0
142 OR instr(decode(X_Segment10,'ANY','DTR',X_Segment10),
143 decode(Segment10_Type,'D','D','T','T','R')) = 0
144 OR instr(decode(X_Segment11,'ANY','DTR',X_Segment11),
145 decode(Segment11_Type,'D','D','T','T','R')) = 0
146 OR instr(decode(X_Segment12,'ANY','DTR',X_Segment12),
147 decode(Segment12_Type,'D','D','T','T','R')) = 0
148 OR instr(decode(X_Segment13,'ANY','DTR',X_Segment13),
149 decode(Segment13_Type,'D','D','T','T','R')) = 0
150 OR instr(decode(X_Segment14,'ANY','DTR',X_Segment14),
151 decode(Segment14_Type,'D','D','T','T','R')) = 0
152 OR instr(decode(X_Segment15,'ANY','DTR',X_Segment15),
153 decode(Segment15_Type,'D','D','T','T','R')) = 0
154 OR instr(decode(X_Segment16,'ANY','DTR',X_Segment16),
155 decode(Segment16_Type,'D','D','T','T','R')) = 0
156 OR instr(decode(X_Segment17,'ANY','DTR',X_Segment17),
157 decode(Segment17_Type,'D','D','T','T','R')) = 0
158 OR instr(decode(X_Segment18,'ANY','DTR',X_Segment18),
159 decode(Segment18_Type,'D','D','T','T','R')) = 0
160 OR instr(decode(X_Segment19,'ANY','DTR',X_Segment19),
161 decode(Segment19_Type,'D','D','T','T','R')) = 0
162 OR instr(decode(X_Segment20,'ANY','DTR',X_Segment20),
163 decode(Segment20_Type,'D','D','T','T','R')) = 0
164 OR instr(decode(X_Segment21,'ANY','DTR',X_Segment21),
165 decode(Segment21_Type,'D','D','T','T','R')) = 0
166 OR instr(decode(X_Segment22,'ANY','DTR',X_Segment22),
167 decode(Segment22_Type,'D','D','T','T','R')) = 0
168 OR instr(decode(X_Segment23,'ANY','DTR',X_Segment23),
169 decode(Segment23_Type,'D','D','T','T','R')) = 0
170 OR instr(decode(X_Segment24,'ANY','DTR',X_Segment24),
171 decode(Segment24_Type,'D','D','T','T','R')) = 0
172 OR instr(decode(X_Segment25,'ANY','DTR',X_Segment25),
173 decode(Segment25_Type,'D','D','T','T','R')) = 0
174 OR instr(decode(X_Segment26,'ANY','DTR',X_Segment26),
175 decode(Segment26_Type,'D','D','T','T','R')) = 0
176 OR instr(decode(X_Segment27,'ANY','DTR',X_Segment27),
177 decode(Segment27_Type,'D','D','T','T','R')) = 0
178 OR instr(decode(X_Segment28,'ANY','DTR',X_Segment28),
179 decode(Segment28_Type,'D','D','T','T','R')) = 0
180 OR instr(decode(X_Segment29,'ANY','DTR',X_Segment29),
181 decode(Segment29_Type,'D','D','T','T','R')) = 0
182 OR instr(decode(X_Segment30,'ANY','DTR',X_Segment30),
183 decode(Segment30_Type,'D','D','T','T','R')) = 0
184 ));
185
186 return('I');
187
188 EXCEPTION
189 WHEN NO_DATA_FOUND THEN
190 return('V');
191 END;
192
193 END validate_templates;
194
195
196 PROCEDURE Get_New_Template_Id(
197 X_Variable_Id NUMBER,
198 X_Template_Id NUMBER,
199 X_Ledger_Id NUMBER,
200 X_New_Template_Id IN OUT NOCOPY NUMBER,
201 X_New_Template_Name IN OUT NOCOPY VARCHAR2 ) IS
202 BEGIN
203 SELECT st.template_id,st.template_name
204 INTO X_New_Template_Id,X_New_Template_Name
205 FROM GL_SUMMARY_TEMPLATES st,
206 RG_DSS_VAR_TEMPLATES vt
207 WHERE vt.variable_id = X_Variable_Id
208 AND vt.template_id = X_Template_Id
209 AND st.ledger_id = X_Ledger_Id
210 AND st.status = 'F'
211 AND nvl(vt.segment1_type,'x') = nvl(st.segment1_type,'x')
212 AND nvl(vt.segment2_type,'x') = nvl(st.segment2_type,'x')
213 AND nvl(vt.segment3_type,'x') = nvl(st.segment3_type,'x')
214 AND nvl(vt.segment4_type,'x') = nvl(st.segment4_type,'x')
215 AND nvl(vt.segment5_type,'x') = nvl(st.segment5_type,'x')
216 AND nvl(vt.segment6_type,'x') = nvl(st.segment6_type,'x')
217 AND nvl(vt.segment7_type,'x') = nvl(st.segment7_type,'x')
218 AND nvl(vt.segment8_type,'x') = nvl(st.segment8_type,'x')
219 AND nvl(vt.segment9_type,'x') = nvl(st.segment9_type,'x')
220 AND nvl(vt.segment10_type,'x') = nvl(st.segment10_type,'x')
221 AND nvl(vt.segment11_type,'x') = nvl(st.segment11_type,'x')
222 AND nvl(vt.segment12_type,'x') = nvl(st.segment12_type,'x')
223 AND nvl(vt.segment13_type,'x') = nvl(st.segment13_type,'x')
224 AND nvl(vt.segment14_type,'x') = nvl(st.segment14_type,'x')
225 AND nvl(vt.segment15_type,'x') = nvl(st.segment15_type,'x')
226 AND nvl(vt.segment16_type,'x') = nvl(st.segment16_type,'x')
227 AND nvl(vt.segment17_type,'x') = nvl(st.segment17_type,'x')
228 AND nvl(vt.segment18_type,'x') = nvl(st.segment18_type,'x')
229 AND nvl(vt.segment19_type,'x') = nvl(st.segment19_type,'x')
230 AND nvl(vt.segment20_type,'x') = nvl(st.segment20_type,'x')
231 AND nvl(vt.segment21_type,'x') = nvl(st.segment21_type,'x')
232 AND nvl(vt.segment22_type,'x') = nvl(st.segment22_type,'x')
233 AND nvl(vt.segment23_type,'x') = nvl(st.segment23_type,'x')
234 AND nvl(vt.segment24_type,'x') = nvl(st.segment24_type,'x')
235 AND nvl(vt.segment25_type,'x') = nvl(st.segment25_type,'x')
236 AND nvl(vt.segment26_type,'x') = nvl(st.segment26_type,'x')
237 AND nvl(vt.segment27_type,'x') = nvl(st.segment27_type,'x')
238 AND nvl(vt.segment28_type,'x') = nvl(st.segment28_type,'x')
239 AND nvl(vt.segment29_type,'x') = nvl(st.segment29_type,'x')
240 AND nvl(vt.segment30_type,'x') = nvl(st.segment30_type,'x');
241
242 EXCEPTION
243 WHEN NO_DATA_FOUND THEN
244 X_New_Template_Id := -1;
245 WHEN OTHERS THEN
246 fnd_message.set_name('SQLGL', 'GL_UNHANDLED_EXCEPTION');
247 fnd_message.set_token('PROCEDURE',
248 'RG_DSS_VAR_TEMPLATES.Get_New_Template_Id');
249 RAISE;
250 END Get_New_Template_Id;
251
252 PROCEDURE check_unique_template(X_Rowid VARCHAR2,
253 X_Variable_Id NUMBER,
254 X_Template_Id NUMBER) IS
255 dummy NUMBER;
256 BEGIN
257 SELECT 1
258 INTO dummy
259 FROM rg_dss_var_templates
260 WHERE variable_id = X_Variable_Id
261 AND template_id = X_Template_Id
262 AND ((X_Rowid IS NULL) OR (rowid <> X_Rowid));
263
264 -- name already exists for a different variable: ERROR
265 FND_MESSAGE.set_name('RG', 'RG_FORMS_OBJECT_EXISTS_FOR');
266 FND_MESSAGE.set_token('OBJECT1', 'RG_DSS_TEMPLATE', TRUE);
267 FND_MESSAGE.set_token('OBJECT2', 'RG_DSS_VARIABLE', TRUE);
268 APP_EXCEPTION.raise_exception;
269
270 EXCEPTION
271 WHEN NO_DATA_FOUND THEN
272 NULL;
273 END check_unique_template;
274
275 PROCEDURE Insert_Row(X_Rowid IN OUT NOCOPY VARCHAR2,
276 X_Variable_Id NUMBER,
277 X_Template_Id NUMBER,
278 X_Last_Update_Date DATE,
279 X_Last_Updated_By NUMBER,
280 X_Last_Update_Login NUMBER,
281 X_Creation_Date DATE,
282 X_Created_By NUMBER,
283 X_Segment1_Type VARCHAR2,
284 X_Segment2_Type VARCHAR2,
285 X_Segment3_Type VARCHAR2,
286 X_Segment4_Type VARCHAR2,
287 X_Segment5_Type VARCHAR2,
291 X_Segment9_Type VARCHAR2,
288 X_Segment6_Type VARCHAR2,
289 X_Segment7_Type VARCHAR2,
290 X_Segment8_Type VARCHAR2,
292 X_Segment10_Type VARCHAR2,
293 X_Segment11_Type VARCHAR2,
294 X_Segment12_Type VARCHAR2,
295 X_Segment13_Type VARCHAR2,
296 X_Segment14_Type VARCHAR2,
297 X_Segment15_Type VARCHAR2,
298 X_Segment16_Type VARCHAR2,
299 X_Segment17_Type VARCHAR2,
300 X_Segment18_Type VARCHAR2,
301 X_Segment19_Type VARCHAR2,
302 X_Segment20_Type VARCHAR2,
303 X_Segment21_Type VARCHAR2,
304 X_Segment22_Type VARCHAR2,
305 X_Segment23_Type VARCHAR2,
306 X_Segment24_Type VARCHAR2,
307 X_Segment25_Type VARCHAR2,
308 X_Segment26_Type VARCHAR2,
309 X_Segment27_Type VARCHAR2,
310 X_Segment28_Type VARCHAR2,
311 X_Segment29_Type VARCHAR2,
312 X_Segment30_Type VARCHAR2,
313 X_Context VARCHAR2,
314 X_Attribute1 VARCHAR2,
315 X_Attribute2 VARCHAR2,
316 X_Attribute3 VARCHAR2,
317 X_Attribute4 VARCHAR2,
318 X_Attribute5 VARCHAR2,
319 X_Attribute6 VARCHAR2,
320 X_Attribute7 VARCHAR2,
321 X_Attribute8 VARCHAR2,
322 X_Attribute9 VARCHAR2,
323 X_Attribute10 VARCHAR2,
324 X_Attribute11 VARCHAR2,
325 X_Attribute12 VARCHAR2,
326 X_Attribute13 VARCHAR2,
327 X_Attribute14 VARCHAR2,
328 X_Attribute15 VARCHAR2
329 ) IS
330 CURSOR C IS SELECT rowid FROM RG_DSS_VAR_TEMPLATES
331 WHERE variable_id = X_Variable_Id
332 AND template_id = X_Template_Id;
333 BEGIN
334
335 check_unique_template(X_Rowid, X_Variable_Id, X_Template_Id);
336
337 INSERT INTO RG_DSS_VAR_TEMPLATES(
338 variable_id,
339 template_id,
340 last_update_date,
341 last_updated_by,
342 last_update_login,
343 creation_date,
344 created_by,
345 segment1_type,
346 segment2_type,
347 segment3_type,
348 segment4_type,
349 segment5_type,
350 segment6_type,
351 segment7_type,
352 segment8_type,
353 segment9_type,
354 segment10_type,
355 segment11_type,
356 segment12_type,
357 segment13_type,
358 segment14_type,
359 segment15_type,
360 segment16_type,
361 segment17_type,
362 segment18_type,
363 segment19_type,
364 segment20_type,
365 segment21_type,
366 segment22_type,
367 segment23_type,
368 segment24_type,
369 segment25_type,
370 segment26_type,
371 segment27_type,
372 segment28_type,
373 segment29_type,
374 segment30_type,
375 context,
376 attribute1,
377 attribute2,
378 attribute3,
379 attribute4,
380 attribute5,
381 attribute6,
382 attribute7,
383 attribute8,
384 attribute9,
385 attribute10,
386 attribute11,
387 attribute12,
388 attribute13,
389 attribute14,
390 attribute15
391 ) VALUES (
392 X_Variable_Id,
393 X_Template_Id,
394 X_Last_Update_Date,
395 X_Last_Updated_By,
396 X_Last_Update_Login,
397 X_Creation_Date,
398 X_Created_By,
399 X_Segment1_Type,
400 X_Segment2_Type,
401 X_Segment3_Type,
402 X_Segment4_Type,
403 X_Segment5_Type,
404 X_Segment6_Type,
405 X_Segment7_Type,
406 X_Segment8_Type,
407 X_Segment9_Type,
408 X_Segment10_Type,
412 X_Segment14_Type,
409 X_Segment11_Type,
410 X_Segment12_Type,
411 X_Segment13_Type,
413 X_Segment15_Type,
414 X_Segment16_Type,
415 X_Segment17_Type,
416 X_Segment18_Type,
417 X_Segment19_Type,
418 X_Segment20_Type,
419 X_Segment21_Type,
420 X_Segment22_Type,
421 X_Segment23_Type,
422 X_Segment24_Type,
423 X_Segment25_Type,
424 X_Segment26_Type,
425 X_Segment27_Type,
426 X_Segment28_Type,
427 X_Segment29_Type,
428 X_Segment30_Type,
429 X_Context,
430 X_Attribute1,
431 X_Attribute2,
432 X_Attribute3,
433 X_Attribute4,
434 X_Attribute5,
435 X_Attribute6,
436 X_Attribute7,
437 X_Attribute8,
438 X_Attribute9,
439 X_Attribute10,
440 X_Attribute11,
441 X_Attribute12,
442 X_Attribute13,
443 X_Attribute14,
444 X_Attribute15
445 );
446
447 OPEN C;
448 FETCH C INTO X_Rowid;
449 if (C%NOTFOUND) then
450 CLOSE C;
451 Raise NO_DATA_FOUND;
452 end if;
453 CLOSE C;
454 END Insert_Row;
455
456
457 PROCEDURE Lock_Row(X_Rowid VARCHAR2,
458 X_Variable_Id NUMBER,
459 X_Template_Id NUMBER,
460 X_Segment1_Type VARCHAR2,
461 X_Segment2_Type VARCHAR2,
462 X_Segment3_Type VARCHAR2,
463 X_Segment4_Type VARCHAR2,
464 X_Segment5_Type VARCHAR2,
465 X_Segment6_Type VARCHAR2,
466 X_Segment7_Type VARCHAR2,
467 X_Segment8_Type VARCHAR2,
468 X_Segment9_Type VARCHAR2,
469 X_Segment10_Type VARCHAR2,
470 X_Segment11_Type VARCHAR2,
471 X_Segment12_Type VARCHAR2,
472 X_Segment13_Type VARCHAR2,
473 X_Segment14_Type VARCHAR2,
474 X_Segment15_Type VARCHAR2,
475 X_Segment16_Type VARCHAR2,
476 X_Segment17_Type VARCHAR2,
477 X_Segment18_Type VARCHAR2,
478 X_Segment19_Type VARCHAR2,
479 X_Segment20_Type VARCHAR2,
480 X_Segment21_Type VARCHAR2,
481 X_Segment22_Type VARCHAR2,
482 X_Segment23_Type VARCHAR2,
483 X_Segment24_Type VARCHAR2,
484 X_Segment25_Type VARCHAR2,
485 X_Segment26_Type VARCHAR2,
486 X_Segment27_Type VARCHAR2,
487 X_Segment28_Type VARCHAR2,
488 X_Segment29_Type VARCHAR2,
489 X_Segment30_Type VARCHAR2,
490 X_Context VARCHAR2,
491 X_Attribute1 VARCHAR2,
492 X_Attribute2 VARCHAR2,
493 X_Attribute3 VARCHAR2,
494 X_Attribute4 VARCHAR2,
495 X_Attribute5 VARCHAR2,
496 X_Attribute6 VARCHAR2,
497 X_Attribute7 VARCHAR2,
498 X_Attribute8 VARCHAR2,
499 X_Attribute9 VARCHAR2,
500 X_Attribute10 VARCHAR2,
501 X_Attribute11 VARCHAR2,
502 X_Attribute12 VARCHAR2,
503 X_Attribute13 VARCHAR2,
504 X_Attribute14 VARCHAR2,
505 X_Attribute15 VARCHAR2
506 ) IS
507 CURSOR C IS
508 SELECT *
509 FROM RG_DSS_VAR_TEMPLATES
510 WHERE rowid = X_Rowid
511 FOR UPDATE of Variable_Id NOWAIT;
512 Recinfo C%ROWTYPE;
513
514
515 BEGIN
516 OPEN C;
517 FETCH C INTO Recinfo;
518 if (C%NOTFOUND) then
519 CLOSE C;
520 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
521 APP_EXCEPTION.Raise_Exception;
522 end if;
523 CLOSE C;
524 if (
528 OR ( (Recinfo.segment1_type IS NULL)
525 (Recinfo.variable_id = X_Variable_Id)
526 AND (Recinfo.template_id = X_Template_Id)
527 AND ( (Recinfo.segment1_type = X_Segment1_Type)
529 AND (X_Segment1_Type IS NULL)))
530 AND ( (Recinfo.segment2_type = X_Segment2_Type)
531 OR ( (Recinfo.segment2_type IS NULL)
532 AND (X_Segment2_Type IS NULL)))
533 AND ( (Recinfo.segment3_type = X_Segment3_Type)
534 OR ( (Recinfo.segment3_type IS NULL)
535 AND (X_Segment3_Type IS NULL)))
536 AND ( (Recinfo.segment4_type = X_Segment4_Type)
537 OR ( (Recinfo.segment4_type IS NULL)
538 AND (X_Segment4_Type IS NULL)))
539 AND ( (Recinfo.segment5_type = X_Segment5_Type)
540 OR ( (Recinfo.segment5_type IS NULL)
541 AND (X_Segment5_Type IS NULL)))
542 AND ( (Recinfo.segment6_type = X_Segment6_Type)
543 OR ( (Recinfo.segment6_type IS NULL)
544 AND (X_Segment6_Type IS NULL)))
545 AND ( (Recinfo.segment7_type = X_Segment7_Type)
546 OR ( (Recinfo.segment7_type IS NULL)
547 AND (X_Segment7_Type IS NULL)))
548 AND ( (Recinfo.segment8_type = X_Segment8_Type)
549 OR ( (Recinfo.segment8_type IS NULL)
550 AND (X_Segment8_Type IS NULL)))
551 AND ( (Recinfo.segment9_type = X_Segment9_Type)
552 OR ( (Recinfo.segment9_type IS NULL)
553 AND (X_Segment9_Type IS NULL)))
554 AND ( (Recinfo.segment10_type = X_Segment10_Type)
555 OR ( (Recinfo.segment10_type IS NULL)
556 AND (X_Segment10_Type IS NULL)))
557 AND ( (Recinfo.segment11_type = X_Segment11_Type)
558 OR ( (Recinfo.segment11_type IS NULL)
559 AND (X_Segment11_Type IS NULL)))
560 AND ( (Recinfo.segment12_type = X_Segment12_Type)
561 OR ( (Recinfo.segment12_type IS NULL)
562 AND (X_Segment12_Type IS NULL)))
563 AND ( (Recinfo.segment13_type = X_Segment13_Type)
564 OR ( (Recinfo.segment13_type IS NULL)
565 AND (X_Segment13_Type IS NULL)))
566 AND ( (Recinfo.segment14_type = X_Segment14_Type)
567 OR ( (Recinfo.segment14_type IS NULL)
568 AND (X_Segment14_Type IS NULL)))
569 AND ( (Recinfo.segment15_type = X_Segment15_Type)
570 OR ( (Recinfo.segment15_type IS NULL)
571 AND (X_Segment15_Type IS NULL)))
572 AND ( (Recinfo.segment16_type = X_Segment16_Type)
573 OR ( (Recinfo.segment16_type IS NULL)
574 AND (X_Segment16_Type IS NULL)))
575 AND ( (Recinfo.segment17_type = X_Segment17_Type)
576 OR ( (Recinfo.segment17_type IS NULL)
577 AND (X_Segment17_Type IS NULL)))
578 AND ( (Recinfo.segment18_type = X_Segment18_Type)
579 OR ( (Recinfo.segment18_type IS NULL)
580 AND (X_Segment18_Type IS NULL)))
581 AND ( (Recinfo.segment19_type = X_Segment19_Type)
582 OR ( (Recinfo.segment19_type IS NULL)
583 AND (X_Segment19_Type IS NULL)))
584 AND ( (Recinfo.segment20_type = X_Segment20_Type)
585 OR ( (Recinfo.segment20_type IS NULL)
586 AND (X_Segment20_Type IS NULL)))
587 AND ( (Recinfo.segment21_type = X_Segment21_Type)
588 OR ( (Recinfo.segment21_type IS NULL)
589 AND (X_Segment21_Type IS NULL)))
590 AND ( (Recinfo.segment22_type = X_Segment22_Type)
591 OR ( (Recinfo.segment22_type IS NULL)
592 AND (X_Segment22_Type IS NULL)))
593 AND ( (Recinfo.segment23_type = X_Segment23_Type)
594 OR ( (Recinfo.segment23_type IS NULL)
595 AND (X_Segment23_Type IS NULL)))
596 AND ( (Recinfo.segment24_type = X_Segment24_Type)
597 OR ( (Recinfo.segment24_type IS NULL)
598 AND (X_Segment24_Type IS NULL)))
599 AND ( (Recinfo.segment25_type = X_Segment25_Type)
600 OR ( (Recinfo.segment25_type IS NULL)
601 AND (X_Segment25_Type IS NULL)))
602 AND ( (Recinfo.segment26_type = X_Segment26_Type)
603 OR ( (Recinfo.segment26_type IS NULL)
604 AND (X_Segment26_Type IS NULL)))
605 AND ( (Recinfo.segment27_type = X_Segment27_Type)
606 OR ( (Recinfo.segment27_type IS NULL)
607 AND (X_Segment27_Type IS NULL)))
608 AND ( (Recinfo.segment28_type = X_Segment28_Type)
609 OR ( (Recinfo.segment28_type IS NULL)
610 AND (X_Segment28_Type IS NULL)))
611 AND ( (Recinfo.segment29_type = X_Segment29_Type)
612 OR ( (Recinfo.segment29_type IS NULL)
613 AND (X_Segment29_Type IS NULL)))
614 AND ( (Recinfo.segment30_type = X_Segment30_Type)
615 OR ( (Recinfo.segment30_type IS NULL)
616 AND (X_Segment30_Type IS NULL)))
617 AND ( (Recinfo.context = X_Context)
618 OR ( (Recinfo.context IS NULL)
619 AND (X_Context IS NULL)))
623 AND ( (Recinfo.attribute2 = X_Attribute2)
620 AND ( (Recinfo.attribute1 = X_Attribute1)
621 OR ( (Recinfo.attribute1 IS NULL)
622 AND (X_Attribute1 IS NULL)))
624 OR ( (Recinfo.attribute2 IS NULL)
625 AND (X_Attribute2 IS NULL)))
626 AND ( (Recinfo.attribute3 = X_Attribute3)
627 OR ( (Recinfo.attribute3 IS NULL)
628 AND (X_Attribute3 IS NULL)))
629 AND ( (Recinfo.attribute4 = X_Attribute4)
630 OR ( (Recinfo.attribute4 IS NULL)
631 AND (X_Attribute4 IS NULL)))
632 AND ( (Recinfo.attribute5 = X_Attribute5)
633 OR ( (Recinfo.attribute5 IS NULL)
634 AND (X_Attribute5 IS NULL)))
635 AND ( (Recinfo.attribute6 = X_Attribute6)
636 OR ( (Recinfo.attribute6 IS NULL)
637 AND (X_Attribute6 IS NULL)))
638 AND ( (Recinfo.attribute7 = X_Attribute7)
639 OR ( (Recinfo.attribute7 IS NULL)
640 AND (X_Attribute7 IS NULL)))
641 AND ( (Recinfo.attribute8 = X_Attribute8)
642 OR ( (Recinfo.attribute8 IS NULL)
643 AND (X_Attribute8 IS NULL)))
644 AND ( (Recinfo.attribute9 = X_Attribute9)
645 OR ( (Recinfo.attribute9 IS NULL)
646 AND (X_Attribute9 IS NULL)))
647 AND ( (Recinfo.attribute10 = X_Attribute10)
648 OR ( (Recinfo.attribute10 IS NULL)
649 AND (X_Attribute10 IS NULL)))
650 AND ( (Recinfo.attribute11 = X_Attribute11)
651 OR ( (Recinfo.attribute11 IS NULL)
652 AND (X_Attribute11 IS NULL)))
653 AND ( (Recinfo.attribute12 = X_Attribute12)
654 OR ( (Recinfo.attribute12 IS NULL)
655 AND (X_Attribute12 IS NULL)))
656 AND ( (Recinfo.attribute13 = X_Attribute13)
657 OR ( (Recinfo.attribute13 IS NULL)
658 AND (X_Attribute13 IS NULL)))
659 AND ( (Recinfo.attribute14 = X_Attribute14)
660 OR ( (Recinfo.attribute14 IS NULL)
661 AND (X_Attribute14 IS NULL)))
662 AND ( (Recinfo.attribute15 = X_Attribute15)
663 OR ( (Recinfo.attribute15 IS NULL)
664 AND (X_Attribute15 IS NULL)))
665 ) then
666 return;
667 else
668 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
669 APP_EXCEPTION.Raise_Exception;
670 end if;
671 END Lock_Row;
672
673
674
675 PROCEDURE Update_Row(X_Rowid VARCHAR2,
676
677 X_Variable_Id NUMBER,
678 X_Template_Id NUMBER,
679 X_Last_Update_Date DATE,
680 X_Last_Updated_By NUMBER,
681 X_Last_Update_Login NUMBER,
682 X_Segment1_Type VARCHAR2,
683 X_Segment2_Type VARCHAR2,
684 X_Segment3_Type VARCHAR2,
685 X_Segment4_Type VARCHAR2,
686 X_Segment5_Type VARCHAR2,
687 X_Segment6_Type VARCHAR2,
688 X_Segment7_Type VARCHAR2,
689 X_Segment8_Type VARCHAR2,
690 X_Segment9_Type VARCHAR2,
691 X_Segment10_Type VARCHAR2,
692 X_Segment11_Type VARCHAR2,
693 X_Segment12_Type VARCHAR2,
694 X_Segment13_Type VARCHAR2,
695 X_Segment14_Type VARCHAR2,
696 X_Segment15_Type VARCHAR2,
697 X_Segment16_Type VARCHAR2,
698 X_Segment17_Type VARCHAR2,
699 X_Segment18_Type VARCHAR2,
700 X_Segment19_Type VARCHAR2,
701 X_Segment20_Type VARCHAR2,
702 X_Segment21_Type VARCHAR2,
703 X_Segment22_Type VARCHAR2,
704 X_Segment23_Type VARCHAR2,
705 X_Segment24_Type VARCHAR2,
706 X_Segment25_Type VARCHAR2,
707 X_Segment26_Type VARCHAR2,
708 X_Segment27_Type VARCHAR2,
709 X_Segment28_Type VARCHAR2,
710 X_Segment29_Type VARCHAR2,
711 X_Segment30_Type VARCHAR2,
712 X_Context VARCHAR2,
713 X_Attribute1 VARCHAR2,
714 X_Attribute2 VARCHAR2,
715 X_Attribute3 VARCHAR2,
716 X_Attribute4 VARCHAR2,
717 X_Attribute5 VARCHAR2,
718 X_Attribute6 VARCHAR2,
722 X_Attribute10 VARCHAR2,
719 X_Attribute7 VARCHAR2,
720 X_Attribute8 VARCHAR2,
721 X_Attribute9 VARCHAR2,
723 X_Attribute11 VARCHAR2,
724 X_Attribute12 VARCHAR2,
725 X_Attribute13 VARCHAR2,
726 X_Attribute14 VARCHAR2,
727 X_Attribute15 VARCHAR2
728 ) IS
729 BEGIN
730 UPDATE RG_DSS_VAR_TEMPLATES
731 SET
732 variable_id = X_Variable_Id,
733 template_id = X_Template_Id,
734 last_update_date = X_Last_Update_Date,
735 last_updated_by = X_Last_Updated_By,
736 last_update_login = X_Last_Update_Login,
737 segment1_type = X_Segment1_Type,
738 segment2_type = X_Segment2_Type,
739 segment3_type = X_Segment3_Type,
740 segment4_type = X_Segment4_Type,
741 segment5_type = X_Segment5_Type,
742 segment6_type = X_Segment6_Type,
743 segment7_type = X_Segment7_Type,
744 segment8_type = X_Segment8_Type,
745 segment9_type = X_Segment9_Type,
746 segment10_type = X_Segment10_Type,
747 segment11_type = X_Segment11_Type,
748 segment12_type = X_Segment12_Type,
749 segment13_type = X_Segment13_Type,
750 segment14_type = X_Segment14_Type,
751 segment15_type = X_Segment15_Type,
752 segment16_type = X_Segment16_Type,
753 segment17_type = X_Segment17_Type,
754 segment18_type = X_Segment18_Type,
755 segment19_type = X_Segment19_Type,
756 segment20_type = X_Segment20_Type,
757 segment21_type = X_Segment21_Type,
758 segment22_type = X_Segment22_Type,
759 segment23_type = X_Segment23_Type,
760 segment24_type = X_Segment24_Type,
761 segment25_type = X_Segment25_Type,
762 segment26_type = X_Segment26_Type,
763 segment27_type = X_Segment27_Type,
764 segment28_type = X_Segment28_Type,
765 segment29_type = X_Segment29_Type,
766 segment30_type = X_Segment30_Type,
767 context = X_Context,
768 attribute1 = X_Attribute1,
769 attribute2 = X_Attribute2,
770 attribute3 = X_Attribute3,
771 attribute4 = X_Attribute4,
772 attribute5 = X_Attribute5,
773 attribute6 = X_Attribute6,
774 attribute7 = X_Attribute7,
775 attribute8 = X_Attribute8,
776 attribute9 = X_Attribute9,
777 attribute10 = X_Attribute10,
778 attribute11 = X_Attribute11,
779 attribute12 = X_Attribute12,
780 attribute13 = X_Attribute13,
781 attribute14 = X_Attribute14,
782 attribute15 = X_Attribute15
783 WHERE rowid = X_Rowid;
784
785 if (SQL%NOTFOUND) then
786 Raise NO_DATA_FOUND;
787 end if;
788 END Update_Row;
789
790
791 PROCEDURE Delete_Row(X_Rowid VARCHAR2) IS
792 BEGIN
793 DELETE FROM RG_DSS_VAR_TEMPLATES
794 WHERE rowid = X_Rowid;
795
796 if (SQL%NOTFOUND) then
797 Raise NO_DATA_FOUND;
798 end if;
799 END Delete_Row;
800
801
802 END RG_DSS_VAR_TEMPLATES_PKG;