DBA Data[Home] [Help]

PACKAGE: APPS.PQH_TAH_SHD

Source


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