[Home] [Help]
PACKAGE BODY: APPS.PO_GLOBAL
Source
1 PACKAGE BODY PO_GLOBAL AS
2 /* $Header: PO_GLOBAL.plb 120.1 2005/07/26 13:06:32 bao noship $ */
3
4 d_pkg_name CONSTANT varchar2(50) :=
5 PO_LOG.get_package_base('PO_GLOBAL');
6
7 -----------------------------------------------------------------------
8 --Start of Comments
9 --Name: set_role
10 --Pre-reqs: None
11 --Modifies:
12 --Locks:
13 -- None
14 --Function:
15 -- Sets the role of the user for the current database session.
16 -- Role can have one of the following values:
17 -- PO_GLOBAL.g_role_BUYER : Buyer
18 -- PO_GLOBAL.g_role_CAT_ADMIN : Catalog Admin
19 -- PO_GLOBAL.g_role_SUPPLIER : Supplier
20 --Parameters:
21 --IN:
22 --p_role
23 -- role to set
24 --IN OUT:
25 --OUT:
26 --Returns:
27 --Notes:
28 --Testing:
29 --End of Comments
30 ------------------------------------------------------------------------
31 PROCEDURE set_role
32 ( p_role IN VARCHAR2
33 )
34 IS
35 d_api_name CONSTANT VARCHAR2(30) := 'set_role';
36 d_module CONSTANT VARCHAR2(2000) := d_pkg_name || d_api_name || '.';
37
38 BEGIN
39 IF (PO_LOG.d_proc) THEN
40 PO_LOG.proc_begin(d_module);
41 PO_LOG.proc_begin(d_module, 'p_role', p_role);
42 END IF;
43
44 g_role := p_role;
45 END set_role;
46
47 -----------------------------------------------------------------------
48 --Start of Comments
49 --Name: role
50 --Pre-reqs: None
51 --Modifies:
52 --Locks:
53 -- None
54 --Function:
55 -- Returns the role of the current session
56 --Parameters:
57 --IN:
58 --IN OUT:
59 --OUT:
60 --Returns:
61 -- Role of the current session
62 --Notes:
63 --Testing:
64 --End of Comments
65 ------------------------------------------------------------------------
66 FUNCTION role RETURN VARCHAR2 IS
67
68 d_api_name CONSTANT VARCHAR2(30) := 'role';
69 d_module CONSTANT VARCHAR2(2000) := d_pkg_name || d_api_name || '.';
70 d_position NUMBER;
71 BEGIN
72 d_position := 0;
73
74 IF (PO_LOG.d_proc) THEN
75 PO_LOG.proc_begin(d_module);
76 END IF;
77
78 IF (PO_LOG.d_stmt) THEN
79 PO_LOG.stmt(d_module, d_position, 'g_role', g_role);
80 END IF;
81
82 RETURN g_role;
83 END role;
84
85 END PO_GLOBAL;