1 Package pay_pbd_shd as
2 /* $Header: pypbdrhi.pkh 120.0 2005/05/29 07:21:24 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (bal_attribute_default_id number(9)
10 ,attribute_id number(9)
11 ,balance_dimension_id number(9)
12 ,balance_category_id number(9)
13 ,legislation_code varchar2(30)
14 ,business_group_id number(15)
15 );
16 --
17 -- ----------------------------------------------------------------------------
18 -- | Global Definitions - Internal Development Use Only |
19 -- ----------------------------------------------------------------------------
20 --
21 g_old_rec g_rec_type; -- Global record definition
22 -- Global table name
23 g_tab_nam constant varchar2(30) := 'PAY_BAL_ATTRIBUTE_DEFAULTS';
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 (p_bal_attribute_default_id in number
120 ) Return Boolean;
121 --
122 -- ----------------------------------------------------------------------------
123 -- |---------------------------------< lck >----------------------------------|
124 -- ----------------------------------------------------------------------------
125 -- {Start of comments}
126 --
127 -- Description:
128 -- The Lck process has two main functions to perform. Firstly, the row to be
129 -- updated or deleted must be locked. The locking of the row will only be
130 -- successful if the row is not currently locked by another user.
131 -- Secondly, during the locking of the row, the row is selected into
132 -- the g_old_rec data structure which enables the current row values from
133 -- the server to be available to the api.
134 --
135 -- Prerequisites:
136 -- When attempting to call the lock the object version number (if defined)
137 -- is mandatory.
138 --
139 -- In Parameters:
140 -- The arguments to the Lck process are the primary key(s) which uniquely
141 -- identify the row and the object version number of row.
142 --
143 -- Post Success:
144 -- On successful completion of the Lck process the row to be updated or
145 -- deleted will be locked and selected into the global data structure
146 -- g_old_rec.
147 --
148 -- Post Failure:
149 -- The Lck process can fail for three reasons:
150 -- 1) When attempting to lock the row the row could already be locked by
151 -- another user. This will raise the HR_Api.Object_Locked exception.
152 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
153 -- This error is trapped and reported using the message name
154 -- 'HR_7220_INVALID_PRIMARY_KEY'.
155 -- 3) The row although existing in the HR Schema has a different object
156 -- version number than the object version number specified.
157 -- This error is trapped and reported using the message name
158 -- 'HR_7155_OBJECT_INVALID'.
159 --
160 -- Developer Implementation Notes:
161 -- For each primary key and the object version number arguments add a
162 -- call to hr_api.mandatory_arg_error procedure to ensure that these
163 -- argument values are not null.
164 --
165 -- Access Status:
166 -- Internal Development Use Only.
167 --
168 -- {End of comments}
169 -- ----------------------------------------------------------------------------
170 Procedure lck
171 (p_bal_attribute_default_id in number
172 );
173 --
174 -- ----------------------------------------------------------------------------
175 -- |-----------------------------< convert_args >-----------------------------|
176 -- ----------------------------------------------------------------------------
177 -- {Start Of Comments}
178 --
179 -- Description:
180 -- This function is used to turn attribute parameters into the record
181 -- structure parameter g_rec_type.
182 --
183 -- Prerequisites:
184 -- This is a private function and can only be called from the ins or upd
185 -- attribute processes.
186 --
187 -- In Parameters:
188 --
189 -- Post Success:
190 -- A returning record structure will be returned.
191 --
192 -- Post Failure:
193 -- No direct error handling is required within this function. Any possible
194 -- errors within this function will be a PL/SQL value error due to
195 -- conversion of datatypes or data lengths.
196 --
197 -- Developer Implementation Notes:
198 -- None.
199 --
200 -- Access Status:
201 -- Internal Row Handler Use Only.
202 --
203 -- {End Of Comments}
204 -- ----------------------------------------------------------------------------
205 Function convert_args
206 (p_bal_attribute_default_id in number
207 ,p_attribute_id in number
208 ,p_balance_dimension_id in number
209 ,p_balance_category_id in number
210 ,p_legislation_code in varchar2
211 ,p_business_group_id in number
212 )
213 Return g_rec_type;
214 --
215 end pay_pbd_shd;