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