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