DBA Data[Home] [Help]

PACKAGE: APPS.FF_FFP_SHD

Source


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