DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_ASL_AUTHORIZATIONS_SV

Source


1 PACKAGE BODY PO_ASL_AUTHORIZATIONS_SV as
2 /* $Header: POXACLSB.pls 120.0.12010000.1 2008/09/18 12:20:52 appldev noship $ */
3 
4 /*=============================================================================
5 
6   FUNCTION NAME:	check_record_unique
7 
8 =============================================================================*/
9 function check_record_unique(x_reference_id	   	number,
10 			     x_reference_type		varchar2,
11 			     x_authorization_code	varchar2,
12 			     x_authorization_sequence   number,
13 			     x_using_organization_id    number) return boolean is
14 
15     x_dummy_count	NUMBER := 0;
16 
17 begin
18 
19     -- Check for duplicate sequence number for the current reference
20     -- number and type.  Also check for duplicate authorization
21     -- code.
22 
23     SELECT count(*)
24     INTO   x_dummy_count
25     FROM   CHV_AUTHORIZATIONS
26     WHERE  x_reference_id = reference_id
27     AND    x_reference_type = reference_type
28     AND    x_using_organization_id = using_organization_id
29     AND   (x_authorization_code = authorization_code
30        OR  x_authorization_sequence = authorization_sequence);
31 
32     IF x_dummy_count > 0 THEN
33 	return(FALSE);
34     ELSE
35 	return(TRUE);
36     END IF;
37 
38 exception
39     when others then
40         raise;
41 end;
42 
43 END PO_ASL_AUTHORIZATIONS_SV;