DBA Data[Home] [Help]

PACKAGE: APPS.GHR_PRE_SHD

Source


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