DBA Data[Home] [Help]

PACKAGE: APPS.OTA_CTU_SHD

Source


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