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