[Home] [Help]
PACKAGE BODY: APPS.PER_ACCRUAL_MESSAGE_PKG
Source
1 package body per_accrual_message_pkg as
2 /* $Header: peaclmes.pkb 115.1 99/07/17 18:25:07 porting ship $ */
3 g_package varchar2(50) := 'per_accrual_message_pkg.'; -- Global package name
4 --
5 /* =====================================================================
6 Define a package global table type of text values.
7 Declare an instance of the table.
8 ---------------------------------------------------------------------*/
9 --
10 TYPE global_message_t is TABLE OF varchar2(256) INDEX BY BINARY_INTEGER;
11 --
12 global_message global_message_t;
13 --
14 /* =====================================================================
15 Name : Put_Message
16 Purpose : Insert a message string into the message table.
17 Returns : 0 if successful, 1 otherwise
18 ---------------------------------------------------------------------*/
19 function put_message(p_message varchar2) return number is
20 --
21 l_proc varchar2(72) := g_package||'put_message';
22 l_next_pos number;
23 --
24 begin
25 hr_utility.set_location(l_proc, 5);
26 --
27 l_next_pos := global_message.count + 1;
28 global_message(l_next_pos) := p_message;
29 --
30 hr_utility.set_location(l_proc, 10);
31 return 0;
32 end put_message;
33 --
34 /* =====================================================================
35 Name : get_message
36 Purpose : Return a message from the table
37 Returns : Message string.
38 ---------------------------------------------------------------------*/
39 function get_message(p_table_position number) return varchar2 is
40 --
41 l_proc varchar2(72) := g_package||'get_message';
42 --
43 begin
44 hr_utility.set_location(l_proc, 5);
45 --
46 return global_message(p_table_position);
47 --
48 end get_message;
49 --
50 /* =====================================================================
51 Name : clear_table
52 Purpose : Clears all messages from the table.
53 ---------------------------------------------------------------------*/
54 procedure clear_table is
55 --
56 l_proc varchar2(72) := g_package||'clear_table';
57 --
58 begin
59 hr_utility.set_location(l_proc, 5);
60 --
61 global_message.delete;
62 --
63 hr_utility.set_location(l_proc, 10);
64 end clear_table;
65 --
66 /* =====================================================================
67 Name : count_messages
68 Purpose : Return total number of messages in table
69 ---------------------------------------------------------------------*/
70 function count_messages return number is
71 --
72 l_proc varchar2(72) := g_package||'count_messages';
73 --
74 begin
75 hr_utility.set_location(l_proc, 5);
76 --
77 return global_message.count;
78
79 end count_messages;
80 --
81 end per_accrual_message_pkg;