1: PACKAGE BODY gme_lab_batch_lots_dbl AS
2: /* $Header: GMEVGLBB.pls 120.2 2006/02/03 07:23:27 svgonugu noship $ */
3:
4: /* Global Variables */
5: g_table_name VARCHAR2 (80) DEFAULT 'GME_LAB_BATCH_LOTS_DBL';
1: PACKAGE BODY gme_lab_batch_lots_dbl AS
2: /* $Header: GMEVGLBB.pls 120.2 2006/02/03 07:23:27 svgonugu noship $ */
3:
4: /* Global Variables */
5: g_table_name VARCHAR2 (80) DEFAULT 'GME_LAB_BATCH_LOTS_DBL';
6: g_debug VARCHAR2 (5) := fnd_profile.VALUE ('AFLOG_LEVEL');
7:
8: /*============================================================================
9: | Copyright (c) 2001 Oracle Corporation
13: | FILENAME
14: | GMEVGLBB.pls
15: |
16: | DESCRIPTION
17: | This procedure is user to manipulate the GME_LAB_BATCH_LOTS table.
18: |
19: |
20: |
21: | NOTES
39: |
40: | TYPE
41: | Private
42: | USAGE
43: | Insert_Row will insert a row in gme_lab_batch_lots
44: |
45: |
46: | DESCRIPTION
47: | Insert_Row will insert a row in gme_lab_batch_lots
43: | Insert_Row will insert a row in gme_lab_batch_lots
44: |
45: |
46: | DESCRIPTION
47: | Insert_Row will insert a row in gme_lab_batch_lots
48: |
49: |
50: |
51: | PARAMETERS
48: |
49: |
50: |
51: | PARAMETERS
52: | p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE
53: | x_lab_batch_lots IN OUT NOCOPY gme_lab_batch_lots%ROWTYPE
54: |
55: | RETURNS
56: | BOOLEAN
49: |
50: |
51: | PARAMETERS
52: | p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE
53: | x_lab_batch_lots IN OUT NOCOPY gme_lab_batch_lots%ROWTYPE
54: |
55: | RETURNS
56: | BOOLEAN
57: | HISTORY
62: +=============================================================================
63: Api end of comments
64: */
65: FUNCTION insert_row (
66: p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE
67: ,x_lab_batch_lots IN OUT NOCOPY gme_lab_batch_lots%ROWTYPE)
68: RETURN BOOLEAN
69: IS
70: BEGIN
63: Api end of comments
64: */
65: FUNCTION insert_row (
66: p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE
67: ,x_lab_batch_lots IN OUT NOCOPY gme_lab_batch_lots%ROWTYPE)
68: RETURN BOOLEAN
69: IS
70: BEGIN
71: x_lab_batch_lots := p_lab_batch_lots;
69: IS
70: BEGIN
71: x_lab_batch_lots := p_lab_batch_lots;
72:
73: INSERT INTO gme_lab_batch_lots
74: (batch_id
75: ,material_detail_id
76: ,item_id, lot_id
77: ,qty, qty2
155: |
156: | TYPE
157: | Private
158: | USAGE
159: | Fetch_Row will fetch a row in gme_lab_batch_lots
160: |
161: |
162: | DESCRIPTION
163: | Fetch_Row will fetch a row in gme_lab_batch_lots
159: | Fetch_Row will fetch a row in gme_lab_batch_lots
160: |
161: |
162: | DESCRIPTION
163: | Fetch_Row will fetch a row in gme_lab_batch_lots
164: |
165: |
166: |
167: | PARAMETERS
164: |
165: |
166: |
167: | PARAMETERS
168: | p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE
169: | x_lab_batch_lots IN OUT NOCOPY gme_lab_batch_lots%ROWTYPE
170: |
171: | RETURNS
172: | BOOLEAN
165: |
166: |
167: | PARAMETERS
168: | p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE
169: | x_lab_batch_lots IN OUT NOCOPY gme_lab_batch_lots%ROWTYPE
170: |
171: | RETURNS
172: | BOOLEAN
173: | HISTORY
178: +=============================================================================
179: Api end of comments
180: */
181: FUNCTION fetch_row (
182: p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE
183: ,x_lab_batch_lots IN OUT NOCOPY gme_lab_batch_lots%ROWTYPE)
184: RETURN BOOLEAN
185: IS
186: BEGIN
179: Api end of comments
180: */
181: FUNCTION fetch_row (
182: p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE
183: ,x_lab_batch_lots IN OUT NOCOPY gme_lab_batch_lots%ROWTYPE)
184: RETURN BOOLEAN
185: IS
186: BEGIN
187: IF p_lab_batch_lots.batch_id IS NOT NULL
237: ,x_lab_batch_lots.attribute25, x_lab_batch_lots.attribute26
238: ,x_lab_batch_lots.attribute27, x_lab_batch_lots.attribute28
239: ,x_lab_batch_lots.attribute29, x_lab_batch_lots.attribute30
240: ,x_lab_batch_lots.attribute_category
241: FROM gme_lab_batch_lots
242: WHERE batch_id = p_lab_batch_lots.batch_id
243: AND material_detail_id = p_lab_batch_lots.material_detail_id
244: AND item_id = p_lab_batch_lots.item_id
245: AND lot_id = p_lab_batch_lots.lot_id;
270: |
271: | TYPE
272: | Private
273: | USAGE
274: | Delete_Row will delete a row in gme_lab_batch_lots
275: |
276: |
277: | DESCRIPTION
278: | Delete_Row will delete a row in gme_lab_batch_lots
274: | Delete_Row will delete a row in gme_lab_batch_lots
275: |
276: |
277: | DESCRIPTION
278: | Delete_Row will delete a row in gme_lab_batch_lots
279: |
280: |
281: |
282: | PARAMETERS
279: |
280: |
281: |
282: | PARAMETERS
283: | p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE
284: |
285: | RETURNS
286: | BOOLEAN
287: | HISTORY
292: |
293: +=============================================================================
294: Api end of comments
295: */
296: FUNCTION delete_row (p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE)
297: RETURN BOOLEAN
298: IS
299: l_dummy NUMBER (5) := 0;
300: locked_by_other_user EXCEPTION;
305: AND p_lab_batch_lots.item_id IS NOT NULL
306: AND p_lab_batch_lots.lot_id IS NOT NULL THEN
307: SELECT 1
308: INTO l_dummy
309: FROM gme_lab_batch_lots
310: WHERE batch_id = p_lab_batch_lots.batch_id
311: AND material_detail_id = p_lab_batch_lots.material_detail_id
312: AND item_id = p_lab_batch_lots.item_id
313: AND lot_id = p_lab_batch_lots.lot_id
312: AND item_id = p_lab_batch_lots.item_id
313: AND lot_id = p_lab_batch_lots.lot_id
314: FOR UPDATE NOWAIT;
315:
316: DELETE FROM gme_lab_batch_lots
317: WHERE batch_id = p_lab_batch_lots.batch_id
318: AND material_detail_id = p_lab_batch_lots.material_detail_id
319: AND item_id = p_lab_batch_lots.item_id
320: AND lot_id = p_lab_batch_lots.lot_id;
375: |
376: | TYPE
377: | Private
378: | USAGE
379: | Update_Row will update a row in gme_lab_batch_lots
380: |
381: |
382: | DESCRIPTION
383: | Update_Row will update a row in gme_lab_batch_lots
379: | Update_Row will update a row in gme_lab_batch_lots
380: |
381: |
382: | DESCRIPTION
383: | Update_Row will update a row in gme_lab_batch_lots
384: |
385: |
386: |
387: | PARAMETERS
384: |
385: |
386: |
387: | PARAMETERS
388: | p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE
389: |
390: | RETURNS
391: | BOOLEAN
392: | HISTORY
396: |
397: +=============================================================================
398: Api end of comments
399: */
400: FUNCTION update_row (p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE)
401: RETURN BOOLEAN
402: IS
403: l_dummy NUMBER := 0;
404: locked_by_other_user EXCEPTION;
409: AND p_lab_batch_lots.item_id IS NOT NULL
410: AND p_lab_batch_lots.lot_id IS NOT NULL THEN
411: SELECT 1
412: INTO l_dummy
413: FROM gme_lab_batch_lots
414: WHERE batch_id = p_lab_batch_lots.batch_id
415: AND material_detail_id = p_lab_batch_lots.material_detail_id
416: AND item_id = p_lab_batch_lots.item_id
417: AND lot_id = p_lab_batch_lots.lot_id
416: AND item_id = p_lab_batch_lots.item_id
417: AND lot_id = p_lab_batch_lots.lot_id
418: FOR UPDATE NOWAIT;
419:
420: UPDATE gme_lab_batch_lots
421: SET qty = p_lab_batch_lots.qty
422: ,qty2 = p_lab_batch_lots.qty2
423: ,uom = p_lab_batch_lots.uom
424: ,uom2 = p_lab_batch_lots.uom2
518: |
519: | TYPE
520: | Private
521: | USAGE
522: | Lock_Row will lock a row in gme_lab_batch_lots
523: |
524: |
525: | DESCRIPTION
526: | Lock_Row will lock a row in gme_lab_batch_lots
522: | Lock_Row will lock a row in gme_lab_batch_lots
523: |
524: |
525: | DESCRIPTION
526: | Lock_Row will lock a row in gme_lab_batch_lots
527: |
528: |
529: |
530: | PARAMETERS
527: |
528: |
529: |
530: | PARAMETERS
531: | p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE
532: |
533: | RETURNS
534: | BOOLEAN
535: | HISTORY
539: |
540: +=============================================================================
541: Api end of comments
542: */
543: FUNCTION lock_row (p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE)
544: RETURN BOOLEAN
545: IS
546: l_dummy NUMBER;
547: BEGIN
550: AND p_lab_batch_lots.item_id IS NOT NULL
551: AND p_lab_batch_lots.lot_id IS NOT NULL THEN
552: SELECT 1
553: INTO l_dummy
554: FROM gme_lab_batch_lots
555: WHERE batch_id = p_lab_batch_lots.batch_id
556: AND material_detail_id = p_lab_batch_lots.material_detail_id
557: AND item_id = p_lab_batch_lots.item_id
558: AND lot_id = p_lab_batch_lots.lot_id
590: | batch or for a material detail or for a combination of material
591: | detail and lot id.
592: |
593: | PARAMETERS
594: | p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE
595: | x_return_status IN OUT NOCOPY VARCHAR2
596: |
597: | HISTORY
598: | 13-NOV-01 Thomas Daniel Created
602: +=============================================================================
603: Api end of comments
604: */
605: PROCEDURE delete_lab_lots (
606: p_lab_batch_lots IN gme_lab_batch_lots%ROWTYPE
607: ,x_return_status IN OUT NOCOPY VARCHAR2)
608: IS
609: TYPE query_ref IS REF CURSOR;
610:
610:
611: get_lots query_ref;
612: l_where VARCHAR2 (2000);
613: l_cursor NUMBER (5);
614: l_lab_lots gme_lab_batch_lots%ROWTYPE;
615: BEGIN
616: /* Initialize API return status to sucess */
617: x_return_status := fnd_api.g_ret_sts_success;
618:
631: l_cursor := 3;
632: ELSE
633: gme_common_pvt.log_message ('GME_NO_KEYS'
634: ,'TABLE_NAME'
635: ,'GME_LAB_BATCH_LOTS');
636: RAISE fnd_api.g_exc_error;
637: END IF;
638:
639: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
642:
643: --FPBug#4998874 directly put the l_where value in the OPEN FOR statement.
644: IF l_cursor = 1 THEN
645: OPEN get_lots
646: FOR ' SELECT * FROM GME_LAB_BATCH_LOTS
647: WHERE material_detail_ID =:material_detail_id AND lot_id = :lot_id'
648: USING p_lab_batch_lots.material_detail_id, p_lab_batch_lots.lot_id;
649: ELSIF l_cursor = 2 THEN
650: OPEN get_lots
647: WHERE material_detail_ID =:material_detail_id AND lot_id = :lot_id'
648: USING p_lab_batch_lots.material_detail_id, p_lab_batch_lots.lot_id;
649: ELSIF l_cursor = 2 THEN
650: OPEN get_lots
651: FOR ' SELECT * FROM GME_LAB_BATCH_LOTS
652: WHERE material_detail_id =:material_detail_id'
653: USING p_lab_batch_lots.material_detail_id;
654: ELSIF l_cursor = 3 THEN
655: OPEN get_lots
652: WHERE material_detail_id =:material_detail_id'
653: USING p_lab_batch_lots.material_detail_id;
654: ELSIF l_cursor = 3 THEN
655: OPEN get_lots
656: FOR ' SELECT * FROM GME_LAB_BATCH_LOTS
657: WHERE batch_id =:batch_id'
658: USING p_lab_batch_lots.batch_id;
659: END IF;
660:
663: INTO l_lab_lots;
664:
665: EXIT WHEN get_lots%NOTFOUND;
666:
667: IF NOT gme_lab_batch_lots_dbl.delete_row
668: (p_lab_batch_lots => l_lab_lots) THEN
669: RAISE fnd_api.g_exc_error;
670: END IF;
671: END LOOP;
675: WHEN fnd_api.g_exc_error THEN
676: x_return_status := fnd_api.g_ret_sts_error;
677: WHEN OTHERS THEN
678: x_return_status := fnd_api.g_ret_sts_unexp_error;
679: fnd_msg_pub.add_exc_msg ('GME_LAB_BATCH_LOTS_DBL'
680: ,'DELETE_LAB_LOTS');
681:
682: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
683: gme_debug.put_line ('IN OTHERS ' || SQLERRM);
682: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
683: gme_debug.put_line ('IN OTHERS ' || SQLERRM);
684: END IF;
685: END delete_lab_lots;
686: END gme_lab_batch_lots_dbl;