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