1 Package psp_prt_shd as
2 /* $Header: PSPRTRHS.pls 120.1 2005/07/05 23:50 dpaudel noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (template_id number(15)
10 ,template_name varchar2(240)
11 ,business_group_id number(15)
12 ,set_of_books_id number(15)
13 ,object_version_number number(9)
14 ,report_type varchar2(30)
15 ,period_frequency_id number
16 ,report_template_code varchar2(80)
17 ,display_all_emp_distrib_flag varchar2(9) -- Increased length
18 ,manual_entry_override_flag varchar2(9) -- Increased length
19 ,approval_type varchar2(30)
20 ,custom_approval_code varchar2(30)
21 ,sup_levels number
22 ,preview_effort_report_flag varchar2(9) -- Increased length
23 ,notification_reminder_in_days number
24 ,sprcd_tolerance_amt number
25 ,sprcd_tolerance_percent number
26 ,description varchar2(1000)
27 ,legislation_code varchar2(30)
28 ,hundred_pcent_eff_at_per_asg varchar2(9) -- Increased length
29 ,selection_match_level varchar2(9)
30 );
31 --
32 -- ----------------------------------------------------------------------------
33 -- | Global Definitions - Internal Development Use Only |
34 -- ----------------------------------------------------------------------------
35 --
36 g_old_rec g_rec_type; -- Global record definition
37 -- Global table name
38 g_tab_nam constant varchar2(30) := 'PSP_REPORT_TEMPLATES';
39 g_api_dml boolean; -- Global api dml status
40 --
41 -- ----------------------------------------------------------------------------
42 -- |------------------------< return_api_dml_status >-------------------------|
43 -- ----------------------------------------------------------------------------
44 -- {Start Of Comments}
45 --
46 -- Description:
47 -- This function will return the current g_api_dml private global
48 -- boolean status.
49 -- The g_api_dml status determines if at the time of the function
50 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
51 -- is being issued from within an api.
52 -- If the status is TRUE then a dml statement is being issued from
53 -- within this entity api.
54 -- This function is primarily to support database triggers which
55 -- need to maintain the object_version_number for non-supported
56 -- dml statements (i.e. dml statement issued outside of the api layer).
57 --
58 -- Prerequisites:
59 -- None.
60 --
61 -- In Parameters:
62 -- None.
63 --
64 -- Post Success:
65 -- Processing continues.
66 -- If the function returns a TRUE value then, dml is being executed from
67 -- within this api.
68 --
69 -- Post Failure:
70 -- None.
71 --
72 -- Access Status:
73 -- Internal Row Handler Use Only.
74 --
75 -- {End Of Comments}
76 -- ----------------------------------------------------------------------------
77 Function return_api_dml_status Return Boolean;
78 --
79 -- ----------------------------------------------------------------------------
80 -- |---------------------------< constraint_error >---------------------------|
81 -- ----------------------------------------------------------------------------
82 -- {Start Of Comments}
83 --
84 -- Description:
85 -- This procedure is called when a constraint has been violated (i.e.
86 -- The exception hr_api.check_integrity_violated,
87 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
88 -- hr_api.unique_integrity_violated has been raised).
89 -- The exceptions can only be raised as follows:
90 -- 1) A check constraint can only be violated during an INSERT or UPDATE
91 -- dml operation.
92 -- 2) A parent integrity constraint can only be violated during an
93 -- INSERT or UPDATE dml operation.
94 -- 3) A child integrity constraint can only be violated during an
95 -- DELETE dml operation.
96 -- 4) A unique integrity constraint can only be violated during INSERT or
97 -- UPDATE dml operation.
98 --
99 -- Prerequisites:
100 -- 1) Either hr_api.check_integrity_violated,
101 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
102 -- hr_api.unique_integrity_violated has been raised with the subsequent
103 -- stripping of the constraint name from the generated error message
104 -- text.
105 -- 2) Standalone validation test which corresponds with a constraint error.
106 --
107 -- In Parameter:
108 -- p_constraint_name is in upper format and is just the constraint name
109 -- (e.g. not prefixed by brackets, schema owner etc).
110 --
111 -- Post Success:
112 -- Development dependant.
113 --
114 -- Post Failure:
115 -- Developement dependant.
116 --
117 -- Developer Implementation Notes:
118 -- For each constraint being checked the hr system package failure message
119 -- has been generated as a template only. These system error messages should
120 -- be modified as required (i.e. change the system failure message to a user
121 -- friendly defined error message).
122 --
123 -- Access Status:
124 -- Internal Development Use Only.
125 --
126 -- {End Of Comments}
127 -- ----------------------------------------------------------------------------
128 Procedure constraint_error
129 (p_constraint_name in all_constraints.constraint_name%TYPE);
130 --
131 -- ----------------------------------------------------------------------------
132 -- |-----------------------------< api_updating >-----------------------------|
133 -- ----------------------------------------------------------------------------
134 -- {Start Of Comments}
135 --
136 -- Description:
137 -- This function is used to populate the g_old_rec record with the
138 -- current row from the database for the specified primary key
139 -- provided that the primary key exists and is valid and does not
140 -- already match the current g_old_rec. The function will always return
141 -- a TRUE value if the g_old_rec is populated with the current row.
142 -- A FALSE value will be returned if all of the primary key arguments
143 -- are null.
144 --
145 -- Prerequisites:
146 -- None.
147 --
148 -- In Parameters:
149 --
150 -- Post Success:
151 -- A value of TRUE will be returned indiciating that the g_old_rec
152 -- is current.
153 -- A value of FALSE will be returned if all of the primary key arguments
154 -- have a null value (this indicates that the row has not be inserted into
155 -- the Schema), and therefore could never have a corresponding row.
156 --
157 -- Post Failure:
158 -- A failure can only occur under two circumstances:
159 -- 1) The primary key is invalid (i.e. a row does not exist for the
160 -- specified primary key values).
161 -- 2) If an object_version_number exists but is NOT the same as the current
162 -- g_old_rec value.
163 --
164 -- Developer Implementation Notes:
165 -- None.
166 --
167 -- Access Status:
168 -- Internal Development Use Only.
169 --
170 -- {End Of Comments}
171 -- ----------------------------------------------------------------------------
172 Function api_updating
173 (p_template_id in number
174 ,p_object_version_number in number
175 ) Return Boolean;
176 --
177 -- ----------------------------------------------------------------------------
178 -- |---------------------------------< lck >----------------------------------|
179 -- ----------------------------------------------------------------------------
180 -- {Start of comments}
181 --
182 -- Description:
183 -- The Lck process has two main functions to perform. Firstly, the row to be
184 -- updated or deleted must be locked. The locking of the row will only be
185 -- successful if the row is not currently locked by another user.
186 -- Secondly, during the locking of the row, the row is selected into
187 -- the g_old_rec data structure which enables the current row values from
188 -- the server to be available to the api.
189 --
190 -- Prerequisites:
191 -- When attempting to call the lock the object version number (if defined)
192 -- is mandatory.
193 --
194 -- In Parameters:
195 -- The arguments to the Lck process are the primary key(s) which uniquely
196 -- identify the row and the object version number of row.
197 --
198 -- Post Success:
199 -- On successful completion of the Lck process the row to be updated or
200 -- deleted will be locked and selected into the global data structure
201 -- g_old_rec.
202 --
203 -- Post Failure:
204 -- The Lck process can fail for three reasons:
205 -- 1) When attempting to lock the row the row could already be locked by
206 -- another user. This will raise the HR_Api.Object_Locked exception.
207 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
208 -- This error is trapped and reported using the message name
209 -- 'HR_7220_INVALID_PRIMARY_KEY'.
210 -- 3) The row although existing in the HR Schema has a different object
211 -- version number than the object version number specified.
212 -- This error is trapped and reported using the message name
213 -- 'HR_7155_OBJECT_INVALID'.
214 --
215 -- Developer Implementation Notes:
219 --
216 -- For each primary key and the object version number arguments add a
217 -- call to hr_api.mandatory_arg_error procedure to ensure that these
218 -- argument values are not null.
220 -- Access Status:
221 -- Internal Development Use Only.
222 --
223 -- {End of comments}
224 -- ----------------------------------------------------------------------------
225 Procedure lck
226 (p_template_id in number
227 ,p_object_version_number in number
228 );
229 --
230 -- ----------------------------------------------------------------------------
231 -- |-----------------------------< convert_args >-----------------------------|
232 -- ----------------------------------------------------------------------------
233 -- {Start Of Comments}
234 --
235 -- Description:
236 -- This function is used to turn attribute parameters into the record
237 -- structure parameter g_rec_type.
238 --
239 -- Prerequisites:
240 -- This is a private function and can only be called from the ins or upd
241 -- attribute processes.
242 --
243 -- In Parameters:
244 --
245 -- Post Success:
246 -- A returning record structure will be returned.
247 --
248 -- Post Failure:
249 -- No direct error handling is required within this function. Any possible
250 -- errors within this function will be a PL/SQL value error due to
251 -- conversion of datatypes or data lengths.
252 --
253 -- Developer Implementation Notes:
254 -- None.
255 --
256 -- Access Status:
257 -- Internal Row Handler Use Only.
258 --
259 -- {End Of Comments}
260 -- ----------------------------------------------------------------------------
261 Function convert_args
262 (p_template_id in number
263 ,p_template_name in varchar2
264 ,p_business_group_id in number
265 ,p_set_of_books_id in number
266 ,p_object_version_number in number
267 ,p_report_type in varchar2
268 ,p_period_frequency_id in number
269 ,p_report_template_code in varchar2
270 ,p_display_all_emp_distrib_flag in varchar2
271 ,p_manual_entry_override_flag in varchar2
272 ,p_approval_type in varchar2
273 ,p_custom_approval_code in varchar2
274 ,p_sup_levels in number
275 ,p_preview_effort_report_flag in varchar2
276 ,p_notification_reminder_in_day in number
277 ,p_sprcd_tolerance_amt in number
278 ,p_sprcd_tolerance_percent in number
279 ,p_description in varchar2
280 ,p_legislation_code in varchar2
281 ,p_hundred_pcent_eff_at_per_asg in varchar2
282 ,p_selection_match_level in varchar2
283 )
284 Return g_rec_type;
285 --
286 end psp_prt_shd;