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