[Home] [Help]
PACKAGE BODY: APPS.OKL_FA_EXTENSION_PVT
Source
1 PACKAGE BODY OKL_FA_EXTENSION_PVT AS
2 /* $Header: OKLCFXHB.pls 120.1 2007/08/06 13:47:23 prasjain noship $ */
3
4 ----------------------------------------------------------------------------------
5 -- Start of comments
6 --
7 -- Procedure Name : create_fxh_extension
8 -- Description : wrapper api for creating Transaction Extension
9 -- Business Rules :
10 -- Parameters : p_api_version ,p_init_msg_list,x_return_status
11 -- ,x_msg_count ,x_msg_data ,p_fxhv_rec, p_fxlv_tbl
12 -- ,x_fxhv_rec, x_fxlv_tbl
13 -- Version : 1.0
14 -- End of comments
15 ----------------------------------------------------------------------------------
16 PROCEDURE create_fxh_extension(
17 p_api_version IN NUMBER
18 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
19 ,x_return_status OUT NOCOPY VARCHAR2
20 ,x_msg_count OUT NOCOPY NUMBER
21 ,x_msg_data OUT NOCOPY VARCHAR2
22 ,p_fxhv_rec IN fxhv_rec_type
23 ,p_fxlv_tbl IN fxlv_tbl_type
24 ,x_fxhv_rec OUT NOCOPY fxhv_rec_type
25 ,x_fxlv_tbl OUT NOCOPY fxlv_tbl_type
26 )
27 IS
28 i NUMBER;
29 l_fxhv_rec fxhv_rec_type;
30 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
31 l_fxlv_tbl fxlv_tbl_type := p_fxlv_tbl;
32 BEGIN
33 -- Populate TRX EXTENSION
34 create_fxh_extension(
35 p_api_version => p_api_version
36 ,p_init_msg_list => p_init_msg_list
37 ,x_return_status => x_return_status
38 ,x_msg_count => x_msg_count
39 ,x_msg_data => x_msg_data
40 ,p_fxhv_rec => p_fxhv_rec
41 ,x_fxhv_rec => x_fxhv_rec);
42 IF x_return_status = OKC_API.G_RET_STS_SUCCESS
43 THEN
44 -- populate the foreign key for the detail
45 IF (l_fxlv_tbl.COUNT > 0)
46 THEN
47 i:= l_fxlv_tbl.FIRST;
48 LOOP
49 l_fxlv_tbl(i).header_extension_id := x_fxhv_rec.header_extension_id;
50 EXIT WHEN(i = l_fxlv_tbl.LAST);
51 i := l_fxlv_tbl.NEXT(i);
52 END LOOP;
53 END IF;
54 -- populate the detail
55 create_fxl_extension(
56 p_api_version => p_api_version
57 ,p_init_msg_list => p_init_msg_list
58 ,x_return_status => x_return_status
59 ,x_msg_count => x_msg_count
60 ,x_msg_data => x_msg_data
61 ,p_fxlv_tbl => l_fxlv_tbl
62 ,x_fxlv_tbl => x_fxlv_tbl);
63 END IF;
64 EXCEPTION
65 WHEN G_EXCEPTION_HALT_VALIDATION
66 THEN
67 NULL;
68 WHEN OTHERS
69 THEN
70 OKC_API.SET_MESSAGE(
71 p_app_name => g_app_name
72 ,p_msg_name => g_unexpected_error
73 ,p_token1 => g_sqlcode_token
74 ,p_token1_value => sqlcode
75 ,p_token2 => g_sqlerrm_token
76 ,p_token2_value => sqlerrm);
77 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
78 END create_fxh_extension;
79
80 ----------------------------------------------------------------------------------
81 -- Start of comments
82 --
83 -- Procedure Name : create_fxh_extension
84 -- Description : wrapper api for creating Transaction Extension Header
85 -- Business Rules :
86 -- Parameters : p_api_version, p_init_msg_list, x_return_status
87 -- ,x_msg_count, x_msg_data, p_fxhv_rec, x_fxhv_rec
88 -- Version : 1.0
89 -- End of comments
90 ----------------------------------------------------------------------------------
91 PROCEDURE create_fxh_extension(
92 p_api_version IN NUMBER
93 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
94 ,x_return_status OUT NOCOPY VARCHAR2
95 ,x_msg_count OUT NOCOPY NUMBER
96 ,x_msg_data OUT NOCOPY VARCHAR2
97 ,p_fxhv_rec IN fxhv_rec_type
98 ,x_fxhv_rec OUT NOCOPY fxhv_rec_type) IS
99 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
100 BEGIN
101 okl_fxh_pvt.insert_row(
102 p_api_version => p_api_version
103 ,p_init_msg_list => p_init_msg_list
104 ,x_return_status => x_return_status
105 ,x_msg_count => x_msg_count
106 ,x_msg_data => x_msg_data
107 ,p_fxhv_rec => p_fxhv_rec
108 ,x_fxhv_rec => x_fxhv_rec);
109
110 IF x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR
111 THEN
112 RAISE G_EXCEPTION_HALT_VALIDATION;
113 ELSE
114 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS
115 THEN
116 l_return_status := x_return_status;
117 END IF;
118 END IF;
119 -- Custom code if any
120 EXCEPTION
121 WHEN G_EXCEPTION_HALT_VALIDATION
122 THEN
123 NULL;
124 WHEN OTHERS
125 THEN
126 OKC_API.SET_MESSAGE(p_app_name => g_app_name
127 ,p_msg_name => g_unexpected_error
128 ,p_token1 => g_sqlcode_token
129 ,p_token1_value => sqlcode
130 ,p_token2 => g_sqlerrm_token
131 ,p_token2_value => sqlerrm);
132 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
133 END create_fxh_extension;
134
135 ----------------------------------------------------------------------------------
136 -- Start of comments
137 --
138 -- Procedure Name : create_fxh_extension
139 -- Description : wrapper api for creating a table of records for
140 -- Transaction Extension Header
141 -- Business Rules :
142 -- Parameters : p_api_version, p_init_msg_list, x_return_status
143 -- ,x_msg_count, x_msg_data, p_fxhv_tbl, x_fxhv_tbl
144 -- Version : 1.0
145 -- End of comments
146 ----------------------------------------------------------------------------------
147 PROCEDURE create_fxh_extension(
148 p_api_version IN NUMBER
149 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
150 ,x_return_status OUT NOCOPY VARCHAR2
151 ,x_msg_count OUT NOCOPY NUMBER
152 ,x_msg_data OUT NOCOPY VARCHAR2
153 ,p_fxhv_tbl IN fxhv_tbl_type
154 ,x_fxhv_tbl OUT NOCOPY fxhv_tbl_type) IS
155 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
156 l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
157 i NUMBER := 0;
158 BEGIN
159 Okc_Api.init_msg_list(p_init_msg_list);
160 -- Make sure PL/SQL table has records in it before passing
161 IF (p_fxhv_tbl.COUNT > 0)
162 THEN
163 i := p_fxhv_tbl.FIRST;
164 LOOP
165 create_fxh_extension(
166 p_api_version => p_api_version
167 ,p_init_msg_list => Okc_Api.G_FALSE
168 ,x_return_status => x_return_status
169 ,x_msg_count => x_msg_count
170 ,x_msg_data => x_msg_data
171 ,p_fxhv_rec => p_fxhv_tbl(i)
172 ,x_fxhv_rec => x_fxhv_tbl(i));
173 -- store the highest degree of error
174 IF x_return_status <> Okc_Api.G_RET_STS_SUCCESS
175 THEN
176 IF l_overall_status <> Okc_Api.G_RET_STS_UNEXP_ERROR
177 THEN
178 l_overall_status := x_return_status;
179 END IF;
180 END IF;
181 EXIT WHEN (i = p_fxhv_tbl.LAST);
182 i := p_fxhv_tbl.NEXT(i);
183 END LOOP;
184 END IF;
185 x_return_status := l_overall_status;
186 EXCEPTION
187 WHEN G_EXCEPTION_HALT_VALIDATION
188 THEN
189 NULL;
190 WHEN OTHERS
191 THEN
192 OKC_API.SET_MESSAGE(
193 p_app_name => g_app_name
194 ,p_msg_name => g_unexpected_error
195 ,p_token1 => g_sqlcode_token
196 ,p_token1_value => sqlcode
197 ,p_token2 => g_sqlerrm_token
198 ,p_token2_value => sqlerrm);
199 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
200 END create_fxh_extension;
201
202 ----------------------------------------------------------------------------------
203 -- Start of comments
204 --
205 -- Procedure Name : update_fxh_extension
206 -- Description : wrapper api for updating Transaction Extension
207 -- Business Rules :
208 -- Parameters : p_api_version, p_init_msg_list, x_return_status
209 -- ,x_msg_count, x_msg_data, p_fxhv_rec, p_fxlv_tbl,
210 -- ,x_fxhv_rec, x_fxlv_tbl
211 -- Version : 1.0
212 -- End of comments
213 ----------------------------------------------------------------------------------
214 PROCEDURE update_fxh_extension(
215 p_api_version IN NUMBER,
216 p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE,
217 x_return_status OUT NOCOPY VARCHAR2,
218 x_msg_count OUT NOCOPY NUMBER,
219 x_msg_data OUT NOCOPY VARCHAR2,
220 p_fxhv_rec IN fxhv_rec_type,
221 p_fxlv_tbl IN fxlv_tbl_type,
222 x_fxhv_rec OUT NOCOPY fxhv_rec_type,
223 x_fxlv_tbl OUT NOCOPY fxlv_tbl_type) IS
224 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
225 BEGIN
226 -- Update the master
227 update_fxh_extension(
228 p_api_version => p_api_version
229 ,p_init_msg_list => p_init_msg_list
230 ,x_return_status => x_return_status
231 ,x_msg_count => x_msg_count
232 ,x_msg_data => x_msg_data
233 ,p_fxhv_rec => p_fxhv_rec
234 ,x_fxhv_rec => x_fxhv_rec);
235
236 IF (x_return_status = OKC_API.G_RET_STS_SUCCESS)
237 THEN
238 -- Update the detail
239 update_fxl_extension(
240 p_api_version => p_api_version
241 ,p_init_msg_list => p_init_msg_list
242 ,x_return_status => x_return_status
243 ,x_msg_count => x_msg_count
244 ,x_msg_data => x_msg_data
245 ,p_fxlv_tbl => p_fxlv_tbl
246 ,x_fxlv_tbl => x_fxlv_tbl);
247 END IF;
248 EXCEPTION
249 WHEN G_EXCEPTION_HALT_VALIDATION
250 THEN
251 NULL;
252 WHEN OTHERS
253 THEN
254 OKC_API.SET_MESSAGE(p_app_name => g_app_name
255 ,p_msg_name => g_unexpected_error
256 ,p_token1 => g_sqlcode_token
257 ,p_token1_value => sqlcode
258 ,p_token2 => g_sqlerrm_token
259 ,p_token2_value => sqlerrm);
260 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
261 END update_fxh_extension;
262
263 ----------------------------------------------------------------------------------
264 -- Start of comments
265 --
266 -- Procedure Name : validate_fxh_extension
267 -- Description : wrapper api for validating Transaction Extension
268 -- Business Rules :
269 -- Parameters : p_api_version, p_init_msg_list, x_return_status
270 -- ,x_msg_count, x_msg_data, p_fxhv_rec, p_fxlv_tbl
271 -- Version : 1.0
272 -- End of comments
273 ----------------------------------------------------------------------------------
274 PROCEDURE validate_fxh_extension(
275 p_api_version IN NUMBER
276 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
277 ,x_return_status OUT NOCOPY VARCHAR2
278 ,x_msg_count OUT NOCOPY NUMBER
279 ,x_msg_data OUT NOCOPY VARCHAR2
280 ,p_fxhv_rec IN fxhv_rec_type
281 ,p_fxlv_tbl IN fxlv_tbl_type) IS
282
283 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
284 l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
285 BEGIN
286 -- Validate the master
287 validate_fxh_extension(
288 p_api_version => p_api_version
289 ,p_init_msg_list => p_init_msg_list
290 ,x_return_status => x_return_status
291 ,x_msg_count => x_msg_count
292 ,x_msg_data => x_msg_data
293 ,p_fxhv_rec => p_fxhv_rec);
294
295 IF x_return_status <> Okc_Api.G_RET_STS_SUCCESS
296 THEN
297 IF l_overall_status <> Okc_Api.G_RET_STS_UNEXP_ERROR
298 THEN
299 l_overall_status := x_return_status;
300 END IF;
301 END IF;
302 -- Validate the detail
303 validate_fxl_extension(
304 p_api_version => p_api_version
305 ,p_init_msg_list => p_init_msg_list
306 ,x_return_status => x_return_status
307 ,x_msg_count => x_msg_count
308 ,x_msg_data => x_msg_data
309 ,p_fxlv_tbl => p_fxlv_tbl);
310 IF x_return_status <> Okc_Api.G_RET_STS_SUCCESS
311 THEN
312 IF l_overall_status <> Okc_Api.G_RET_STS_UNEXP_ERROR
313 THEN
314 l_overall_status := x_return_status;
315 END IF;
316 END IF;
317 x_return_status := l_overall_status;
318 EXCEPTION
319 WHEN G_EXCEPTION_HALT_VALIDATION THEN
320 NULL;
321 WHEN OTHERS THEN
322 OKC_API.SET_MESSAGE(p_app_name => g_app_name
323 ,p_msg_name => g_unexpected_error
324 ,p_token1 => g_sqlcode_token
325 ,p_token1_value => sqlcode
326 ,p_token2 => g_sqlerrm_token
327 ,p_token2_value => sqlerrm);
328 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
329
330 END validate_fxh_extension;
331
332 ----------------------------------------------------------------------------------
333 -- Start of comments
334 --
335 -- Procedure Name : lock_fxh_extension
336 -- Description : wrapper api for locking a record
337 -- Business Rules :
338 -- Parameters : p_api_version, p_init_msg_list, x_return_status
339 -- ,x_msg_count, x_msg_data, p_fxhv_rec
340 -- Version : 1.0
341 -- End of comments
342 ----------------------------------------------------------------------------------
343 PROCEDURE lock_fxh_extension(
344 p_api_version IN NUMBER
345 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
346 ,x_return_status OUT NOCOPY VARCHAR2
347 ,x_msg_count OUT NOCOPY NUMBER
348 ,x_msg_data OUT NOCOPY VARCHAR2
349 ,p_fxhv_rec IN fxhv_rec_type) IS
350 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
351 BEGIN
352 okl_fxh_pvt.lock_row(
353 p_api_version => p_api_version
354 ,p_init_msg_list => p_init_msg_list
355 ,x_return_status => x_return_status
356 ,x_msg_count => x_msg_count
357 ,x_msg_data => x_msg_data
358 ,p_fxhv_rec => p_fxhv_rec);
359
360 IF x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR
361 THEN
362 RAISE G_EXCEPTION_HALT_VALIDATION;
363 ELSE
364 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS
365 THEN
366 l_return_status := x_return_status;
367 END IF;
368 END IF;
369 EXCEPTION
370 WHEN G_EXCEPTION_HALT_VALIDATION THEN
371 NULL;
372 WHEN OTHERS THEN
373 OKC_API.SET_MESSAGE(p_app_name => g_app_name
374 ,p_msg_name => g_unexpected_error
375 ,p_token1 => g_sqlcode_token
376 ,p_token1_value => sqlcode
377 ,p_token2 => g_sqlerrm_token
378 ,p_token2_value => sqlerrm);
379 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
380 END lock_fxh_extension;
381
382 ----------------------------------------------------------------------------------
383 -- Start of comments
384 --
385 -- Procedure Name : lock_fxh_extension
386 -- Description : wrapper api for locking a table of records
387 -- Business Rules :
388 -- Parameters : p_api_version, p_init_msg_list, x_return_status
392 ----------------------------------------------------------------------------------
389 -- ,x_msg_count, x_msg_data, p_fxhv_tbl
390 -- Version : 1.0
391 -- End of comments
393 PROCEDURE lock_fxh_extension(
394 p_api_version IN NUMBER
395 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
396 ,x_return_status OUT NOCOPY VARCHAR2
397 ,x_msg_count OUT NOCOPY NUMBER
398 ,x_msg_data OUT NOCOPY VARCHAR2
399 ,p_fxhv_tbl IN fxhv_tbl_type) IS
400 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
401 l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
402 i NUMBER := 0;
403 BEGIN
404 Okc_Api.init_msg_list(p_init_msg_list);
405 -- Make sure PL/SQL table has records in it before passing
406 IF (p_fxhv_tbl.COUNT > 0)
407 THEN
408 i := p_fxhv_tbl.FIRST;
409 LOOP
410 lock_fxh_extension(
411 p_api_version => p_api_version
412 ,p_init_msg_list => Okc_Api.G_FALSE
413 ,x_return_status => x_return_status
414 ,x_msg_count => x_msg_count
415 ,x_msg_data => x_msg_data
416 ,p_fxhv_rec => p_fxhv_tbl(i));
417 -- store the highest degree of error
418 IF x_return_status <> Okc_Api.G_RET_STS_SUCCESS
419 THEN
420 IF l_overall_status <> Okc_Api.G_RET_STS_UNEXP_ERROR
421 THEN
422 l_overall_status := x_return_status;
423 END IF;
424 END IF;
425 EXIT WHEN (i = p_fxhv_tbl.LAST);
426 i := p_fxhv_tbl.NEXT(i);
427 END LOOP;
428 END IF;
429 x_return_status := l_overall_status;
430 EXCEPTION
431 WHEN G_EXCEPTION_HALT_VALIDATION
432 THEN
433 NULL;
434 WHEN OTHERS
435 THEN
436 OKC_API.SET_MESSAGE(
437 p_app_name => g_app_name
438 ,p_msg_name => g_unexpected_error
439 ,p_token1 => g_sqlcode_token
440 ,p_token1_value => sqlcode
441 ,p_token2 => g_sqlerrm_token
442 ,p_token2_value => sqlerrm);
443 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
444 END lock_fxh_extension;
445
446 ----------------------------------------------------------------------------------
447 -- Start of comments
448 --
449 -- Procedure Name : update_fxh_extension
450 -- Description : wrapper api for updating a Header record
451 -- Business Rules :
452 -- Parameters : p_api_version, p_init_msg_list, x_return_status
453 -- ,x_msg_count, x_msg_data, p_fxhv_rec, x_fxhv_rec
454 -- Version : 1.0
455 -- End of comments
456 ----------------------------------------------------------------------------------
457 PROCEDURE update_fxh_extension(
458 p_api_version IN NUMBER
459 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
460 ,x_return_status OUT NOCOPY VARCHAR2
461 ,x_msg_count OUT NOCOPY NUMBER
462 ,x_msg_data OUT NOCOPY VARCHAR2
463 ,p_fxhv_rec IN fxhv_rec_type
464 ,x_fxhv_rec OUT NOCOPY fxhv_rec_type) IS
465 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
466 BEGIN
467 okl_fxh_pvt.update_row(
468 p_api_version => p_api_version
469 ,p_init_msg_list => p_init_msg_list
470 ,x_return_status => x_return_status
471 ,x_msg_count => x_msg_count
472 ,x_msg_data => x_msg_data
473 ,p_fxhv_rec => p_fxhv_rec
474 ,x_fxhv_rec => x_fxhv_rec);
475 IF x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR
476 THEN
477 RAISE G_EXCEPTION_HALT_VALIDATION;
478 ELSE
479 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS
480 THEN
481 l_return_status := x_return_status;
482 END IF;
483 END IF;
484 EXCEPTION
485 WHEN G_EXCEPTION_HALT_VALIDATION THEN
486 NULL;
487 WHEN OTHERS THEN
488 OKC_API.SET_MESSAGE(p_app_name => g_app_name
489 ,p_msg_name => g_unexpected_error
490 ,p_token1 => g_sqlcode_token
491 ,p_token1_value => sqlcode
492 ,p_token2 => g_sqlerrm_token
493 ,p_token2_value => sqlerrm);
494 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
495 END update_fxh_extension;
496
497 ----------------------------------------------------------------------------------
498 -- Start of comments
499 --
500 -- Procedure Name : update_fxh_extension
501 -- Description : wrapper api for updating a table of Header records
502 -- Business Rules :
503 -- Parameters : p_api_version, p_init_msg_list, x_return_status
504 -- ,x_msg_count, x_msg_data, p_fxhv_tbl, x_fxhv_tbl
505 -- Version : 1.0
506 -- End of comments
507 ----------------------------------------------------------------------------------
508 PROCEDURE update_fxh_extension(
509 p_api_version IN NUMBER
510 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
511 ,x_return_status OUT NOCOPY VARCHAR2
512 ,x_msg_count OUT NOCOPY NUMBER
513 ,x_msg_data OUT NOCOPY VARCHAR2
514 ,p_fxhv_tbl IN fxhv_tbl_type
515 ,x_fxhv_tbl OUT NOCOPY fxhv_tbl_type) IS
516 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
520 Okc_Api.init_msg_list(p_init_msg_list);
517 l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
518 i NUMBER := 0;
519 BEGIN
521 -- Make sure PL/SQL table has records in it before passing
522 IF (p_fxhv_tbl.COUNT > 0) THEN
523 i := p_fxhv_tbl.FIRST;
524 LOOP
525 update_fxh_extension(
526 p_api_version => p_api_version,
527 p_init_msg_list => Okc_Api.G_FALSE,
528 x_return_status => x_return_status,
529 x_msg_count => x_msg_count,
530 x_msg_data => x_msg_data,
531 p_fxhv_rec => p_fxhv_tbl(i),
532 x_fxhv_rec => x_fxhv_tbl(i));
533 -- store the highest degree of error
534 IF x_return_status <> Okc_Api.G_RET_STS_SUCCESS
535 THEN
536 IF l_overall_status <> Okc_Api.G_RET_STS_UNEXP_ERROR
537 THEN
538 l_overall_status := x_return_status;
539 END IF;
540 END IF;
541 EXIT WHEN (i = p_fxhv_tbl.LAST);
542 i := p_fxhv_tbl.NEXT(i);
543 END LOOP;
544 END IF;
545 x_return_status := l_overall_status;
546 EXCEPTION
547 WHEN G_EXCEPTION_HALT_VALIDATION
548 THEN
549 NULL;
550 WHEN OTHERS
551 THEN
552 OKC_API.SET_MESSAGE(p_app_name => g_app_name
553 ,p_msg_name => g_unexpected_error
554 ,p_token1 => g_sqlcode_token
555 ,p_token1_value => sqlcode
556 ,p_token2 => g_sqlerrm_token
557 ,p_token2_value => sqlerrm);
558 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
559 END update_fxh_extension;
560
561 ----------------------------------------------------------------------------------
562 -- Start of comments
563 --
564 -- Procedure Name : delete_fxh_extension
565 -- Description : wrapper api for deleting a record
566 -- Business Rules :
567 -- Parameters : p_api_version, p_init_msg_list, x_return_status
568 -- ,x_msg_count, x_msg_data, p_fxhv_rec
569 -- Version : 1.0
570 -- End of comments
571 ----------------------------------------------------------------------------------
572 PROCEDURE delete_fxh_extension(
573 p_api_version IN NUMBER
574 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
575 ,x_return_status OUT NOCOPY VARCHAR2
576 ,x_msg_count OUT NOCOPY NUMBER
577 ,x_msg_data OUT NOCOPY VARCHAR2
578 ,p_fxhv_rec IN fxhv_rec_type) IS
579 i NUMBER :=0;
580 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
581 l_fxlv_tbl fxlv_tbl_type;
582
583 CURSOR fxl_csr IS
584 SELECT fxl.line_extension_id
585 FROM OKL_EXT_FA_LINE_SOURCES_B fxl
586 WHERE fxl.header_extension_id = p_fxhv_rec.header_extension_id;
587 BEGIN
588 FOR fxl_rec IN fxl_csr
589 LOOP
590 i := i + 1;
591 l_fxlv_tbl(i).line_extension_id := fxl_rec.line_extension_id;
592 END LOOP;
593 delete_fxl_extension(
594 p_api_version => p_api_version
595 ,p_init_msg_list => p_init_msg_list
596 ,x_return_status => x_return_status
597 ,x_msg_count => x_msg_count
598 ,x_msg_data => x_msg_data
599 ,p_fxlv_tbl => l_fxlv_tbl);
600 IF x_return_status = OKC_API.G_RET_STS_SUCCESS
601 THEN
602 okl_fxh_pvt.delete_row(
603 p_api_version => p_api_version
604 ,p_init_msg_list => p_init_msg_list
605 ,x_return_status => x_return_status
606 ,x_msg_count => x_msg_count
607 ,x_msg_data => x_msg_data
608 ,p_fxhv_rec => p_fxhv_rec);
609 END IF;
610 EXCEPTION
611 WHEN G_EXCEPTION_HALT_VALIDATION
612 THEN
613 NULL;
614 WHEN OTHERS
615 THEN
616 OKC_API.SET_MESSAGE(
617 p_app_name => g_app_name
618 ,p_msg_name => g_unexpected_error
619 ,p_token1 => g_sqlcode_token
620 ,p_token1_value => sqlcode
621 ,p_token2 => g_sqlerrm_token
622 ,p_token2_value => sqlerrm);
623 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
624 END delete_fxh_extension;
625
626 ----------------------------------------------------------------------------------
627 -- Start of comments
628 --
629 -- Procedure Name : delete_fxh_extension
630 -- Description : wrapper api for deleting a table of records
631 -- Business Rules :
632 -- Parameters : p_api_version, p_init_msg_list, x_return_status
633 -- ,x_msg_count, x_msg_data, p_fxhv_tbl
634 -- Version : 1.0
635 -- End of comments
636 ----------------------------------------------------------------------------------
637 PROCEDURE delete_fxh_extension(
638 p_api_version IN NUMBER
639 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
640 ,x_return_status OUT NOCOPY VARCHAR2
641 ,x_msg_count OUT NOCOPY NUMBER
642 ,x_msg_data OUT NOCOPY VARCHAR2
643 ,p_fxhv_tbl IN fxhv_tbl_type) IS
644 i NUMBER :=0;
645 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
646 l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
647
648 BEGIN
649 --Initialize the return status
650 x_return_status := OKC_API.G_RET_STS_SUCCESS;
654 LOOP
651 IF (p_fxhv_tbl.COUNT > 0)
652 THEN
653 i := p_fxhv_tbl.FIRST;
655 delete_fxh_extension(
656 p_api_version => p_api_version
657 ,p_init_msg_list => p_init_msg_list
658 ,x_return_status => x_return_status
659 ,x_msg_count => x_msg_count
660 ,x_msg_data => x_msg_data
661 ,p_fxhv_rec => p_fxhv_tbl(i));
662 IF x_return_status <> Okc_Api.G_RET_STS_SUCCESS
663 THEN
664 IF l_overall_status <> Okc_Api.G_RET_STS_UNEXP_ERROR
665 THEN
666 l_overall_status := x_return_status;
667 END IF;
668 END IF;
669 EXIT WHEN (i = p_fxhv_tbl.LAST);
670 i := p_fxhv_tbl.NEXT(i);
671 END LOOP;
672 END IF;
673 x_return_status := l_overall_status;
674 EXCEPTION
675 WHEN G_EXCEPTION_HALT_VALIDATION
676 THEN
677 NULL;
678 WHEN OTHERS
679 THEN
680 OKC_API.SET_MESSAGE(
681 p_app_name => g_app_name
682 ,p_msg_name => g_unexpected_error
683 ,p_token1 => g_sqlcode_token
684 ,p_token1_value => sqlcode
685 ,p_token2 => g_sqlerrm_token
686 ,p_token2_value => sqlerrm);
687 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
688 END delete_fxh_extension;
689
690 ----------------------------------------------------------------------------------
691 -- Start of comments
692 --
693 -- Procedure Name : validate_fxh_extension
694 -- Description : wrapper api for validating a Header record
695 -- Business Rules :
696 -- Parameters : p_api_version, p_init_msg_list, x_return_status
697 -- ,x_msg_count, x_msg_data, p_fxhv_rec
698 -- Version : 1.0
699 -- End of comments
700 ----------------------------------------------------------------------------------
701 PROCEDURE validate_fxh_extension(
702 p_api_version IN NUMBER
703 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
704 ,x_return_status OUT NOCOPY VARCHAR2
705 ,x_msg_count OUT NOCOPY NUMBER
706 ,x_msg_data OUT NOCOPY VARCHAR2
707 ,p_fxhv_rec IN fxhv_rec_type) IS
708 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
709 BEGIN
710 okl_fxh_pvt.validate_row(
711 p_api_version => p_api_version
712 ,p_init_msg_list => p_init_msg_list
713 ,x_return_status => x_return_status
714 ,x_msg_count => x_msg_count
715 ,x_msg_data => x_msg_data
716 ,p_fxhv_rec => p_fxhv_rec);
717 IF x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR
718 THEN
719 RAISE G_EXCEPTION_HALT_VALIDATION;
720 ELSE
721 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS
722 THEN
723 l_return_status := x_return_status;
724 END IF;
725 END IF;
726 EXCEPTION
727 WHEN G_EXCEPTION_HALT_VALIDATION
728 THEN
729 NULL;
730 WHEN OTHERS
731 THEN
732 OKC_API.SET_MESSAGE(
733 p_app_name => g_app_name
734 ,p_msg_name => g_unexpected_error
735 ,p_token1 => g_sqlcode_token
736 ,p_token1_value => sqlcode
737 ,p_token2 => g_sqlerrm_token
738 ,p_token2_value => sqlerrm);
739 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
740 END validate_fxh_extension;
741
742 ----------------------------------------------------------------------------------
743 -- Start of comments
744 --
745 -- Procedure Name : validate_fxh_extension
746 -- Description : wrapper api for validating a table of Header records
747 -- Business Rules :
748 -- Parameters : p_api_version, p_init_msg_list, x_return_status
749 -- ,x_msg_count, x_msg_data, p_fxhv_tbl
750 -- Version : 1.0
751 -- End of comments
752 ----------------------------------------------------------------------------------
753 PROCEDURE validate_fxh_extension(
754 p_api_version IN NUMBER,
755 p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE,
756 x_return_status OUT NOCOPY VARCHAR2,
757 x_msg_count OUT NOCOPY NUMBER,
758 x_msg_data OUT NOCOPY VARCHAR2,
759 p_fxhv_tbl IN fxhv_tbl_type)
760 IS
761 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
762 l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
763 i NUMBER := 0;
764 BEGIN
765 Okc_Api.init_msg_list(p_init_msg_list);
766 -- Make sure PL/SQL table has records in it before passing
767 IF (p_fxhv_tbl.COUNT > 0)
768 THEN
769 i := p_fxhv_tbl.FIRST;
770 LOOP
771 validate_fxh_extension(
772 p_api_version => p_api_version
773 ,p_init_msg_list => Okc_Api.G_FALSE
774 ,x_return_status => x_return_status
775 ,x_msg_count => x_msg_count
776 ,x_msg_data => x_msg_data
777 ,p_fxhv_rec => p_fxhv_tbl(i));
778 -- store the highest degree of error
779 IF x_return_status <> Okc_Api.G_RET_STS_SUCCESS
780 THEN
781 IF l_overall_status <> Okc_Api.G_RET_STS_UNEXP_ERROR
782 THEN
783 l_overall_status := x_return_status;
784 END IF;
785 END IF;
786 EXIT WHEN (i = p_fxhv_tbl.LAST);
787 i := p_fxhv_tbl.NEXT(i);
791 EXCEPTION
788 END LOOP;
789 END IF;
790 x_return_status := l_overall_status;
792 WHEN G_EXCEPTION_HALT_VALIDATION
793 THEN
794 NULL;
795 WHEN OTHERS
796 THEN
797 OKC_API.SET_MESSAGE(
798 p_app_name => g_app_name
799 ,p_msg_name => g_unexpected_error
800 ,p_token1 => g_sqlcode_token
801 ,p_token1_value => sqlcode
802 ,p_token2 => g_sqlerrm_token
803 ,p_token2_value => sqlerrm);
804 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
805 END validate_fxh_extension;
806
807 ----------------------------------------------------------------------------------
808 -- Start of comments
809 --
810 -- Procedure Name : create_fxl_extension
811 -- Description : wrapper api for creation of Transaction Extension Line
812 -- Business Rules :
813 -- Parameters : p_api_version, p_init_msg_list, x_return_status
814 -- ,x_msg_count, x_msg_data, p_fxlv_rec, x_fxlv_rec
815 -- Version : 1.0
816 -- End of comments
817 ----------------------------------------------------------------------------------
818 PROCEDURE create_fxl_extension(
819 p_api_version IN NUMBER
820 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
821 ,x_return_status OUT NOCOPY VARCHAR2
822 ,x_msg_count OUT NOCOPY NUMBER
823 ,x_msg_data OUT NOCOPY VARCHAR2
824 ,p_fxlv_rec IN fxlv_rec_type
825 ,x_fxlv_rec OUT NOCOPY fxlv_rec_type)
826 IS
827 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
828 BEGIN
829 okl_fxl_pvt.insert_row(
830 p_api_version => p_api_version
831 ,p_init_msg_list => p_init_msg_list
832 ,x_return_status => x_return_status
833 ,x_msg_count => x_msg_count
834 ,x_msg_data => x_msg_data
835 ,p_fxlv_rec => p_fxlv_rec
836 ,x_fxlv_rec => x_fxlv_rec);
837 IF x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR
838 THEN
839 RAISE G_EXCEPTION_HALT_VALIDATION;
840 ELSE
841 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS
842 THEN
843 l_return_status := x_return_status;
844 END IF;
845 END IF;
846 EXCEPTION
847 WHEN G_EXCEPTION_HALT_VALIDATION
848 THEN
849 NULL;
850 WHEN OTHERS
851 THEN
852 OKC_API.SET_MESSAGE(
853 p_app_name => g_app_name
854 ,p_msg_name => g_unexpected_error
855 ,p_token1 => g_sqlcode_token
856 ,p_token1_value => sqlcode
857 ,p_token2 => g_sqlerrm_token
858 ,p_token2_value => sqlerrm);
859 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
860 END create_fxl_extension;
861
862 ----------------------------------------------------------------------------------
863 -- Start of comments
864 --
865 -- Procedure Name : create_fxl_extension
866 -- Description : wrapper api for creation of multiple records of
867 -- Transaction Extension Line
868 -- Business Rules :
869 -- Parameters : p_api_version, p_init_msg_list, x_return_status
870 -- ,x_msg_count, x_msg_data, p_fxlv_tbl, x_fxlv_tbl
871 -- Version : 1.0
872 -- End of comments
873 ----------------------------------------------------------------------------------
874 PROCEDURE create_fxl_extension(
875 p_api_version IN NUMBER
876 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
877 ,x_return_status OUT NOCOPY VARCHAR2
878 ,x_msg_count OUT NOCOPY NUMBER
879 ,x_msg_data OUT NOCOPY VARCHAR2
880 ,p_fxlv_tbl IN fxlv_tbl_type
881 ,x_fxlv_tbl OUT NOCOPY fxlv_tbl_type)
882 IS
883 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
884 l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
885 i NUMBER := 0;
886 BEGIN
887 OKC_API.init_msg_list(p_init_msg_list);
888 -- Make sure PL/SQL table has records in it before passing
889 IF (p_fxlv_tbl.COUNT > 0)
890 THEN
891 i := p_fxlv_tbl.FIRST;
892 LOOP
893 create_fxl_extension(
894 p_api_version => p_api_version
895 ,p_init_msg_list => OKC_API.G_FALSE
896 ,x_return_status => x_return_status
897 ,x_msg_count => x_msg_count
898 ,x_msg_data => x_msg_data
899 ,p_fxlv_rec => p_fxlv_tbl(i)
900 ,x_fxlv_rec => x_fxlv_tbl(i));
901 -- store the highest degree of error
902 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS
903 THEN
904 IF l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR
905 THEN
906 l_overall_status := x_return_status;
907 END IF;
908 END IF;
909 EXIT WHEN (i = p_fxlv_tbl.LAST);
910 i := p_fxlv_tbl.NEXT(i);
911 END LOOP;
912 END IF;
913 x_return_status := l_overall_status;
914 EXCEPTION
915 WHEN G_EXCEPTION_HALT_VALIDATION
916 THEN
917 NULL;
918 WHEN OTHERS
919 THEN
920 OKC_API.SET_MESSAGE(
921 p_app_name => g_app_name
922 ,p_msg_name => g_unexpected_error
923 ,p_token1 => g_sqlcode_token
927 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
924 ,p_token1_value => sqlcode
925 ,p_token2 => g_sqlerrm_token
926 ,p_token2_value => sqlerrm);
928 END create_fxl_extension;
929 ----------------------------------------------------------------------------------
930 -- Start of comments
931 --
932 -- Procedure Name : lock_fxl_extension
933 -- Description : wrapper api for locking a record
934 -- Business Rules :
935 -- Parameters : p_api_version, p_init_msg_list, x_return_status
936 -- ,x_msg_count, x_msg_data, p_fxlv_rec
937 -- Version : 1.0
938 -- End of comments
939 ----------------------------------------------------------------------------------
940 PROCEDURE lock_fxl_extension(
941 p_api_version IN NUMBER
942 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
943 ,x_return_status OUT NOCOPY VARCHAR2
944 ,x_msg_count OUT NOCOPY NUMBER
945 ,x_msg_data OUT NOCOPY VARCHAR2
946 ,p_fxlv_rec IN fxlv_rec_type) IS
947 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
948 BEGIN
949 okl_fxl_pvt.lock_row(
950 p_api_version => p_api_version
951 ,p_init_msg_list => p_init_msg_list
952 ,x_return_status => x_return_status
953 ,x_msg_count => x_msg_count
954 ,x_msg_data => x_msg_data
955 ,p_fxlv_rec => p_fxlv_rec );
956 IF x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR
957 THEN
958 RAISE G_EXCEPTION_HALT_VALIDATION;
959 ELSE
960 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS
961 THEN
962 l_return_status := x_return_status;
963 END IF;
964 END IF;
965 EXCEPTION
966 WHEN G_EXCEPTION_HALT_VALIDATION
967 THEN
968 NULL;
969 WHEN OTHERS
970 THEN
971 OKC_API.SET_MESSAGE(
972 p_app_name => g_app_name
973 ,p_msg_name => g_unexpected_error
974 ,p_token1 => g_sqlcode_token
975 ,p_token1_value => sqlcode
976 ,p_token2 => g_sqlerrm_token
977 ,p_token2_value => sqlerrm);
978 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
979 END lock_fxl_extension;
980
981 ----------------------------------------------------------------------------------
982 -- Start of comments
983 --
984 -- Procedure Name : lock_fxl_extension
985 -- Description : wrapper api for locking a table of records
986 -- Business Rules :
987 -- Parameters : p_api_version, p_init_msg_list, x_return_status
988 -- ,x_msg_count, x_msg_data, p_fxlv_tbl
989 -- Version : 1.0
990 -- End of comments
991 ----------------------------------------------------------------------------------
992 PROCEDURE lock_fxl_extension(
993 p_api_version IN NUMBER
994 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
995 ,x_return_status OUT NOCOPY VARCHAR2
996 ,x_msg_count OUT NOCOPY NUMBER
997 ,x_msg_data OUT NOCOPY VARCHAR2
998 ,p_fxlv_tbl IN fxlv_tbl_type)
999 IS
1000 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1001 l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1002 i NUMBER := 0;
1003 BEGIN
1004 OKC_API.init_msg_list(p_init_msg_list);
1005 -- Make sure PL/SQL table has records in it before passing
1006 IF (p_fxlv_tbl.COUNT > 0)
1007 THEN
1008 i := p_fxlv_tbl.FIRST;
1009 LOOP
1010 lock_fxl_extension(
1011 p_api_version => p_api_version
1012 ,p_init_msg_list => OKC_API.G_FALSE
1013 ,x_return_status => x_return_status
1014 ,x_msg_count => x_msg_count
1015 ,x_msg_data => x_msg_data
1016 ,p_fxlv_rec => p_fxlv_tbl(i));
1017 -- store the highest degree of error
1018 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS
1019 THEN
1020 IF l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR
1021 THEN
1022 l_overall_status := x_return_status;
1023 END IF;
1024 END IF;
1025 EXIT WHEN (i = p_fxlv_tbl.LAST);
1026 i := p_fxlv_tbl.NEXT(i);
1027 END LOOP;
1028 END IF;
1029 x_return_status := l_overall_status;
1030 EXCEPTION
1031 WHEN G_EXCEPTION_HALT_VALIDATION
1032 THEN
1033 NULL;
1034 WHEN OTHERS
1035 THEN
1036 OKC_API.SET_MESSAGE(
1037 p_app_name => g_app_name
1038 ,p_msg_name => g_unexpected_error
1039 ,p_token1 => g_sqlcode_token
1040 ,p_token1_value => sqlcode
1041 ,p_token2 => g_sqlerrm_token
1042 ,p_token2_value => sqlerrm);
1043 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1044 END lock_fxl_extension;
1045
1046 ----------------------------------------------------------------------------------
1047 -- Start of comments
1048 --
1049 -- Procedure Name : update_fxl_extension
1050 -- Description : wrapper api for updating a record
1051 -- Business Rules :
1052 -- Parameters : p_api_version, p_init_msg_list, x_return_status
1053 -- ,x_msg_count, x_msg_data, p_fxlv_rec, x_fxlv_rec
1054 -- Version : 1.0
1055 -- End of comments
1056 ----------------------------------------------------------------------------------
1060 ,x_return_status OUT NOCOPY VARCHAR2
1057 PROCEDURE update_fxl_extension(
1058 p_api_version IN NUMBER
1059 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1061 ,x_msg_count OUT NOCOPY NUMBER
1062 ,x_msg_data OUT NOCOPY VARCHAR2
1063 ,p_fxlv_rec IN fxlv_rec_type
1064 ,x_fxlv_rec OUT NOCOPY fxlv_rec_type)
1065 IS
1066 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1067 BEGIN
1068 okl_fxl_pvt.update_row(
1069 p_api_version => p_api_version
1070 ,p_init_msg_list => p_init_msg_list
1071 ,x_return_status => x_return_status
1072 ,x_msg_count => x_msg_count
1073 ,x_msg_data => x_msg_data
1074 ,p_fxlv_rec => p_fxlv_rec
1075 ,x_fxlv_rec => x_fxlv_rec
1076 );
1077 IF x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR THEN
1078 RAISE G_EXCEPTION_HALT_VALIDATION;
1079 ELSE
1080 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS THEN
1081 l_return_status := x_return_status;
1082 END IF;
1083 END IF;
1084 EXCEPTION
1085 WHEN G_EXCEPTION_HALT_VALIDATION
1086 THEN
1087 NULL;
1088 WHEN OTHERS
1089 THEN
1090 OKC_API.SET_MESSAGE(
1091 p_app_name => g_app_name
1092 ,p_msg_name => g_unexpected_error
1093 ,p_token1 => g_sqlcode_token
1094 ,p_token1_value => sqlcode
1095 ,p_token2 => g_sqlerrm_token
1096 ,p_token2_value => sqlerrm);
1097 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1098 END update_fxl_extension;
1099
1100 ----------------------------------------------------------------------------------
1101 -- Start of comments
1102 --
1103 -- Procedure Name : update_fxl_extension
1104 -- Description : wrapper api for updating a table of records
1105 -- Business Rules :
1106 -- Parameters : p_api_version, p_init_msg_list, x_return_status
1107 -- ,x_msg_count, x_msg_data, p_fxlv_tbl, x_fxlv_tbl
1108 -- Version : 1.0
1109 -- End of comments
1110 ----------------------------------------------------------------------------------
1111 PROCEDURE update_fxl_extension(
1112 p_api_version IN NUMBER
1113 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1114 ,x_return_status OUT NOCOPY VARCHAR2
1115 ,x_msg_count OUT NOCOPY NUMBER
1116 ,x_msg_data OUT NOCOPY VARCHAR2
1117 ,p_fxlv_tbl IN fxlv_tbl_type
1118 ,x_fxlv_tbl OUT NOCOPY fxlv_tbl_type)
1119 IS
1120 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1121 l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1122 i NUMBER := 0;
1123 BEGIN
1124 OKC_API.init_msg_list(p_init_msg_list);
1125 -- Make sure PL/SQL table has records in it before passing
1126 IF (p_fxlv_tbl.COUNT > 0)
1127 THEN
1128 i := p_fxlv_tbl.FIRST;
1129 LOOP
1130 update_fxl_extension(
1131 p_api_version => p_api_version,
1132 p_init_msg_list => OKC_API.G_FALSE,
1133 x_return_status => x_return_status,
1134 x_msg_count => x_msg_count,
1135 x_msg_data => x_msg_data,
1136 p_fxlv_rec => p_fxlv_tbl(i),
1137 x_fxlv_rec => x_fxlv_tbl(i));
1138 -- store the highest degree of error
1139 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS
1140 THEN
1141 IF l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR
1142 THEN
1143 l_overall_status := x_return_status;
1144 END IF;
1145 END IF;
1146 EXIT WHEN (i = p_fxlv_tbl.LAST);
1147 i := p_fxlv_tbl.NEXT(i);
1148 END LOOP;
1149 END IF;
1150 x_return_status := l_overall_status;
1151 EXCEPTION
1152 WHEN G_EXCEPTION_HALT_VALIDATION
1153 THEN
1154 NULL;
1155 WHEN OTHERS
1156 THEN
1157 OKC_API.SET_MESSAGE(
1158 p_app_name => g_app_name
1159 ,p_msg_name => g_unexpected_error
1160 ,p_token1 => g_sqlcode_token
1161 ,p_token1_value => sqlcode
1162 ,p_token2 => g_sqlerrm_token
1163 ,p_token2_value => sqlerrm);
1164 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1165 END update_fxl_extension;
1166
1167 ----------------------------------------------------------------------------------
1168 -- Start of comments
1169 --
1170 -- Procedure Name : delete_fxl_extension
1171 -- Description : wrapper api for deleting record
1172 -- Business Rules :
1173 -- Parameters : p_api_version, p_init_msg_list, x_return_status
1174 -- ,x_msg_count, x_msg_data, p_fxlv_rec
1175 -- Version : 1.0
1176 -- End of comments
1177 ----------------------------------------------------------------------------------
1178 PROCEDURE delete_fxl_extension(
1179 p_api_version IN NUMBER
1180 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1181 ,x_return_status OUT NOCOPY VARCHAR2
1182 ,x_msg_count OUT NOCOPY NUMBER
1183 ,x_msg_data OUT NOCOPY VARCHAR2
1184 ,p_fxlv_rec IN fxlv_rec_type) IS
1185 i NUMBER :=0;
1186 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1187 BEGIN
1188 okl_fxl_pvt.delete_row(
1189 p_api_version => p_api_version
1190 ,p_init_msg_list => p_init_msg_list
1191 ,x_return_status => x_return_status
1192 ,x_msg_count => x_msg_count
1193 ,x_msg_data => x_msg_data
1194 ,p_fxlv_rec => p_fxlv_rec);
1195 IF x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR
1196 THEN
1197 RAISE G_EXCEPTION_HALT_VALIDATION;
1198 ELSE
1199 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS
1200 THEN
1201 l_return_status := x_return_status;
1202 END IF;
1203 END IF;
1204 EXCEPTION
1205 WHEN G_EXCEPTION_HALT_VALIDATION
1206 THEN
1207 NULL;
1208 WHEN OTHERS
1209 THEN
1210 OKC_API.SET_MESSAGE(
1211 p_app_name => g_app_name
1212 ,p_msg_name => g_unexpected_error
1213 ,p_token1 => g_sqlcode_token
1214 ,p_token1_value => sqlcode
1215 ,p_token2 => g_sqlerrm_token
1216 ,p_token2_value => sqlerrm);
1217 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1218 END delete_fxl_extension;
1219
1220 ----------------------------------------------------------------------------------
1221 -- Start of comments
1222 --
1223 -- Procedure Name : delete_fxl_extension
1224 -- Description : wrapper api for deleting a table of records
1225 -- Business Rules :
1226 -- Parameters : p_api_version, p_init_msg_list, x_return_status
1227 -- ,x_msg_count, x_msg_data, p_fxlv_tbl
1228 -- Version : 1.0
1229 -- End of comments
1230 ----------------------------------------------------------------------------------
1231 PROCEDURE delete_fxl_extension(
1232 p_api_version IN NUMBER
1233 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1234 ,x_return_status OUT NOCOPY VARCHAR2
1235 ,x_msg_count OUT NOCOPY NUMBER
1236 ,x_msg_data OUT NOCOPY VARCHAR2
1237 ,p_fxlv_tbl IN fxlv_tbl_type)
1238 IS
1239 i NUMBER :=0;
1240 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1241 l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1242 BEGIN
1243 --Initialize the return status
1244 x_return_status := OKC_API.G_RET_STS_SUCCESS;
1245 IF (p_fxlv_tbl.COUNT > 0)
1246 THEN
1247 i := p_fxlv_tbl.FIRST;
1248 LOOP
1249 delete_fxl_extension(
1250 p_api_version => p_api_version
1251 ,p_init_msg_list => p_init_msg_list
1252 ,x_return_status => x_return_status
1253 ,x_msg_count => x_msg_count
1254 ,x_msg_data => x_msg_data
1255 ,p_fxlv_rec => p_fxlv_tbl(i));
1256 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS
1257 THEN
1258 IF l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR
1259 THEN
1260 l_overall_status := x_return_status;
1261 END IF;
1262 END IF;
1263 EXIT WHEN (i = p_fxlv_tbl.LAST);
1264 i := p_fxlv_tbl.NEXT(i);
1265 END LOOP;
1266 END IF;
1267 x_return_status := l_overall_status;
1268 EXCEPTION
1269 WHEN G_EXCEPTION_HALT_VALIDATION
1270 THEN
1271 NULL;
1272 WHEN OTHERS
1273 THEN
1274 OKC_API.SET_MESSAGE(
1275 p_app_name => g_app_name
1276 ,p_msg_name => g_unexpected_error
1277 ,p_token1 => g_sqlcode_token
1278 ,p_token1_value => sqlcode
1282 END delete_fxl_extension;
1279 ,p_token2 => g_sqlerrm_token
1280 ,p_token2_value => sqlerrm);
1281 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1283
1284 ----------------------------------------------------------------------------------
1285 -- Start of comments
1286 --
1287 -- Procedure Name : validate_fxl_extension
1288 -- Description : wrapper api for validating a record
1289 -- Business Rules :
1290 -- Parameters : p_api_version, p_init_msg_list, x_return_status
1291 -- ,x_msg_count, x_msg_data, p_fxlv_rec
1292 -- Version : 1.0
1293 -- End of comments
1294 ----------------------------------------------------------------------------------
1295 PROCEDURE validate_fxl_extension(
1296 p_api_version IN NUMBER
1297 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1298 ,x_return_status OUT NOCOPY VARCHAR2
1299 ,x_msg_count OUT NOCOPY NUMBER
1300 ,x_msg_data OUT NOCOPY VARCHAR2
1301 ,p_fxlv_rec IN fxlv_rec_type) IS
1302 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1303 BEGIN
1304 okl_fxl_pvt.validate_row(
1305 p_api_version => p_api_version
1306 ,p_init_msg_list => p_init_msg_list
1307 ,x_return_status => x_return_status
1308 ,x_msg_count => x_msg_count
1309 ,x_msg_data => x_msg_data
1310 ,p_fxlv_rec => p_fxlv_rec );
1311 IF x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR
1312 THEN
1313 RAISE G_EXCEPTION_HALT_VALIDATION;
1314 ELSE
1315 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS
1316 THEN
1317 l_return_status := x_return_status;
1318 END IF;
1319 END IF;
1320 EXCEPTION
1321 WHEN G_EXCEPTION_HALT_VALIDATION
1322 THEN
1323 NULL;
1324 WHEN OTHERS
1325 THEN
1326 OKC_API.SET_MESSAGE(
1327 p_app_name => g_app_name
1328 ,p_msg_name => g_unexpected_error
1329 ,p_token1 => g_sqlcode_token
1330 ,p_token1_value => sqlcode
1331 ,p_token2 => g_sqlerrm_token
1332 ,p_token2_value => sqlerrm);
1333 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1334 END validate_fxl_extension;
1335
1336 ----------------------------------------------------------------------------------
1337 -- Start of comments
1338 --
1339 -- Procedure Name : validate_fxl_extension
1340 -- Description : wrapper api for validating a table of records
1341 -- Business Rules :
1342 -- Parameters : p_api_version, p_init_msg_list, x_return_status
1343 -- ,x_msg_count, x_msg_data, p_fxlv_tbl
1344 -- Version : 1.0
1345 -- End of comments
1346 ----------------------------------------------------------------------------------
1347 PROCEDURE validate_fxl_extension(
1348 p_api_version IN NUMBER
1349 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1350 ,x_return_status OUT NOCOPY VARCHAR2
1351 ,x_msg_count OUT NOCOPY NUMBER
1352 ,x_msg_data OUT NOCOPY VARCHAR2
1353 ,p_fxlv_tbl IN fxlv_tbl_type)
1354 IS
1355 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1356 l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1357 i NUMBER := 0;
1358 BEGIN
1359 OKC_API.init_msg_list(p_init_msg_list);
1360 -- Make sure PL/SQL table has records in it before passing
1361 IF (p_fxlv_tbl.COUNT > 0)
1362 THEN
1363 i := p_fxlv_tbl.FIRST;
1364 LOOP
1365 validate_fxl_extension(
1366 p_api_version => p_api_version
1367 ,p_init_msg_list => OKC_API.G_FALSE
1368 ,x_return_status => x_return_status
1369 ,x_msg_count => x_msg_count
1370 ,x_msg_data => x_msg_data
1371 ,p_fxlv_rec => p_fxlv_tbl(i));
1372 -- store the highest degree of error
1373 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS
1374 THEN
1375 IF l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR
1376 THEN
1377 l_overall_status := x_return_status;
1378 END IF;
1379 END IF;
1380 EXIT WHEN (i = p_fxlv_tbl.LAST);
1381 i := p_fxlv_tbl.NEXT(i);
1382 END LOOP;
1383 x_return_status := l_overall_status;
1384 END IF;
1385 EXCEPTION
1386 WHEN G_EXCEPTION_HALT_VALIDATION
1387 THEN
1388 NULL;
1389 WHEN OTHERS
1390 THEN
1391 OKC_API.SET_MESSAGE(
1392 p_app_name => g_app_name
1393 ,p_msg_name => g_unexpected_error
1394 ,p_token1 => g_sqlcode_token
1395 ,p_token1_value => sqlcode
1396 ,p_token2 => g_sqlerrm_token
1397 ,p_token2_value => sqlerrm);
1398 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1399 END validate_fxl_extension;
1400 ----------------------------------------------------------------------------------
1401 -- Start of comments
1402 --
1403 -- Added : Bug# 6268782 : PRASJAIN
1404 --
1405 -- Procedure Name : create_fxh_extension
1406 -- Description : wrapper api for creating Transaction Extension
1407 -- Business Rules :
1408 -- Parameters : p_api_version ,p_init_msg_list,x_return_status
1409 -- ,x_msg_count ,x_msg_data ,p_fxh_rec, p_fxhl_tbl
1410 -- ,x_fxh_rec, x_fxhl_tbl
1411 -- Version : 1.0
1415 p_api_version IN NUMBER
1412 -- End of comments
1413 ----------------------------------------------------------------------------------
1414 PROCEDURE create_fxh_extension(
1416 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1417 ,x_return_status OUT NOCOPY VARCHAR2
1418 ,x_msg_count OUT NOCOPY NUMBER
1419 ,x_msg_data OUT NOCOPY VARCHAR2
1420 ,p_fxh_rec IN fxh_rec_type
1421 ,p_fxhl_tbl IN fxhl_tbl_type
1422 ,x_fxh_rec OUT NOCOPY fxh_rec_type
1423 ,x_fxhl_tbl OUT NOCOPY fxhl_tbl_type) IS
1424 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1425 BEGIN
1426 okl_fxh_pvt.insert_row(
1427 p_api_version => p_api_version
1428 ,p_init_msg_list => p_init_msg_list
1429 ,x_return_status => x_return_status
1430 ,x_msg_count => x_msg_count
1431 ,x_msg_data => x_msg_data
1432 ,p_fxh_rec => p_fxh_rec
1433 ,p_fxhl_tbl => p_fxhl_tbl
1434 ,x_fxh_rec => x_fxh_rec
1435 ,x_fxhl_tbl => x_fxhl_tbl
1436 );
1437
1438 IF x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR THEN
1439 RAISE G_EXCEPTION_HALT_VALIDATION;
1440 ELSE
1441 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS THEN
1442 l_return_status := x_return_status;
1443 END IF;
1444 END IF;
1445 -- Custom code if any
1446
1447 EXCEPTION
1448 WHEN G_EXCEPTION_HALT_VALIDATION THEN
1449 NULL;
1450
1451 WHEN OTHERS THEN
1452 OKC_API.SET_MESSAGE(p_app_name => g_app_name
1453 ,p_msg_name => g_unexpected_error
1454 ,p_token1 => g_sqlcode_token
1455 ,p_token1_value => sqlcode
1456 ,p_token2 => g_sqlerrm_token
1457 ,p_token2_value => sqlerrm);
1458 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1459 END create_fxh_extension;
1460
1461 ----------------------------------------------------------------------------------
1462 -- Start of comments
1463 --
1464 -- Added : Bug# 6268782 : PRASJAIN
1465 --
1466 -- Procedure Name : create_fxl_extension
1467 -- Description : wrapper api for creating Transaction Extension
1468 -- Business Rules :
1469 -- Parameters : p_api_version ,p_init_msg_list,x_return_status
1470 -- ,x_msg_count ,x_msg_data ,p_fxl_rec, p_fxll_tbl
1471 -- ,x_fxl_rec, x_fxll_tbl
1472 -- Version : 1.0
1473 -- End of comments
1474 ----------------------------------------------------------------------------------
1475 PROCEDURE create_fxl_extension(
1476 p_api_version IN NUMBER
1477 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1478 ,x_return_status OUT NOCOPY VARCHAR2
1479 ,x_msg_count OUT NOCOPY NUMBER
1480 ,x_msg_data OUT NOCOPY VARCHAR2
1481 ,p_fxl_rec IN fxl_rec_type
1482 ,p_fxll_tbl IN fxll_tbl_type
1483 ,x_fxl_rec OUT NOCOPY fxl_rec_type
1484 ,x_fxll_tbl OUT NOCOPY fxll_tbl_type) IS
1485 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1486 BEGIN
1487 okl_fxl_pvt.insert_row(
1488 p_api_version => p_api_version
1489 ,p_init_msg_list => p_init_msg_list
1490 ,x_return_status => x_return_status
1491 ,x_msg_count => x_msg_count
1492 ,x_msg_data => x_msg_data
1493 ,p_fxl_rec => p_fxl_rec
1494 ,p_fxll_tbl => p_fxll_tbl
1495 ,x_fxl_rec => x_fxl_rec
1496 ,x_fxll_tbl => x_fxll_tbl
1497 );
1498 IF x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR THEN
1499 RAISE G_EXCEPTION_HALT_VALIDATION;
1500 ELSE
1501 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS THEN
1502 l_return_status := x_return_status;
1503 END IF;
1504 END IF;
1505 EXCEPTION
1506 WHEN G_EXCEPTION_HALT_VALIDATION THEN
1507 NULL;
1508 WHEN OTHERS THEN
1509 OKC_API.SET_MESSAGE(p_app_name => g_app_name
1510 ,p_msg_name => g_unexpected_error
1511 ,p_token1 => g_sqlcode_token
1512 ,p_token1_value => sqlcode
1513 ,p_token2 => g_sqlerrm_token
1514 ,p_token2_value => sqlerrm);
1515 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1516 END create_fxl_extension;
1517
1518 ----------------------------------------------------------------------------------
1519 -- Start of comments
1520 --
1521 -- Added : Bug# 6268782 : PRASJAIN
1522 --
1523 -- Procedure Name : create_fxl_extension
1524 -- Description : wrapper api for creating Transaction Extension
1525 -- Business Rules :
1526 -- Parameters : p_api_version ,p_init_msg_list,x_return_status
1527 -- ,x_msg_count ,x_msg_data ,p_fxl_tbl_tbl, x_fxl_tbl_tbl
1528 -- Version : 1.0
1529 -- End of comments
1530 ----------------------------------------------------------------------------------
1531 PROCEDURE create_fxl_extension(
1532 p_api_version IN NUMBER
1533 ,p_init_msg_list IN VARCHAR2 DEFAULT OKC_API.G_FALSE
1534 ,x_return_status OUT NOCOPY VARCHAR2
1535 ,x_msg_count OUT NOCOPY NUMBER
1536 ,x_msg_data OUT NOCOPY VARCHAR2
1537 ,p_fxl_tbl_tbl IN fxl_tbl_tbl_type
1538 ,x_fxl_tbl_tbl OUT NOCOPY fxl_tbl_tbl_type) IS
1539 l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1540 l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1541 i NUMBER := 0;
1542 BEGIN
1543
1544 OKC_API.init_msg_list(p_init_msg_list);
1545 -- Make sure PL/SQL table has records in it before passing
1546 IF (p_fxl_tbl_tbl.COUNT > 0) THEN
1547 i := p_fxl_tbl_tbl.FIRST;
1548 LOOP
1549 create_fxl_extension(
1550 p_api_version => p_api_version
1551 ,p_init_msg_list => OKC_API.G_FALSE
1552 ,x_return_status => x_return_status
1553 ,x_msg_count => x_msg_count
1554 ,x_msg_data => x_msg_data
1555 ,p_fxl_rec => p_fxl_tbl_tbl(i).fxl_rec
1556 ,p_fxll_tbl => p_fxl_tbl_tbl(i).fxll_tbl
1557 ,x_fxl_rec => x_fxl_tbl_tbl(i).fxl_rec
1558 ,x_fxll_tbl => x_fxl_tbl_tbl(i).fxll_tbl);
1559
1560 -- store the highest degree of error
1561 IF x_return_status <> OKC_API.G_RET_STS_SUCCESS THEN
1562 IF l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR THEN
1563 l_overall_status := x_return_status;
1564 END IF;
1565 END IF;
1566
1567 EXIT WHEN (i = p_fxl_tbl_tbl.LAST);
1568 i := p_fxl_tbl_tbl.NEXT(i);
1569 END LOOP;
1570
1571 END IF;
1572
1573 x_return_status := l_overall_status;
1574
1575 EXCEPTION
1576 WHEN G_EXCEPTION_HALT_VALIDATION THEN
1577 NULL;
1578 WHEN OTHERS THEN
1579 OKC_API.SET_MESSAGE(p_app_name => g_app_name
1580 ,p_msg_name => g_unexpected_error
1581 ,p_token1 => g_sqlcode_token
1582 ,p_token1_value => sqlcode
1583 ,p_token2 => g_sqlerrm_token
1584 ,p_token2_value => sqlerrm);
1585 x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1586 END create_fxl_extension;
1587 END OKL_FA_EXTENSION_PVT;