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