DBA Data[Home] [Help]

PACKAGE: APPS.HXC_MCU_SHD

Source


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