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