DBA Data[Home] [Help]
Skip to content

PACKAGE: APPS.HXC_TKS_SHD

Source


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