DBA Data[Home] [Help]

PACKAGE: APPS.HXC_ERR_SHD

Source


1 Package hxc_err_shd as
2 /* $Header: hxcerrrhi.pkh 120.0.12010000.2 2008/08/05 12:01:57 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (error_id                        number(15)
10   ,transaction_detail_id           number(15)
11   ,time_building_block_id          number(15)
12   ,time_building_block_ovn         number(9)
13   ,time_attribute_id               number(15)
14   ,time_attribute_ovn              number(9)
15   ,message_name                    varchar2(30)
16   ,message_level                   varchar2(30)
17   ,message_field                   varchar2(80)
18   ,message_tokens                  varchar2(4000)
19   ,application_short_name          varchar2(50)
20   ,object_version_number           number(9)
21   ,date_from		           date
22   ,date_to		           date
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) := 'HXC_ERRORS';
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_error_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_error_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_error_id                       in number
217 ,p_transaction_detail_id          in number
218 ,p_time_building_block_id         in number
219 ,p_time_building_block_ovn        in number
220 ,p_time_attribute_id              in number
221 ,p_time_attribute_ovn             in number
222 ,p_message_name                   in varchar2
223 ,p_message_level                  in varchar2
224 ,p_message_field                  in varchar2
225 ,p_message_tokens                 in varchar2
226 ,p_application_short_name         in varchar2
227 ,p_object_version_number          in number
228 ,p_date_from		          in date
229 ,p_date_to		          in date
230 )
231 Return g_rec_type;
232 --
233 end hxc_err_shd;