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