[Home] [Help]
PACKAGE BODY: APPS.XLA_JLT_ACCT_ATTRS_F_PKG
Source
1 PACKAGE BODY xla_jlt_acct_attrs_f_pkg AS
2 /* $Header: xlatbass.pkb 120.6 2004/05/27 20:32:46 dcshah ship $ */
3 /*======================================================================+
4 | Copyright (c) 2001-2002 Oracle Corporation |
5 | Redwood Shores, CA, USA |
6 | All rights reserved. |
7 +=======================================================================+
8 | PACKAGE NAME |
9 | xla_jlt_acct_attrs_f_pkg |
10 | |
11 | DESCRIPTION |
12 | Forms PL/SQL Wrapper for xla_jlt_acct_attrs |
13 | |
14 | HISTORY |
15 | 05/22/01 Dimple Shah Created |
16 | |
17 +======================================================================*/
18
19
20
21 /*======================================================================+
22 | |
23 | Procedure insert_row |
24 | |
25 +======================================================================*/
26 PROCEDURE insert_row
27 (x_rowid IN OUT NOCOPY VARCHAR2
28 ,x_application_id IN NUMBER
29 ,x_amb_context_code IN VARCHAR2
30 ,x_event_class_code IN VARCHAR2
31 ,x_accounting_line_type_code IN VARCHAR2
32 ,x_accounting_line_code IN VARCHAR2
33 ,x_accounting_attribute_code IN VARCHAR2
34 ,x_source_application_id IN NUMBER
35 ,x_source_type_code IN VARCHAR2
36 ,x_source_code IN VARCHAR2
37 ,x_event_class_default_flag IN VARCHAR2
38 ,x_creation_date IN DATE
39 ,x_created_by IN NUMBER
40 ,x_last_update_date IN DATE
41 ,x_last_updated_by IN NUMBER
42 ,x_last_update_login IN NUMBER)
43
44 IS
45
46 CURSOR c IS
47 SELECT rowid
48 FROM xla_jlt_acct_attrs
49 WHERE application_id = x_application_id
50 AND amb_context_code = x_amb_context_code
51 AND event_class_code = x_event_class_code
52 AND accounting_line_type_code = x_accounting_line_type_code
53 AND accounting_line_code = x_accounting_line_code
54 AND accounting_attribute_code = x_accounting_attribute_code
55 ;
56
57 BEGIN
58 xla_utility_pkg.trace('> .insert_row' ,20);
59
60 INSERT INTO xla_jlt_acct_attrs
61 (creation_date
62 ,created_by
63 ,application_id
64 ,amb_context_code
65 ,event_class_code
66 ,accounting_line_type_code
67 ,accounting_line_code
68 ,accounting_attribute_code
69 ,source_application_id
70 ,source_type_code
71 ,source_code
72 ,last_update_date
73 ,last_updated_by
74 ,last_update_login)
75 VALUES
76 (x_creation_date
77 ,x_created_by
78 ,x_application_id
79 ,x_amb_context_code
80 ,x_event_class_code
81 ,x_accounting_line_type_code
82 ,x_accounting_line_code
83 ,x_accounting_attribute_code
84 ,x_source_application_id
85 ,x_source_type_code
86 ,x_source_code
87 ,x_last_update_date
88 ,x_last_updated_by
89 ,x_last_update_login)
90 ;
91
92 OPEN c;
93 FETCH c INTO x_rowid;
94
95 IF (c%NOTFOUND) THEN
96 CLOSE c;
97 RAISE NO_DATA_FOUND;
98 END IF;
99 CLOSE c;
100
101 xla_utility_pkg.trace('< .insert_row' ,20);
102 END insert_row;
103
104 /*======================================================================+
105 | |
106 | Procedure lock_row |
107 | |
108 +======================================================================*/
109 PROCEDURE lock_row
110 (x_rowid IN OUT NOCOPY VARCHAR2
111 ,x_application_id IN NUMBER
112 ,x_amb_context_code IN VARCHAR2
113 ,x_event_class_code IN VARCHAR2
114 ,x_accounting_line_type_code IN VARCHAR2
115 ,x_accounting_line_code IN VARCHAR2
116 ,x_accounting_attribute_code IN VARCHAR2
117 ,x_source_application_id IN NUMBER
118 ,x_source_type_code IN VARCHAR2
119 ,x_source_code IN VARCHAR2
120 ,x_event_class_default_flag IN VARCHAR2)
121
122 IS
123
124 CURSOR c IS
125 SELECT application_id
126 ,amb_context_code
127 ,event_class_code
128 ,accounting_line_type_code
129 ,accounting_line_code
130 ,accounting_attribute_code
131 ,source_application_id
132 ,source_type_code
133 ,source_code
134 ,event_class_default_flag
135 FROM xla_jlt_acct_attrs
136 WHERE application_id = x_application_id
137 AND amb_context_code = x_amb_context_code
138 AND event_class_code = x_event_class_code
139 AND accounting_line_type_code = x_accounting_line_type_code
140 AND accounting_line_code = x_accounting_line_code
141 AND accounting_attribute_code = x_accounting_attribute_code
142 FOR UPDATE OF application_id NOWAIT;
143
144 recinfo c%ROWTYPE;
145
146 BEGIN
147 xla_utility_pkg.trace('> .lock_row' ,20);
148
149 OPEN c;
150 FETCH c INTO recinfo;
151
152 IF (c%NOTFOUND) THEN
153 CLOSE c;
154 fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
155 app_exception.raise_exception;
156 END IF;
157 CLOSE c;
158
159 IF ( (recinfo.application_id = x_application_id)
160 AND (recinfo.amb_context_code = x_amb_context_code)
161 AND (recinfo.event_class_code = x_event_class_code)
162 AND (recinfo.accounting_line_type_code = x_accounting_line_type_code)
163 AND (recinfo.accounting_line_code = x_accounting_line_code)
164 AND (recinfo.accounting_attribute_code = x_accounting_attribute_code)
168 AND (x_source_application_id IS NULL)))
165 AND (recinfo.event_class_default_flag = x_event_class_default_flag)
166 AND ((recinfo.source_application_id = X_source_application_id)
167 OR ((recinfo.source_application_id IS NULL)
169 AND ((recinfo.source_type_code = X_source_type_code)
170 OR ((recinfo.source_type_code IS NULL)
171 AND (x_source_type_code IS NULL)))
172 AND ((recinfo.source_code = X_source_code)
173 OR ((recinfo.source_code IS NULL)
174 AND (x_source_code IS NULL)))
175
176 ) THEN
177 null;
178 ELSE
179 fnd_message.set_name('FND', 'FORM_RECORD_CHANGED');
180 app_exception.raise_exception;
181 END IF;
182
183 xla_utility_pkg.trace('< .lock_row' ,20);
184 RETURN;
185
186 END lock_row;
187
188 /*======================================================================+
189 | |
190 | Procedure update_row |
191 | |
192 +======================================================================*/
193 PROCEDURE update_row
194 (x_rowid IN OUT NOCOPY VARCHAR2
195 ,x_application_id IN NUMBER
196 ,x_amb_context_code IN VARCHAR2
197 ,x_event_class_code IN VARCHAR2
198 ,x_accounting_line_type_code IN VARCHAR2
199 ,x_accounting_line_code IN VARCHAR2
200 ,x_accounting_attribute_code IN VARCHAR2
201 ,x_source_application_id IN NUMBER
202 ,x_source_type_code IN VARCHAR2
203 ,x_source_code IN VARCHAR2
204 ,x_event_class_default_flag IN VARCHAR2
205 ,x_last_update_date IN DATE
206 ,x_last_updated_by IN NUMBER
207 ,x_last_update_login IN NUMBER)
208 IS
209
210 BEGIN
211 xla_utility_pkg.trace('> .update_row' ,20);
212 UPDATE xla_jlt_acct_attrs
213 SET
214 last_update_date = x_last_update_date
215 ,source_application_id = x_source_application_id
216 ,source_type_code = x_source_type_code
217 ,source_code = x_source_code
218 ,event_class_default_flag = x_event_class_default_flag
219 ,last_updated_by = x_last_updated_by
220 ,last_update_login = x_last_update_login
221 WHERE application_id = X_application_id
222 AND amb_context_code = x_amb_context_code
223 AND event_class_code = x_event_class_code
224 AND accounting_line_type_code = x_accounting_line_type_code
225 AND accounting_line_code = x_accounting_line_code
226 AND accounting_attribute_code = x_accounting_attribute_code;
227
228 IF (SQL%NOTFOUND) THEN
229 RAISE NO_DATA_FOUND;
230 END IF;
231
232 xla_utility_pkg.trace('< .update_row' ,20);
233 END update_row;
234
235 /*======================================================================+
236 | |
237 | Procedure delete_row |
238 | |
239 +======================================================================*/
240 PROCEDURE delete_row
241 (x_application_id IN NUMBER
242 ,x_amb_context_code IN VARCHAR2
243 ,x_event_class_code IN VARCHAR2
244 ,x_accounting_line_type_code IN VARCHAR2
245 ,x_accounting_line_code IN VARCHAR2
246 ,x_accounting_attribute_code IN VARCHAR2)
247
248 IS
249
250 BEGIN
251 xla_utility_pkg.trace('> .delete_row' ,20);
252 DELETE FROM xla_jlt_acct_attrs
253 WHERE application_id = x_application_id
254 AND amb_context_code = x_amb_context_code
255 AND event_class_code = x_event_class_code
256 AND accounting_line_type_code = x_accounting_line_type_code
257 AND accounting_line_code = x_accounting_line_code
258 AND accounting_attribute_code = x_accounting_attribute_code;
259
260 IF (SQL%NOTFOUND) THEN
261 RAISE NO_DATA_FOUND;
262 END IF;
263
264 xla_utility_pkg.trace('< .delete_row' ,20);
265 END delete_row;
266
267 end xla_jlt_acct_attrs_f_pkg;