DBA Data[Home] [Help]

PACKAGE: APPS.OTA_FRM_SHD

Source


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