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