1 Package ben_aud_shd AUTHID CURRENT_USER as
2 /* $Header: beaudrhi.pkh 120.0 2005/05/28 00:31 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (cwb_audit_id number(15)
10 ,group_per_in_ler_id number(15)
11 ,group_pl_id number(15)
12 ,lf_evt_ocrd_dt date
13 ,pl_id number(15)
14 ,group_oipl_id number(15)
15 ,audit_type_cd varchar2(30)
16 ,old_val_varchar varchar2(200)
17 ,new_val_varchar varchar2(200)
18 ,old_val_number number
19 ,new_val_number number
20 ,old_val_date date
21 ,new_val_date date
22 ,date_stamp date
23 ,change_made_by_person_id number(15)
24 ,supporting_information varchar2(200)
25 ,request_id number(15)
26 ,object_version_number number(9)
27 );
28 --
29 -- ----------------------------------------------------------------------------
30 -- | Global Definitions - Internal Development Use Only |
31 -- ----------------------------------------------------------------------------
32 --
33 g_old_rec g_rec_type; -- Global record definition
34 -- Global table name
35 g_tab_nam constant varchar2(30) := 'BEN_CWB_AUDIT';
36 --
37 -- ----------------------------------------------------------------------------
38 -- |---------------------------< constraint_error >---------------------------|
39 -- ----------------------------------------------------------------------------
40 -- {Start Of Comments}
41 --
42 -- Description:
43 -- This procedure is called when a constraint has been violated (i.e.
44 -- The exception hr_api.check_integrity_violated,
45 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
46 -- hr_api.unique_integrity_violated has been raised).
47 -- The exceptions can only be raised as follows:
48 -- 1) A check constraint can only be violated during an INSERT or UPDATE
49 -- dml operation.
50 -- 2) A parent integrity constraint can only be violated during an
51 -- INSERT or UPDATE dml operation.
52 -- 3) A child integrity constraint can only be violated during an
53 -- DELETE dml operation.
54 -- 4) A unique integrity constraint can only be violated during INSERT or
55 -- UPDATE dml operation.
56 --
57 -- Prerequisites:
58 -- 1) Either hr_api.check_integrity_violated,
59 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
60 -- hr_api.unique_integrity_violated has been raised with the subsequent
61 -- stripping of the constraint name from the generated error message
62 -- text.
63 -- 2) Standalone validation test which corresponds with a constraint error.
64 --
65 -- In Parameter:
66 -- p_constraint_name is in upper format and is just the constraint name
67 -- (e.g. not prefixed by brackets, schema owner etc).
68 --
69 -- Post Success:
70 -- Development dependant.
71 --
72 -- Post Failure:
73 -- Developement dependant.
74 --
75 -- Developer Implementation Notes:
76 -- For each constraint being checked the hr system package failure message
77 -- has been generated as a template only. These system error messages should
78 -- be modified as required (i.e. change the system failure message to a user
79 -- friendly defined error message).
80 --
81 -- Access Status:
82 -- Internal Development Use Only.
83 --
84 -- {End Of Comments}
85 -- ----------------------------------------------------------------------------
86 Procedure constraint_error
87 (p_constraint_name in all_constraints.constraint_name%TYPE);
88 --
89 -- ----------------------------------------------------------------------------
90 -- |-----------------------------< api_updating >-----------------------------|
91 -- ----------------------------------------------------------------------------
92 -- {Start Of Comments}
93 --
94 -- Description:
95 -- This function is used to populate the g_old_rec record with the
96 -- current row from the database for the specified primary key
97 -- provided that the primary key exists and is valid and does not
98 -- already match the current g_old_rec. The function will always return
99 -- a TRUE value if the g_old_rec is populated with the current row.
100 -- A FALSE value will be returned if all of the primary key arguments
101 -- are null.
102 --
103 -- Prerequisites:
104 -- None.
105 --
106 -- In Parameters:
107 --
108 -- Post Success:
109 -- A value of TRUE will be returned indiciating that the g_old_rec
110 -- is current.
111 -- A value of FALSE will be returned if all of the primary key arguments
112 -- have a null value (this indicates that the row has not be inserted into
113 -- the Schema), and therefore could never have a corresponding row.
114 --
115 -- Post Failure:
116 -- A failure can only occur under two circumstances:
117 -- 1) The primary key is invalid (i.e. a row does not exist for the
118 -- specified primary key values).
119 -- 2) If an object_version_number exists but is NOT the same as the current
120 -- g_old_rec value.
121 --
122 -- Developer Implementation Notes:
123 -- None.
124 --
125 -- Access Status:
126 -- Internal Development Use Only.
127 --
128 -- {End Of Comments}
129 -- ----------------------------------------------------------------------------
130 Function api_updating
131 (p_cwb_audit_id in number
132 ,p_object_version_number in number
133 ) Return Boolean;
134 --
135 -- ----------------------------------------------------------------------------
136 -- |---------------------------------< lck >----------------------------------|
137 -- ----------------------------------------------------------------------------
138 -- {Start of comments}
139 --
140 -- Description:
141 -- The Lck process has two main functions to perform. Firstly, the row to be
142 -- updated or deleted must be locked. The locking of the row will only be
143 -- successful if the row is not currently locked by another user.
144 -- Secondly, during the locking of the row, the row is selected into
145 -- the g_old_rec data structure which enables the current row values from
146 -- the server to be available to the api.
147 --
148 -- Prerequisites:
149 -- When attempting to call the lock the object version number (if defined)
150 -- is mandatory.
151 --
152 -- In Parameters:
153 -- The arguments to the Lck process are the primary key(s) which uniquely
154 -- identify the row and the object version number of row.
155 --
156 -- Post Success:
157 -- On successful completion of the Lck process the row to be updated or
158 -- deleted will be locked and selected into the global data structure
159 -- g_old_rec.
160 --
161 -- Post Failure:
162 -- The Lck process can fail for three reasons:
163 -- 1) When attempting to lock the row the row could already be locked by
164 -- another user. This will raise the HR_Api.Object_Locked exception.
165 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
166 -- This error is trapped and reported using the message name
167 -- 'HR_7220_INVALID_PRIMARY_KEY'.
168 -- 3) The row although existing in the HR Schema has a different object
169 -- version number than the object version number specified.
170 -- This error is trapped and reported using the message name
171 -- 'HR_7155_OBJECT_INVALID'.
172 --
173 -- Developer Implementation Notes:
174 -- For each primary key and the object version number arguments add a
175 -- call to hr_api.mandatory_arg_error procedure to ensure that these
176 -- argument values are not null.
177 --
178 -- Access Status:
179 -- Internal Development Use Only.
180 --
181 -- {End of comments}
182 -- ----------------------------------------------------------------------------
183 Procedure lck
184 (p_cwb_audit_id in number
185 ,p_object_version_number in number
186 );
187 --
188 -- ----------------------------------------------------------------------------
189 -- |-----------------------------< convert_args >-----------------------------|
190 -- ----------------------------------------------------------------------------
191 -- {Start Of Comments}
192 --
193 -- Description:
194 -- This function is used to turn attribute parameters into the record
195 -- structure parameter g_rec_type.
196 --
197 -- Prerequisites:
198 -- This is a private function and can only be called from the ins or upd
199 -- attribute processes.
200 --
201 -- In Parameters:
202 --
203 -- Post Success:
204 -- A returning record structure will be returned.
205 --
206 -- Post Failure:
207 -- No direct error handling is required within this function. Any possible
208 -- errors within this function will be a PL/SQL value error due to
209 -- conversion of datatypes or data lengths.
210 --
211 -- Developer Implementation Notes:
212 -- None.
213 --
214 -- Access Status:
215 -- Internal Row Handler Use Only.
216 --
217 -- {End Of Comments}
218 -- ----------------------------------------------------------------------------
219 Function convert_args
220 (p_cwb_audit_id in number
221 ,p_group_per_in_ler_id in number
222 ,p_group_pl_id in number
223 ,p_lf_evt_ocrd_dt in date
224 ,p_pl_id in number
225 ,p_group_oipl_id in number
226 ,p_audit_type_cd in varchar2
227 ,p_old_val_varchar in varchar2
228 ,p_new_val_varchar in varchar2
229 ,p_old_val_number in number
230 ,p_new_val_number in number
231 ,p_old_val_date in date
232 ,p_new_val_date in date
233 ,p_date_stamp in date
234 ,p_change_made_by_person_id in number
235 ,p_supporting_information in varchar2
236 ,p_request_id in number
237 ,p_object_version_number in number
238 )
239 Return g_rec_type;
240 --
241 end ben_aud_shd;