DBA Data[Home] [Help]

PACKAGE: APPS.PQH_CET_SHD

Source


1 Package pqh_cet_shd as
2 /* $Header: pqcetrhi.pkh 120.2 2005/10/01 10:57:00 scnair noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (
10   copy_entity_txn_id                number(15),
11   transaction_category_id           number(15),
12   txn_category_attribute_id         number(15),
13   context_business_group_id         number(15),
14   datetrack_mode                    varchar2(30),
15   context                           varchar2(27),
16   action_date                       date ,
17   src_effective_date                date ,
18   number_of_copies                  number(15),
19   display_name                      varchar2(100),
20   replacement_type_cd               varchar2(30),
21   start_with                        varchar2(255),
22   increment_by                      number(15),
23   status                            varchar2(30),
24   object_version_number             number(9)
25   );
26 --
27 -- ----------------------------------------------------------------------------
28 -- |           Global Definitions - Internal Development Use Only             |
29 -- ----------------------------------------------------------------------------
30 --
31 g_old_rec  g_rec_type;                            -- Global record definition
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   (
128   p_copy_entity_txn_id                 in number,
129   p_object_version_number              in number
130   )      Return Boolean;
131 --
132 -- ----------------------------------------------------------------------------
133 -- |---------------------------------< lck >----------------------------------|
134 -- ----------------------------------------------------------------------------
135 -- {Start Of Comments}
136 --
137 -- Description:
138 --   The Lck process has two main functions to perform. Firstly, the row to be
139 --   updated or deleted must be locked. The locking of the row will only be
140 --   successful if the row is not currently locked by another user.
141 --   Secondly, during the locking of the row, the row is selected into
142 --   the g_old_rec data structure which enables the current row values from the
143 --   server to be available to the api.
144 --
145 -- Prerequisites:
146 --   When attempting to call the lock the object version number (if defined)
147 --   is mandatory.
148 --
149 -- In Parameters:
150 --   The arguments to the Lck process are the primary key(s) which uniquely
151 --   identify the row and the object version number of row.
152 --
153 -- Post Success:
154 --   On successful completion of the Lck process the row to be updated or
155 --   deleted will be locked and selected into the global data structure
156 --   g_old_rec.
157 --
158 -- Post Failure:
159 --   The Lck process can fail for three reasons:
160 --   1) When attempting to lock the row the row could already be locked by
161 --      another user. This will raise the HR_Api.Object_Locked exception.
162 --   2) The row which is required to be locked doesn't exist in the HR Schema.
163 --      This error is trapped and reported using the message name
164 --      'HR_7220_INVALID_PRIMARY_KEY'.
165 --   3) The row although existing in the HR Schema has a different object
166 --      version number than the object version number specified.
167 --      This error is trapped and reported using the message name
168 --      'HR_7155_OBJECT_INVALID'.
169 --
170 -- Developer Implementation Notes:
171 --   For each primary key and the object version number arguments add a
172 --   call to hr_api.mandatory_arg_error procedure to ensure that these
173 --   argument values are not null.
174 --
175 -- Access Status:
176 --   Internal Development Use Only.
177 --
178 -- {End Of Comments}
179 -- ----------------------------------------------------------------------------
180 Procedure lck
181   (
182   p_copy_entity_txn_id                 in number,
183   p_object_version_number              in number
184   );
185 --
186 -- ----------------------------------------------------------------------------
187 -- |-----------------------------< convert_args >-----------------------------|
188 -- ----------------------------------------------------------------------------
189 -- {Start Of Comments}
190 --
191 -- Description:
192 --   This function is used to turn attribute parameters into the record
193 --   structure parameter g_rec_type.
194 --
195 -- Prerequisites:
196 --   This is a private function and can only be called from the ins or upd
197 --   attribute processes.
198 --
199 -- In Parameters:
200 --
201 -- Post Success:
202 --   A returning record structure will be returned.
203 --
204 -- Post Failure:
205 --   No direct error handling is required within this function. Any possible
206 --   errors within this function will be a PL/SQL value error due to conversion
207 --   of datatypes or data lengths.
208 --
209 -- Developer Implementation Notes:
210 --   None.
211 --
212 -- Access Status:
213 --   Internal Row Handler Use Only.
214 --
215 -- {End Of Comments}
216 -- ----------------------------------------------------------------------------
217 Function convert_args
218 	(
219 	p_copy_entity_txn_id            in number,
220 	p_transaction_category_id       in number,
221 	p_txn_category_attribute_id          in number,
222 	p_context_business_group_id          in number,
223 	p_datetrack_mode                     in varchar2,
224 	p_context                       in varchar2,
225         p_action_date                   in  date,
226         p_src_effective_date            in  date,
227 	p_number_of_copies              in number,
228 	p_display_name                  in varchar2,
229 	p_replacement_type_cd           in varchar2,
230 	p_start_with                    in varchar2,
231 	p_increment_by                  in number,
232 	p_status                        in varchar2,
233 	p_object_version_number         in number
234 	)
235 	Return g_rec_type;
236 --
237 end pqh_cet_shd;