DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_RFQ_VENDORS_PKG_S3

Source


1 PACKAGE BODY PO_RFQ_VENDORS_PKG_S3 as
2 /* $Header: POXPIR4B.pls 115.0 99/07/17 01:50:03 porting ship $ */
3 /*========================================================================
4 ** PROCEDURE NAME : check_unique
5 ** DESCRIPTION    : We need either the po_line_id OR po_release_id
6 **                  argument passed in. Since both are the same data type
7 **                  cannot use function overloading unless we to_number()
8 **                  one of them. For now please pass in a NULL or 0 if
9 **                  either of them is NOT relevant.
10 ** ======================================================================*/
11 
12 
13 PROCEDURE check_unique (X_rowid		      VARCHAR2,
14 			X_sequence_num	      NUMBER,
15                         X_po_header_id        NUMBER) IS
16 
17 
18   X_progress VARCHAR2(3) := NULL;
19   dummy	   NUMBER;
20 
21 BEGIN
22 
23   X_progress := '010';
24 
25   SELECT  1
26   INTO    dummy
27   FROM    DUAL
28   WHERE  not exists (SELECT 1
29 		     FROM   po_rfq_vendors
30 		     WHERE  po_header_id = X_po_header_id
31                      AND    sequence_num  = X_sequence_num
32 		     AND    ((X_rowid is null) or
33                              (X_rowid != rowid)));
34   X_progress := '020';
35 
36 exception
37   when no_data_found then
38     po_message_s.app_error('PO_PO_ENTER_UNIQUE_SEQ_NUM');
39   when others then
40     po_message_s.sql_error('check_unique',X_progress,sqlcode);
41 
42 end check_unique;
43 
44 /*===========================================================================
45 
46   FUNCTION NAME:	get_max_sequence_num
47 
48 ===========================================================================*/
49 
50  FUNCTION get_max_sequence_num
51 	(X_po_header_id   NUMBER) return number is
52 
53  x_max_sequence_num NUMBER;
54  X_Progress   varchar2(3) := '';
55 
56  BEGIN
57 
58   X_progress := '010';
59 
60    SELECT nvl(max(sequence_num),0)
61    INTO   X_max_sequence_num
62    FROM   po_rfq_vendors
63    WHERE  po_header_id   = X_po_header_id;
64 
65   X_progress := '020';
66 
67    return(x_max_sequence_num);
68 
69    EXCEPTION
70    WHEN OTHERS THEN
71       return(0);
72       RAISE;
73 
74  END get_max_sequence_num;
75 
76 END PO_RFQ_VENDORS_PKG_S3;