DBA Data[Home] [Help]

PACKAGE: APPS.PQH_WKS_SHD

Source


1 Package pqh_wks_shd AUTHID CURRENT_USER as
2 /* $Header: pqwksrhi.pkh 120.0 2005/05/29 03:01:51 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (
10   worksheet_id                      number(10),
11   budget_id                         number(15),
12   worksheet_name                    varchar2(240),
13   version_number                    number(15),
14   action_date                       date,
15   date_from                         date,
16   date_to                           date,
17   worksheet_mode_cd                 varchar2(30),
18   transaction_status                            varchar2(10),
19   object_version_number             number(9),
20   budget_version_id                 number(15),
21   propagation_method                varchar2(9),
22   wf_transaction_category_id        number(15)
23   );
24 --
25 -- ----------------------------------------------------------------------------
26 -- |           Global Definitions - Internal Development Use Only             |
27 -- ----------------------------------------------------------------------------
28 --
29 g_old_rec  g_rec_type;                            -- Global record definition
30 --
31 --
32 -- ----------------------------------------------------------------------------
33 -- |---------------------------< constraint_error >---------------------------|
34 -- ----------------------------------------------------------------------------
35 -- {Start Of Comments}
36 --
37 -- Description:
38 --   This procedure is called when a constraint has been violated (i.e.
39 --   The exception hr_api.check_integrity_violated,
40 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
41 --   hr_api.unique_integrity_violated has been raised).
42 --   The exceptions can only be raised as follows:
43 --   1) A check constraint can only be violated during an INSERT or UPDATE
44 --      dml operation.
45 --   2) A parent integrity constraint can only be violated during an
46 --      INSERT or UPDATE dml operation.
47 --   3) A child integrity constraint can only be violated during an
48 --      DELETE dml operation.
49 --   4) A unique integrity constraint can only be violated during INSERT or
50 --      UPDATE dml operation.
51 --
52 -- Prerequisites:
53 --   1) Either hr_api.check_integrity_violated,
54 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
55 --      hr_api.unique_integrity_violated has been raised with the subsequent
56 --      stripping of the constraint name from the generated error message
57 --      text.
58 --   2) Standalone validation test which corresponds with a constraint error.
59 --
60 -- In Parameter:
61 --   p_constraint_name is in upper format and is just the constraint name
62 --   (e.g. not prefixed by brackets, schema owner etc).
63 --
64 -- Post Success:
65 --   Development dependant.
66 --
67 -- Post Failure:
68 --   Developement dependant.
69 --
70 -- Developer Implementation Notes:
71 --   For each constraint being checked the hr system package failure message
72 --   has been generated as a template only. These system error messages should
73 --   be modified as required (i.e. change the system failure message to a user
74 --   friendly defined error message).
75 --
76 -- Access Status:
77 --   Internal Development Use Only.
78 --
79 -- {End Of Comments}
80 -- ----------------------------------------------------------------------------
81 Procedure constraint_error
82             (p_constraint_name in all_constraints.constraint_name%TYPE);
83 --
84 -- ----------------------------------------------------------------------------
85 -- |-----------------------------< api_updating >-----------------------------|
86 -- ----------------------------------------------------------------------------
87 -- {Start Of Comments}
88 --
89 -- Description:
90 --   This function is used to populate the g_old_rec record with the
91 --   current row from the database for the specified primary key
92 --   provided that the primary key exists and is valid and does not
93 --   already match the current g_old_rec. The function will always return
94 --   a TRUE value if the g_old_rec is populated with the current row.
95 --   A FALSE value will be returned if all of the primary key arguments
96 --   are null.
97 --
98 -- Prerequisites:
99 --   None.
100 --
101 -- In Parameters:
102 --
103 -- Post Success:
104 --   A value of TRUE will be returned indiciating that the g_old_rec
105 --   is current.
106 --   A value of FALSE will be returned if all of the primary key arguments
107 --   have a null value (this indicates that the row has not be inserted into
108 --   the Schema), and therefore could never have a corresponding row.
109 --
110 -- Post Failure:
111 --   A failure can only occur under two circumstances:
112 --   1) The primary key is invalid (i.e. a row does not exist for the
113 --      specified primary key values).
114 --   2) If an object_version_number exists but is NOT the same as the current
115 --      g_old_rec value.
116 --
117 -- Developer Implementation Notes:
118 --   None.
119 --
120 -- Access Status:
121 --   Internal Development Use Only.
122 --
123 -- {End Of Comments}
124 -- ----------------------------------------------------------------------------
125 Function api_updating
126   (
127   p_worksheet_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 the
142 --   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   (
181   p_worksheet_id                       in number,
182   p_object_version_number              in number
183   );
184 --
185 -- ----------------------------------------------------------------------------
186 -- |-----------------------------< convert_args >-----------------------------|
187 -- ----------------------------------------------------------------------------
188 -- {Start Of Comments}
189 --
190 -- Description:
191 --   This function is used to turn attribute parameters into the record
192 --   structure parameter g_rec_type.
193 --
194 -- Prerequisites:
195 --   This is a private function and can only be called from the ins or upd
196 --   attribute processes.
197 --
198 -- In Parameters:
199 --
200 -- Post Success:
201 --   A returning record structure will be returned.
202 --
203 -- Post Failure:
204 --   No direct error handling is required within this function. Any possible
205 --   errors within this function will be a PL/SQL value error due to conversion
206 --   of datatypes or data lengths.
207 --
208 -- Developer Implementation Notes:
209 --   None.
210 --
211 -- Access Status:
212 --   Internal Row Handler Use Only.
213 --
214 -- {End Of Comments}
215 -- ----------------------------------------------------------------------------
216 Function convert_args
217 	(
218 	p_worksheet_id                  in number,
219 	p_budget_id                     in number,
220 	p_worksheet_name                in varchar2,
221 	p_version_number                in number,
222 	p_action_date                   in date,
223 	p_date_from                     in date,
224 	p_date_to                       in date,
225 	p_worksheet_mode_cd             in varchar2,
226 	p_transaction_status                        in varchar2,
227 	p_object_version_number         in number,
228 	p_budget_version_id             in number,
229 	p_propagation_method            in varchar2,
230         p_wf_transaction_category_id    in number
231 	)
232 	Return g_rec_type;
233 --
234 end pqh_wks_shd;