1 Package body HR_HRHD_EVENT_DATA_HANDLER as
2 /* $Header: perevtsyn.pkb 120.0.12020000.2 2013/02/28 14:58:41 pathota noship $ */
3
4
5 Procedure HRHD_PUSH_EVENT_DATA (p_in_event_data in CLOB,
6 p_transaction_id out NOCOPY NUMBER)
7
8 is
9
10
11 l_event_data CLOB;
12 l_transaction_id NUMBER;
13 l_status Varchar2(100);
14 Sequence_Value_error Exception;
15 Null_Event_Data Exception;
16
17
18 Begin
19
20 If (p_in_event_data is not null)
21 Then
22 Begin
23 Select HRHD_RIR_EVENT_DATA_SEQ.nextval into l_transaction_id from dual;
24 Exception
25 When Others then l_transaction_id := 0;
26 raise Sequence_Value_error;
27 End;
28
29 If l_transaction_id <> 0 and p_in_event_data is not null
30 Then
31 Insert into HR_HRHD_RIR_EVENT_DATA (Transaction_Id,Event_Data,Status) Values (l_transaction_id,p_in_event_data,'Y');
32 End If;
33 Else
34 Raise Null_Event_Data;
35 End If;
36
37 p_transaction_id := l_transaction_id;
38
39 Exception
40 When Sequence_Value_error Then p_transaction_id := 0;
41 When Null_Event_Data Then p_transaction_id := 0;
42 When Others then p_transaction_id := 0;
43
44 End HRHD_PUSH_EVENT_DATA;
45
46 Procedure HRHD_RETRIEVE_EVENT_DATA (p_transaction_id in NUMBER,
47 p_out_event_data out NOCOPY CLOB)
48 is
49
50 l_event_data CLOB;
51 l_transaction_id Number;
52 l_status Varchar2(100);
53 Null_TransactioN_Id Exception;
54 Null_Event_Data Exception;
55
56
57 Begin
58 If p_transaction_id is not null
59 Then
60 Begin
61 Select EVENT_DATA into l_event_data from HR_HRHD_RIR_EVENT_DATA where TRANSACTION_ID = p_transaction_id;
62 Exception
63 When Others then
64 l_event_data := null;
65 Raise Null_Event_Data;
66 End;
67
68 Else
69 Raise Null_TransactioN_Id;
70 End If;
71 Exception
72 When Null_TransactioN_Id Then l_event_data := null;
73 When Null_Event_Data Then l_event_data := null;
74 When Others then l_event_data := null;
75
76 End HRHD_RETRIEVE_EVENT_DATA;
77
78 End HR_HRHD_EVENT_DATA_HANDLER;
79
80