DBA Data[Home] [Help]

PACKAGE: APPS.OTA_CPR_SHD

Source


1 Package ota_cpr_shd as
2 /* $Header: otcprrhi.pkh 120.0.12000000.1 2007/01/18 04:07:15 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (activity_version_id             number(9)
10   ,prerequisite_course_id          number(9)
11   ,business_group_id               number(15)
12   ,prerequisite_type               varchar2(30)
13   ,enforcement_mode                varchar2(30)
14   ,object_version_number           number(9)
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) := 'OTA_COURSE_PREREQUISITES';
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_activity_version_id                  in     number
120   ,p_prerequisite_course_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
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_activity_version_id                  in     number
174   ,p_prerequisite_course_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
199 --   conversion 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   (p_activity_version_id            in number
211   ,p_prerequisite_course_id         in number
212   ,p_business_group_id              in number
213   ,p_prerequisite_type              in varchar2
214   ,p_enforcement_mode               in varchar2
215   ,p_object_version_number          in number
216   )
217   Return g_rec_type;
218 --
219 end ota_cpr_shd;