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