1: PACKAGE BODY igs_en_timeslot_prty_pkg AS
2: /* $Header: IGSEI39B.pls 115.5 2002/11/28 23:41:46 nsidana ship $ */
3: l_rowid VARCHAR2(25);
4: old_references igs_en_timeslot_prty%ROWTYPE;
5: new_references igs_en_timeslot_prty%ROWTYPE;
1: PACKAGE BODY igs_en_timeslot_prty_pkg AS
2: /* $Header: IGSEI39B.pls 115.5 2002/11/28 23:41:46 nsidana ship $ */
3: l_rowid VARCHAR2(25);
4: old_references igs_en_timeslot_prty%ROWTYPE;
5: new_references igs_en_timeslot_prty%ROWTYPE;
6:
7: PROCEDURE set_column_values (
8: p_action IN VARCHAR2,
1: PACKAGE BODY igs_en_timeslot_prty_pkg AS
2: /* $Header: IGSEI39B.pls 115.5 2002/11/28 23:41:46 nsidana ship $ */
3: l_rowid VARCHAR2(25);
4: old_references igs_en_timeslot_prty%ROWTYPE;
5: new_references igs_en_timeslot_prty%ROWTYPE;
6:
7: PROCEDURE set_column_values (
8: p_action IN VARCHAR2,
9: x_rowid IN VARCHAR2 DEFAULT NULL,
6:
7: PROCEDURE set_column_values (
8: p_action IN VARCHAR2,
9: x_rowid IN VARCHAR2 DEFAULT NULL,
10: x_igs_en_timeslot_prty_id IN NUMBER DEFAULT NULL,
11: x_igs_en_timeslot_stup_id IN NUMBER DEFAULT NULL,
12: x_priority_order IN NUMBER DEFAULT NULL,
13: x_priority_value IN VARCHAR2 DEFAULT NULL,
14: x_creation_date IN DATE DEFAULT NULL,
30: ***************************************************************/
31:
32: CURSOR cur_old_ref_values IS
33: SELECT *
34: FROM IGS_EN_TIMESLOT_PRTY
35: WHERE rowid = x_rowid;
36:
37: BEGIN
38:
51: END IF;
52: CLOSE cur_old_ref_values;
53:
54: -- Populate New Values.
55: new_references.igs_en_timeslot_prty_id := x_igs_en_timeslot_prty_id;
56: new_references.igs_en_timeslot_stup_id := x_igs_en_timeslot_stup_id;
57: new_references.priority_order := x_priority_order;
58: new_references.priority_value := x_priority_value;
59: IF (p_action = 'UPDATE') THEN
157: ***************************************************************/
158:
159: BEGIN
160:
161: igs_en_timeslot_pref_pkg.get_fk_igs_en_timeslot_prty (
162: old_references.igs_en_timeslot_prty_id
163: );
164:
165: END check_child_existance;
158:
159: BEGIN
160:
161: igs_en_timeslot_pref_pkg.get_fk_igs_en_timeslot_prty (
162: old_references.igs_en_timeslot_prty_id
163: );
164:
165: END check_child_existance;
166:
164:
165: END check_child_existance;
166:
167: FUNCTION get_pk_for_validation (
168: x_igs_en_timeslot_prty_id IN NUMBER
169: ) RETURN BOOLEAN AS
170:
171: /*************************************************************
172: Created By :
180: ***************************************************************/
181:
182: CURSOR cur_rowid IS
183: SELECT rowid
184: FROM igs_en_timeslot_prty
185: WHERE igs_en_timeslot_prty_id = x_igs_en_timeslot_prty_id
186: FOR UPDATE NOWAIT;
187:
188: lv_rowid cur_rowid%RowType;
181:
182: CURSOR cur_rowid IS
183: SELECT rowid
184: FROM igs_en_timeslot_prty
185: WHERE igs_en_timeslot_prty_id = x_igs_en_timeslot_prty_id
186: FOR UPDATE NOWAIT;
187:
188: lv_rowid cur_rowid%RowType;
189:
217: ***************************************************************/
218:
219: CURSOR cur_rowid IS
220: SELECT rowid
221: FROM igs_en_timeslot_prty
222: WHERE igs_en_timeslot_stup_id = x_igs_en_timeslot_stup_id
223: AND priority_value = x_priority_value and ((l_rowid is null) or (rowid <> l_rowid))
224:
225: ;
253: ***************************************************************/
254:
255: CURSOR cur_rowid IS
256: SELECT rowid
257: FROM igs_en_timeslot_prty
258: WHERE igs_en_timeslot_stup_id = x_igs_en_timeslot_stup_id ;
259:
260: lv_rowid cur_rowid%RowType;
261:
276:
277: PROCEDURE before_dml (
278: p_action IN VARCHAR2,
279: x_rowid IN VARCHAR2 DEFAULT NULL,
280: x_igs_en_timeslot_prty_id IN NUMBER DEFAULT NULL,
281: x_igs_en_timeslot_stup_id IN NUMBER DEFAULT NULL,
282: x_priority_order IN NUMBER DEFAULT NULL,
283: x_priority_value IN VARCHAR2 DEFAULT NULL,
284: x_creation_date IN DATE DEFAULT NULL,
302:
303: set_column_values (
304: p_action,
305: x_rowid,
306: x_igs_en_timeslot_prty_id,
307: x_igs_en_timeslot_stup_id,
308: x_priority_order,
309: x_priority_value,
310: x_creation_date,
317: IF (p_action = 'INSERT') THEN
318: -- Call all the procedures related to Before Insert.
319: Null;
320: IF get_pk_for_validation(
321: new_references.igs_en_timeslot_prty_id) THEN
322: fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
323: igs_ge_msg_stack.add;
324: app_exception.raise_exception;
325: END IF;
338: check_child_existance;
339: ELSIF (p_action = 'VALIDATE_INSERT') THEN
340: -- Call all the procedures related to Before Insert.
341: IF get_pk_for_validation (
342: new_references.igs_en_timeslot_prty_id) THEN
343: fnd_message.set_name('IGS','IGS_GE_RECORD_ALREADY_EXISTS');
344: igs_ge_msg_stack.add;
345: app_exception.raise_exception;
346: END IF;
388: END after_dml;
389:
390: PROCEDURE insert_row (
391: x_rowid IN OUT NOCOPY VARCHAR2,
392: x_igs_en_timeslot_prty_id IN OUT NOCOPY NUMBER,
393: x_igs_en_timeslot_stup_id IN NUMBER,
394: x_priority_order IN NUMBER,
395: x_priority_value IN VARCHAR2,
396: x_mode IN VARCHAR2 DEFAULT 'R'
405:
406: (reverse chronological order - newest change first)
407: ***************************************************************/
408:
409: CURSOR c IS SELECT ROWID FROM igs_en_timeslot_prty
410: WHERE igs_en_timeslot_prty_id= x_igs_en_timeslot_prty_id
411: ;
412: x_last_update_date DATE ;
413: x_last_updated_by NUMBER ;
406: (reverse chronological order - newest change first)
407: ***************************************************************/
408:
409: CURSOR c IS SELECT ROWID FROM igs_en_timeslot_prty
410: WHERE igs_en_timeslot_prty_id= x_igs_en_timeslot_prty_id
411: ;
412: x_last_update_date DATE ;
413: x_last_updated_by NUMBER ;
414: x_last_update_login NUMBER ;
431: igs_ge_msg_stack.add;
432: app_exception.raise_exception;
433: end if;
434:
435: select igs_en_timeslot_prty_s.nextval into x_igs_en_timeslot_prty_id from dual;
436:
437: before_dml(
438: p_action=>'INSERT',
439: x_rowid=>X_ROWID,
436:
437: before_dml(
438: p_action=>'INSERT',
439: x_rowid=>X_ROWID,
440: x_igs_en_timeslot_prty_id=>x_igs_en_timeslot_prty_id,
441: x_igs_en_timeslot_stup_id=>x_igs_en_timeslot_stup_id,
442: x_priority_order=>x_priority_order,
443: x_priority_value=>x_priority_value,
444: x_creation_date=> x_last_update_date,
445: x_created_by=> x_last_updated_by,
446: x_last_update_date=> x_last_update_date,
447: x_last_updated_by=> x_last_updated_by,
448: x_last_update_login=> x_last_update_login);
449: INSERT INTO igs_en_timeslot_prty (
450: igs_en_timeslot_prty_id
451: ,igs_en_timeslot_stup_id
452: ,priority_order
453: ,priority_value
446: x_last_update_date=> x_last_update_date,
447: x_last_updated_by=> x_last_updated_by,
448: x_last_update_login=> x_last_update_login);
449: INSERT INTO igs_en_timeslot_prty (
450: igs_en_timeslot_prty_id
451: ,igs_en_timeslot_stup_id
452: ,priority_order
453: ,priority_value
454: ,creation_date
456: ,last_update_date
457: ,last_updated_by
458: ,last_update_login
459: ) VALUES (
460: new_references.igs_en_timeslot_prty_id
461: ,new_references.igs_en_timeslot_stup_id
462: ,new_references.priority_order
463: ,new_references.priority_value
464: ,x_last_update_date
479: x_rowid => X_ROWID );
480: END insert_row;
481: PROCEDURE lock_row (
482: x_rowid IN VARCHAR2,
483: x_igs_en_timeslot_prty_id IN NUMBER,
484: x_igs_en_timeslot_stup_id IN NUMBER,
485: x_priority_order IN NUMBER,
486: x_priority_value IN VARCHAR2 ) AS
487: /*************************************************************
498: CURSOR c1 IS SELECT
499: igs_en_timeslot_stup_id
500: , priority_order
501: , priority_value
502: FROM igs_en_timeslot_prty
503: WHERE ROWID = x_rowid
504: FOR UPDATE NOWAIT;
505: tlinfo c1%ROWTYPE;
506: BEGIN
527: RETURN;
528: END lock_row;
529: PROCEDURE update_row (
530: x_rowid IN VARCHAR2,
531: x_IGS_EN_TIMESLOT_PRTY_ID IN NUMBER,
532: x_IGS_EN_TIMESLOT_STUP_ID IN NUMBER,
533: x_PRIORITY_ORDER IN NUMBER,
534: x_PRIORITY_VALUE IN VARCHAR2,
535: x_mode IN VARCHAR2 DEFAULT 'R'
569: END IF;
570: before_dml(
571: p_action=>'UPDATE',
572: x_rowid=>X_ROWID,
573: x_igs_en_timeslot_prty_id=>X_IGS_EN_TIMESLOT_PRTY_ID,
574: x_igs_en_timeslot_stup_id=>X_IGS_EN_TIMESLOT_STUP_ID,
575: x_priority_order=>X_PRIORITY_ORDER,
576: x_priority_value=>X_PRIORITY_VALUE,
577: x_creation_date=>x_last_update_date,
578: x_created_by=>x_last_updated_by,
579: x_last_update_date=>x_last_update_date,
580: x_last_updated_by=>x_last_updated_by,
581: x_last_update_login=>x_last_update_login);
582: UPDATE igs_en_timeslot_prty SET
583: igs_en_timeslot_stup_id = NEW_REFERENCES.igs_en_timeslot_stup_id,
584: priority_order = NEW_REFERENCES.priority_order,
585: priority_value = NEW_REFERENCES.priority_value,
586: last_update_date = x_last_update_date,
597: );
598: END update_row;
599: PROCEDURE add_row (
600: x_rowid IN OUT NOCOPY VARCHAR2,
601: x_igs_en_timeslot_prty_id IN OUT NOCOPY NUMBER,
602: x_igs_en_timeslot_stup_id IN NUMBER,
603: x_priority_order IN NUMBER,
604: x_priority_value IN VARCHAR2,
605: x_mode IN VARCHAR2 DEFAULT 'R'
614:
615: (reverse chronological order - newest change first)
616: ***************************************************************/
617:
618: CURSOR c1 IS SELECT ROWID FROM igs_en_timeslot_prty
619: WHERE igs_en_timeslot_prty_id= x_igs_en_timeslot_prty_id
620: ;
621: BEGIN
622: OPEN c1;
615: (reverse chronological order - newest change first)
616: ***************************************************************/
617:
618: CURSOR c1 IS SELECT ROWID FROM igs_en_timeslot_prty
619: WHERE igs_en_timeslot_prty_id= x_igs_en_timeslot_prty_id
620: ;
621: BEGIN
622: OPEN c1;
623: FETCH c1 INTO x_rowid;
624: IF (c1%NOTFOUND) THEN
625: CLOSE c1;
626: insert_row (
627: x_rowid,
628: X_igs_en_timeslot_prty_id,
629: X_igs_en_timeslot_stup_id,
630: X_priority_order,
631: X_priority_value,
632: x_mode );
634: END IF;
635: CLOSE c1;
636: update_row (
637: x_rowid,
638: x_igs_en_timeslot_prty_id,
639: x_igs_en_timeslot_stup_id,
640: x_priority_order,
641: x_priority_value,
642: x_mode );
659: before_dml (
660: p_action => 'DELETE',
661: x_rowid => X_ROWID
662: );
663: DELETE FROM igs_en_timeslot_prty
664: WHERE ROWID = x_rowid;
665: IF (SQL%NOTFOUND) THEN
666: RAISE NO_DATA_FOUND;
667: END IF;
669: p_action => 'DELETE',
670: x_rowid => X_ROWID
671: );
672: END delete_row;
673: END igs_en_timeslot_prty_pkg;