5: /*+++++++++++++Start of hand code +++++++++++++++++*/
6: G_UNEXPECTED_ERROR CONSTANT varchar2(200) := 'OKC_UNEXPECTED_ERROR';
7: G_SQLCODE_TOKEN CONSTANT varchar2(200) := 'ERROR_CODE';
8: G_SQLERRM_TOKEN CONSTANT varchar2(200) := 'ERROR_MESSAGE';
9: g_return_status varchar2(1) := OKC_API.G_RET_STS_SUCCESS;
10: G_EXCEPTION_HALT_VALIDATION exception;
11: /*+++++++++++++End of hand code +++++++++++++++++++*/
12: ---------------------------------------------------------------------------
13: -- FUNCTION get_seq_id
294: okc_debug.Set_Indentation('OKC_CTC_PVT');
295: okc_debug.log('900: Entered null_out_defaults', 2);
296: END IF;
297:
298: IF (l_ctcv_rec.object_version_number = OKC_API.G_MISS_NUM) THEN
299: l_ctcv_rec.object_version_number := NULL;
300: END IF;
301: IF (l_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM) THEN
302: l_ctcv_rec.cpl_id := NULL;
297:
298: IF (l_ctcv_rec.object_version_number = OKC_API.G_MISS_NUM) THEN
299: l_ctcv_rec.object_version_number := NULL;
300: END IF;
301: IF (l_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM) THEN
302: l_ctcv_rec.cpl_id := NULL;
303: END IF;
304: IF (l_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR) THEN
305: l_ctcv_rec.cro_code := NULL;
300: END IF;
301: IF (l_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM) THEN
302: l_ctcv_rec.cpl_id := NULL;
303: END IF;
304: IF (l_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR) THEN
305: l_ctcv_rec.cro_code := NULL;
306: END IF;
307: IF (l_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM) THEN
308: l_ctcv_rec.dnz_chr_id := NULL;
303: END IF;
304: IF (l_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR) THEN
305: l_ctcv_rec.cro_code := NULL;
306: END IF;
307: IF (l_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM) THEN
308: l_ctcv_rec.dnz_chr_id := NULL;
309: END IF;
310: IF (l_ctcv_rec.contact_sequence = OKC_API.G_MISS_NUM) THEN
311: l_ctcv_rec.contact_sequence := NULL;
306: END IF;
307: IF (l_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM) THEN
308: l_ctcv_rec.dnz_chr_id := NULL;
309: END IF;
310: IF (l_ctcv_rec.contact_sequence = OKC_API.G_MISS_NUM) THEN
311: l_ctcv_rec.contact_sequence := NULL;
312: END IF;
313: IF (l_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR) THEN
314: l_ctcv_rec.object1_id1 := NULL;
309: END IF;
310: IF (l_ctcv_rec.contact_sequence = OKC_API.G_MISS_NUM) THEN
311: l_ctcv_rec.contact_sequence := NULL;
312: END IF;
313: IF (l_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR) THEN
314: l_ctcv_rec.object1_id1 := NULL;
315: END IF;
316: IF (l_ctcv_rec.object1_id2 = OKC_API.G_MISS_CHAR) THEN
317: l_ctcv_rec.object1_id2 := NULL;
312: END IF;
313: IF (l_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR) THEN
314: l_ctcv_rec.object1_id1 := NULL;
315: END IF;
316: IF (l_ctcv_rec.object1_id2 = OKC_API.G_MISS_CHAR) THEN
317: l_ctcv_rec.object1_id2 := NULL;
318: END IF;
319: IF (l_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR) THEN
320: l_ctcv_rec.JTOT_OBJECT1_CODE := NULL;
315: END IF;
316: IF (l_ctcv_rec.object1_id2 = OKC_API.G_MISS_CHAR) THEN
317: l_ctcv_rec.object1_id2 := NULL;
318: END IF;
319: IF (l_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR) THEN
320: l_ctcv_rec.JTOT_OBJECT1_CODE := NULL;
321: END IF;
322: IF (l_ctcv_rec.primary_yn = OKC_API.G_MISS_CHAR) THEN
323: l_ctcv_rec.PRIMARY_YN :=NULL;
318: END IF;
319: IF (l_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR) THEN
320: l_ctcv_rec.JTOT_OBJECT1_CODE := NULL;
321: END IF;
322: IF (l_ctcv_rec.primary_yn = OKC_API.G_MISS_CHAR) THEN
323: l_ctcv_rec.PRIMARY_YN :=NULL;
324: END IF;
325: IF (l_ctcv_rec.resource_class = OKC_API.G_MISS_CHAR) THEN
326: l_ctcv_rec.RESOURCE_CLASS :=NULL;
321: END IF;
322: IF (l_ctcv_rec.primary_yn = OKC_API.G_MISS_CHAR) THEN
323: l_ctcv_rec.PRIMARY_YN :=NULL;
324: END IF;
325: IF (l_ctcv_rec.resource_class = OKC_API.G_MISS_CHAR) THEN
326: l_ctcv_rec.RESOURCE_CLASS :=NULL;
327: END IF;
328: IF (l_ctcv_rec.SALES_GROUP_ID = OKC_API.G_MISS_NUM) THEN
329: l_ctcv_rec.SALES_GROUP_ID :=NULL;
324: END IF;
325: IF (l_ctcv_rec.resource_class = OKC_API.G_MISS_CHAR) THEN
326: l_ctcv_rec.RESOURCE_CLASS :=NULL;
327: END IF;
328: IF (l_ctcv_rec.SALES_GROUP_ID = OKC_API.G_MISS_NUM) THEN
329: l_ctcv_rec.SALES_GROUP_ID :=NULL;
330: END IF;
331: IF (l_ctcv_rec.attribute_category = OKC_API.G_MISS_CHAR) THEN
332: l_ctcv_rec.attribute_category := NULL;
327: END IF;
328: IF (l_ctcv_rec.SALES_GROUP_ID = OKC_API.G_MISS_NUM) THEN
329: l_ctcv_rec.SALES_GROUP_ID :=NULL;
330: END IF;
331: IF (l_ctcv_rec.attribute_category = OKC_API.G_MISS_CHAR) THEN
332: l_ctcv_rec.attribute_category := NULL;
333: END IF;
334: IF (l_ctcv_rec.attribute1 = OKC_API.G_MISS_CHAR) THEN
335: l_ctcv_rec.attribute1 := NULL;
330: END IF;
331: IF (l_ctcv_rec.attribute_category = OKC_API.G_MISS_CHAR) THEN
332: l_ctcv_rec.attribute_category := NULL;
333: END IF;
334: IF (l_ctcv_rec.attribute1 = OKC_API.G_MISS_CHAR) THEN
335: l_ctcv_rec.attribute1 := NULL;
336: END IF;
337: IF (l_ctcv_rec.attribute2 = OKC_API.G_MISS_CHAR) THEN
338: l_ctcv_rec.attribute2 := NULL;
333: END IF;
334: IF (l_ctcv_rec.attribute1 = OKC_API.G_MISS_CHAR) THEN
335: l_ctcv_rec.attribute1 := NULL;
336: END IF;
337: IF (l_ctcv_rec.attribute2 = OKC_API.G_MISS_CHAR) THEN
338: l_ctcv_rec.attribute2 := NULL;
339: END IF;
340: IF (l_ctcv_rec.attribute3 = OKC_API.G_MISS_CHAR) THEN
341: l_ctcv_rec.attribute3 := NULL;
336: END IF;
337: IF (l_ctcv_rec.attribute2 = OKC_API.G_MISS_CHAR) THEN
338: l_ctcv_rec.attribute2 := NULL;
339: END IF;
340: IF (l_ctcv_rec.attribute3 = OKC_API.G_MISS_CHAR) THEN
341: l_ctcv_rec.attribute3 := NULL;
342: END IF;
343: IF (l_ctcv_rec.attribute4 = OKC_API.G_MISS_CHAR) THEN
344: l_ctcv_rec.attribute4 := NULL;
339: END IF;
340: IF (l_ctcv_rec.attribute3 = OKC_API.G_MISS_CHAR) THEN
341: l_ctcv_rec.attribute3 := NULL;
342: END IF;
343: IF (l_ctcv_rec.attribute4 = OKC_API.G_MISS_CHAR) THEN
344: l_ctcv_rec.attribute4 := NULL;
345: END IF;
346: IF (l_ctcv_rec.attribute5 = OKC_API.G_MISS_CHAR) THEN
347: l_ctcv_rec.attribute5 := NULL;
342: END IF;
343: IF (l_ctcv_rec.attribute4 = OKC_API.G_MISS_CHAR) THEN
344: l_ctcv_rec.attribute4 := NULL;
345: END IF;
346: IF (l_ctcv_rec.attribute5 = OKC_API.G_MISS_CHAR) THEN
347: l_ctcv_rec.attribute5 := NULL;
348: END IF;
349: IF (l_ctcv_rec.attribute6 = OKC_API.G_MISS_CHAR) THEN
350: l_ctcv_rec.attribute6 := NULL;
345: END IF;
346: IF (l_ctcv_rec.attribute5 = OKC_API.G_MISS_CHAR) THEN
347: l_ctcv_rec.attribute5 := NULL;
348: END IF;
349: IF (l_ctcv_rec.attribute6 = OKC_API.G_MISS_CHAR) THEN
350: l_ctcv_rec.attribute6 := NULL;
351: END IF;
352: IF (l_ctcv_rec.attribute7 = OKC_API.G_MISS_CHAR) THEN
353: l_ctcv_rec.attribute7 := NULL;
348: END IF;
349: IF (l_ctcv_rec.attribute6 = OKC_API.G_MISS_CHAR) THEN
350: l_ctcv_rec.attribute6 := NULL;
351: END IF;
352: IF (l_ctcv_rec.attribute7 = OKC_API.G_MISS_CHAR) THEN
353: l_ctcv_rec.attribute7 := NULL;
354: END IF;
355: IF (l_ctcv_rec.attribute8 = OKC_API.G_MISS_CHAR) THEN
356: l_ctcv_rec.attribute8 := NULL;
351: END IF;
352: IF (l_ctcv_rec.attribute7 = OKC_API.G_MISS_CHAR) THEN
353: l_ctcv_rec.attribute7 := NULL;
354: END IF;
355: IF (l_ctcv_rec.attribute8 = OKC_API.G_MISS_CHAR) THEN
356: l_ctcv_rec.attribute8 := NULL;
357: END IF;
358: IF (l_ctcv_rec.attribute9 = OKC_API.G_MISS_CHAR) THEN
359: l_ctcv_rec.attribute9 := NULL;
354: END IF;
355: IF (l_ctcv_rec.attribute8 = OKC_API.G_MISS_CHAR) THEN
356: l_ctcv_rec.attribute8 := NULL;
357: END IF;
358: IF (l_ctcv_rec.attribute9 = OKC_API.G_MISS_CHAR) THEN
359: l_ctcv_rec.attribute9 := NULL;
360: END IF;
361: IF (l_ctcv_rec.attribute10 = OKC_API.G_MISS_CHAR) THEN
362: l_ctcv_rec.attribute10 := NULL;
357: END IF;
358: IF (l_ctcv_rec.attribute9 = OKC_API.G_MISS_CHAR) THEN
359: l_ctcv_rec.attribute9 := NULL;
360: END IF;
361: IF (l_ctcv_rec.attribute10 = OKC_API.G_MISS_CHAR) THEN
362: l_ctcv_rec.attribute10 := NULL;
363: END IF;
364: IF (l_ctcv_rec.attribute11 = OKC_API.G_MISS_CHAR) THEN
365: l_ctcv_rec.attribute11 := NULL;
360: END IF;
361: IF (l_ctcv_rec.attribute10 = OKC_API.G_MISS_CHAR) THEN
362: l_ctcv_rec.attribute10 := NULL;
363: END IF;
364: IF (l_ctcv_rec.attribute11 = OKC_API.G_MISS_CHAR) THEN
365: l_ctcv_rec.attribute11 := NULL;
366: END IF;
367: IF (l_ctcv_rec.attribute12 = OKC_API.G_MISS_CHAR) THEN
368: l_ctcv_rec.attribute12 := NULL;
363: END IF;
364: IF (l_ctcv_rec.attribute11 = OKC_API.G_MISS_CHAR) THEN
365: l_ctcv_rec.attribute11 := NULL;
366: END IF;
367: IF (l_ctcv_rec.attribute12 = OKC_API.G_MISS_CHAR) THEN
368: l_ctcv_rec.attribute12 := NULL;
369: END IF;
370: IF (l_ctcv_rec.attribute13 = OKC_API.G_MISS_CHAR) THEN
371: l_ctcv_rec.attribute13 := NULL;
366: END IF;
367: IF (l_ctcv_rec.attribute12 = OKC_API.G_MISS_CHAR) THEN
368: l_ctcv_rec.attribute12 := NULL;
369: END IF;
370: IF (l_ctcv_rec.attribute13 = OKC_API.G_MISS_CHAR) THEN
371: l_ctcv_rec.attribute13 := NULL;
372: END IF;
373: IF (l_ctcv_rec.attribute14 = OKC_API.G_MISS_CHAR) THEN
374: l_ctcv_rec.attribute14 := NULL;
369: END IF;
370: IF (l_ctcv_rec.attribute13 = OKC_API.G_MISS_CHAR) THEN
371: l_ctcv_rec.attribute13 := NULL;
372: END IF;
373: IF (l_ctcv_rec.attribute14 = OKC_API.G_MISS_CHAR) THEN
374: l_ctcv_rec.attribute14 := NULL;
375: END IF;
376: IF (l_ctcv_rec.attribute15 = OKC_API.G_MISS_CHAR) THEN
377: l_ctcv_rec.attribute15 := NULL;
372: END IF;
373: IF (l_ctcv_rec.attribute14 = OKC_API.G_MISS_CHAR) THEN
374: l_ctcv_rec.attribute14 := NULL;
375: END IF;
376: IF (l_ctcv_rec.attribute15 = OKC_API.G_MISS_CHAR) THEN
377: l_ctcv_rec.attribute15 := NULL;
378: END IF;
379: IF (l_ctcv_rec.created_by = OKC_API.G_MISS_NUM) THEN
380: l_ctcv_rec.created_by := NULL;
375: END IF;
376: IF (l_ctcv_rec.attribute15 = OKC_API.G_MISS_CHAR) THEN
377: l_ctcv_rec.attribute15 := NULL;
378: END IF;
379: IF (l_ctcv_rec.created_by = OKC_API.G_MISS_NUM) THEN
380: l_ctcv_rec.created_by := NULL;
381: END IF;
382: IF (l_ctcv_rec.creation_date = OKC_API.G_MISS_DATE) THEN
383: l_ctcv_rec.creation_date := NULL;
378: END IF;
379: IF (l_ctcv_rec.created_by = OKC_API.G_MISS_NUM) THEN
380: l_ctcv_rec.created_by := NULL;
381: END IF;
382: IF (l_ctcv_rec.creation_date = OKC_API.G_MISS_DATE) THEN
383: l_ctcv_rec.creation_date := NULL;
384: END IF;
385: IF (l_ctcv_rec.last_updated_by = OKC_API.G_MISS_NUM) THEN
386: l_ctcv_rec.last_updated_by := NULL;
381: END IF;
382: IF (l_ctcv_rec.creation_date = OKC_API.G_MISS_DATE) THEN
383: l_ctcv_rec.creation_date := NULL;
384: END IF;
385: IF (l_ctcv_rec.last_updated_by = OKC_API.G_MISS_NUM) THEN
386: l_ctcv_rec.last_updated_by := NULL;
387: END IF;
388: IF (l_ctcv_rec.last_update_date = OKC_API.G_MISS_DATE) THEN
389: l_ctcv_rec.last_update_date := NULL;
384: END IF;
385: IF (l_ctcv_rec.last_updated_by = OKC_API.G_MISS_NUM) THEN
386: l_ctcv_rec.last_updated_by := NULL;
387: END IF;
388: IF (l_ctcv_rec.last_update_date = OKC_API.G_MISS_DATE) THEN
389: l_ctcv_rec.last_update_date := NULL;
390: END IF;
391: IF (l_ctcv_rec.last_update_login = OKC_API.G_MISS_NUM) THEN
392: l_ctcv_rec.last_update_login := NULL;
387: END IF;
388: IF (l_ctcv_rec.last_update_date = OKC_API.G_MISS_DATE) THEN
389: l_ctcv_rec.last_update_date := NULL;
390: END IF;
391: IF (l_ctcv_rec.last_update_login = OKC_API.G_MISS_NUM) THEN
392: l_ctcv_rec.last_update_login := NULL;
393: END IF;
394: IF (l_ctcv_rec.start_date = OKC_API.G_MISS_DATE) THEN
395: l_ctcv_rec.start_date := NULL;
390: END IF;
391: IF (l_ctcv_rec.last_update_login = OKC_API.G_MISS_NUM) THEN
392: l_ctcv_rec.last_update_login := NULL;
393: END IF;
394: IF (l_ctcv_rec.start_date = OKC_API.G_MISS_DATE) THEN
395: l_ctcv_rec.start_date := NULL;
396: END IF;
397: IF (l_ctcv_rec.end_date = OKC_API.G_MISS_DATE) THEN
398: l_ctcv_rec.end_date := NULL;
393: END IF;
394: IF (l_ctcv_rec.start_date = OKC_API.G_MISS_DATE) THEN
395: l_ctcv_rec.start_date := NULL;
396: END IF;
397: IF (l_ctcv_rec.end_date = OKC_API.G_MISS_DATE) THEN
398: l_ctcv_rec.end_date := NULL;
399: END IF;
400:
401: IF (l_debug = 'Y') THEN
433: okc_debug.Set_Indentation('OKC_CTC_PVT');
434: okc_debug.log('1000: Entered validate_cpl_id', 2);
435: END IF;
436:
437: x_return_status := OKC_API.G_RET_STS_SUCCESS;
438: if (p_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM) then
439: return;
440: end if;
441: if (p_ctcv_rec.cpl_id is NULL) then
434: okc_debug.log('1000: Entered validate_cpl_id', 2);
435: END IF;
436:
437: x_return_status := OKC_API.G_RET_STS_SUCCESS;
438: if (p_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM) then
439: return;
440: end if;
441: if (p_ctcv_rec.cpl_id is NULL) then
442: OKC_API.set_message(p_app_name => g_app_name,
438: if (p_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM) then
439: return;
440: end if;
441: if (p_ctcv_rec.cpl_id is NULL) then
442: OKC_API.set_message(p_app_name => g_app_name,
443: p_msg_name => G_REQUIRED_VALUE,
444: p_token1 => G_COL_NAME_TOKEN,
445: p_token1_value => 'CPL_ID');
446: raise G_EXCEPTION_HALT_VALIDATION;
448: open l_cpl_csr;
449: fetch l_cpl_csr into l_dummy_var;
450: close l_cpl_csr;
451: if (l_dummy_var = '?') then
452: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'CPL_ID');
453: raise G_EXCEPTION_HALT_VALIDATION;
454: end if;
455:
456: IF (l_debug = 'Y') THEN
465: okc_debug.log('1200: Exiting validate_cpl_id:G_EXCEPTION_HALT_VALIDATION Exception', 2);
466: okc_debug.Reset_Indentation;
467: END IF;
468:
469: x_return_status := OKC_API.G_RET_STS_ERROR;
470: when OTHERS then
471:
472: IF (l_debug = 'Y') THEN
473: okc_debug.log('1300: Exiting validate_cpl_id:OTHERS Exception', 2);
476:
477: if l_cpl_csr%ISOPEN then
478: close l_cpl_csr;
479: end if;
480: OKC_API.set_message(p_app_name => g_app_name,
481: p_msg_name => g_unexpected_error,
482: p_token1 => g_sqlcode_token,
483: p_token1_value => sqlcode,
484: p_token2 => g_sqlerrm_token,
482: p_token1 => g_sqlcode_token,
483: p_token1_value => sqlcode,
484: p_token2 => g_sqlerrm_token,
485: p_token2_value => sqlerrm);
486: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
487:
488: end validate_cpl_id;
489:
490: -- Start of comments
506: okc_debug.Set_Indentation('OKC_CTC_PVT');
507: okc_debug.log('1400: Entered validate_cro_code', 2);
508: END IF;
509:
510: x_return_status := OKC_API.G_RET_STS_SUCCESS;
511: if (p_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR) then
512: return;
513: end if;
514: if (p_ctcv_rec.cro_code is NULL) then
507: okc_debug.log('1400: Entered validate_cro_code', 2);
508: END IF;
509:
510: x_return_status := OKC_API.G_RET_STS_SUCCESS;
511: if (p_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR) then
512: return;
513: end if;
514: if (p_ctcv_rec.cro_code is NULL) then
515: OKC_API.set_message(p_app_name => g_app_name,
511: if (p_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR) then
512: return;
513: end if;
514: if (p_ctcv_rec.cro_code is NULL) then
515: OKC_API.set_message(p_app_name => g_app_name,
516: p_msg_name => G_REQUIRED_VALUE,
517: p_token1 => G_COL_NAME_TOKEN,
518: p_token1_value => 'CRO_CODE');
519: raise G_EXCEPTION_HALT_VALIDATION;
520: end if;
521:
522: --
523: x_return_status := OKC_UTIL.check_lookup_code('OKC_CONTACT_ROLE',p_ctcv_rec.cro_code);
524: if (x_return_status <> OKC_API.G_RET_STS_SUCCESS) then
525: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'CRO_CODE');
526: x_return_status := OKC_API.G_RET_STS_ERROR;
527: end if;
528: IF (l_debug = 'Y') THEN
521:
522: --
523: x_return_status := OKC_UTIL.check_lookup_code('OKC_CONTACT_ROLE',p_ctcv_rec.cro_code);
524: if (x_return_status <> OKC_API.G_RET_STS_SUCCESS) then
525: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'CRO_CODE');
526: x_return_status := OKC_API.G_RET_STS_ERROR;
527: end if;
528: IF (l_debug = 'Y') THEN
529: okc_debug.log('1500: Leaving validate_cro_code', 2);
522: --
523: x_return_status := OKC_UTIL.check_lookup_code('OKC_CONTACT_ROLE',p_ctcv_rec.cro_code);
524: if (x_return_status <> OKC_API.G_RET_STS_SUCCESS) then
525: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'CRO_CODE');
526: x_return_status := OKC_API.G_RET_STS_ERROR;
527: end if;
528: IF (l_debug = 'Y') THEN
529: okc_debug.log('1500: Leaving validate_cro_code', 2);
530: okc_debug.Reset_Indentation;
537: okc_debug.log('1600: Exiting validate_cro_code:G_EXCEPTION_HALT_VALIDATION Exception', 2);
538: okc_debug.Reset_Indentation;
539: END IF;
540:
541: x_return_status := OKC_API.G_RET_STS_ERROR;
542: when OTHERS then
543:
544: IF (l_debug = 'Y') THEN
545: okc_debug.log('1700: Exiting validate_cro_code:OTHERS Exception', 2);
545: okc_debug.log('1700: Exiting validate_cro_code:OTHERS Exception', 2);
546: okc_debug.Reset_Indentation;
547: END IF;
548:
549: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
550: p_msg_name => g_unexpected_error,
551: p_token1 => g_sqlcode_token,
552: p_token1_value => sqlcode,
553: p_token2 => g_sqlerrm_token,
551: p_token1 => g_sqlcode_token,
552: p_token1_value => sqlcode,
553: p_token2 => g_sqlerrm_token,
554: p_token2_value => sqlerrm);
555: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
556:
557: end validate_cro_code;
558:
559: -- Start of comments
591: okc_debug.Set_Indentation('OKC_CTC_PVT');
592: okc_debug.log('1800: Entered validate_JTOT_OBJECT1_CODE', 2);
593: END IF;
594:
595: x_return_status := OKC_API.G_RET_STS_SUCCESS;
596: if (p_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR or p_ctcv_rec.jtot_object1_code is NULL) then
597: return;
598: end if;
599: --
592: okc_debug.log('1800: Entered validate_JTOT_OBJECT1_CODE', 2);
593: END IF;
594:
595: x_return_status := OKC_API.G_RET_STS_SUCCESS;
596: if (p_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR or p_ctcv_rec.jtot_object1_code is NULL) then
597: return;
598: end if;
599: --
600: open l_object1_csr;
600: open l_object1_csr;
601: fetch l_object1_csr into l_dummy_var;
602: close l_object1_csr;
603: if (l_dummy_var = '?') then
604: OKC_API.set_message(G_APP_NAME,G_INVALID_VALUE,G_COL_NAME_TOKEN,'JTOT_OBJECT1_CODE');
605: x_return_status := OKC_API.G_RET_STS_ERROR;
606: end if;
607:
608: IF (l_debug = 'Y') THEN
601: fetch l_object1_csr into l_dummy_var;
602: close l_object1_csr;
603: if (l_dummy_var = '?') then
604: OKC_API.set_message(G_APP_NAME,G_INVALID_VALUE,G_COL_NAME_TOKEN,'JTOT_OBJECT1_CODE');
605: x_return_status := OKC_API.G_RET_STS_ERROR;
606: end if;
607:
608: IF (l_debug = 'Y') THEN
609: okc_debug.log('1900: Leaving validate_JTOT_OBJECT1_CODE', 2);
620:
621: if l_object1_csr%ISOPEN then
622: close l_object1_csr;
623: end if;
624: OKC_API.set_message(p_app_name => g_app_name,
625: p_msg_name => g_unexpected_error,
626: p_token1 => g_sqlcode_token,
627: p_token1_value => sqlcode,
628: p_token2 => g_sqlerrm_token,
626: p_token1 => g_sqlcode_token,
627: p_token1_value => sqlcode,
628: p_token2 => g_sqlerrm_token,
629: p_token2_value => sqlerrm);
630: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
631:
632: end validate_JTOT_OBJECT1_CODE;
633:
634: -- Start of comments
831: okc_debug.Set_Indentation('OKC_CTC_PVT');
832: okc_debug.log('2100: Entered validate_object1_id1', 2);
833: END IF;
834:
835: x_return_status := OKC_API.G_RET_STS_SUCCESS;
836: if (p_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR or p_ctcv_rec.JTOT_OBJECT1_CODE is NULL) then
837: return;
838: end if;
839: if (p_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR or p_ctcv_rec.object1_id1 is NULL) then
832: okc_debug.log('2100: Entered validate_object1_id1', 2);
833: END IF;
834:
835: x_return_status := OKC_API.G_RET_STS_SUCCESS;
836: if (p_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR or p_ctcv_rec.JTOT_OBJECT1_CODE is NULL) then
837: return;
838: end if;
839: if (p_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR or p_ctcv_rec.object1_id1 is NULL) then
840: return;
835: x_return_status := OKC_API.G_RET_STS_SUCCESS;
836: if (p_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR or p_ctcv_rec.JTOT_OBJECT1_CODE is NULL) then
837: return;
838: end if;
839: if (p_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR or p_ctcv_rec.object1_id1 is NULL) then
840: return;
841: end if;
842: open l_object1_csr;
843: fetch l_object1_csr into l_from_table, l_where_clause;
875: okc_debug.log('2400: Exiting validate_object1_id1:e_column_not_exists Exception', 2);
876: okc_debug.Reset_Indentation;
877: END IF;
878:
879: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2');
880: x_return_status := OKC_API.G_RET_STS_ERROR;
881: return;
882: when e_too_many_rows then
883:
876: okc_debug.Reset_Indentation;
877: END IF;
878:
879: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2');
880: x_return_status := OKC_API.G_RET_STS_ERROR;
881: return;
882: when e_too_many_rows then
883:
884: IF (l_debug = 'Y') THEN
885: okc_debug.log('2500: Exiting validate_object1_id1:e_too_many_rows Exception', 2);
886: okc_debug.Reset_Indentation;
887: END IF;
888:
889: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2');
890: x_return_status := OKC_API.G_RET_STS_ERROR;
891: return;
892: end;
893: else
886: okc_debug.Reset_Indentation;
887: END IF;
888:
889: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2');
890: x_return_status := OKC_API.G_RET_STS_ERROR;
891: return;
892: end;
893: else
894: begin
928: okc_debug.log('2800: Exiting validate_object1_id1:e_column_not_exists Exception', 2);
929: okc_debug.Reset_Indentation;
930: END IF;
931:
932: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2, .PARTY_ID, .PARTY_ID2');
933: x_return_status := OKC_API.G_RET_STS_ERROR;
934: return;
935: when e_too_many_rows then
936:
929: okc_debug.Reset_Indentation;
930: END IF;
931:
932: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2, .PARTY_ID, .PARTY_ID2');
933: x_return_status := OKC_API.G_RET_STS_ERROR;
934: return;
935: when e_too_many_rows then
936:
937: IF (l_debug = 'Y') THEN
938: okc_debug.log('2900: Exiting validate_object1_id1:e_too_many_rows Exception', 2);
939: okc_debug.Reset_Indentation;
940: END IF;
941:
942: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2, .PARTY_ID, .PARTY_ID2');
943: x_return_status := OKC_API.G_RET_STS_ERROR;
944: return;
945: end;
946: end if;
939: okc_debug.Reset_Indentation;
940: END IF;
941:
942: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2, .PARTY_ID, .PARTY_ID2');
943: x_return_status := OKC_API.G_RET_STS_ERROR;
944: return;
945: end;
946: end if;
947: --
957: okc_debug.log('3100: Exiting validate_object1_id1:e_source_not_exists Exception', 2);
958: okc_debug.Reset_Indentation;
959: END IF;
960:
961: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'JTOT_OBJECT1_CODE');
962: x_return_status := OKC_API.G_RET_STS_ERROR;
963: when e_source_not_exists1 then
964:
965: IF (l_debug = 'Y') THEN
958: okc_debug.Reset_Indentation;
959: END IF;
960:
961: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'JTOT_OBJECT1_CODE');
962: x_return_status := OKC_API.G_RET_STS_ERROR;
963: when e_source_not_exists1 then
964:
965: IF (l_debug = 'Y') THEN
966: okc_debug.log('3200: Exiting validate_object1_id1:e_source_not_exists1 Exception', 2);
966: okc_debug.log('3200: Exiting validate_object1_id1:e_source_not_exists1 Exception', 2);
967: okc_debug.Reset_Indentation;
968: END IF;
969:
970: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'JTOT_OBJECT1_CODE');
971: x_return_status := OKC_API.G_RET_STS_ERROR;
972: when e_no_data_found then
973:
974: IF (l_debug = 'Y') THEN
967: okc_debug.Reset_Indentation;
968: END IF;
969:
970: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'JTOT_OBJECT1_CODE');
971: x_return_status := OKC_API.G_RET_STS_ERROR;
972: when e_no_data_found then
973:
974: IF (l_debug = 'Y') THEN
975: okc_debug.log('3300: Exiting validate_object1_id1:e_no_data_found Exception', 2);
975: okc_debug.log('3300: Exiting validate_object1_id1:e_no_data_found Exception', 2);
976: okc_debug.Reset_Indentation;
977: END IF;
978:
979: OKC_API.set_message(G_APP_NAME,'OKC_INVALID_CONTACT');
980: x_return_status := OKC_API.G_RET_STS_ERROR;
981: when OTHERS then
982:
983: IF (l_debug = 'Y') THEN
976: okc_debug.Reset_Indentation;
977: END IF;
978:
979: OKC_API.set_message(G_APP_NAME,'OKC_INVALID_CONTACT');
980: x_return_status := OKC_API.G_RET_STS_ERROR;
981: when OTHERS then
982:
983: IF (l_debug = 'Y') THEN
984: okc_debug.log('3400: Exiting validate_object1_id1:OTHERS Exception', 2);
990: end if;
991: if l2_object1_csr%ISOPEN then
992: close l2_object1_csr;
993: end if;
994: OKC_API.set_message(p_app_name => g_app_name,
995: p_msg_name => g_unexpected_error,
996: p_token1 => g_sqlcode_token,
997: p_token1_value => sqlcode,
998: p_token2 => g_sqlerrm_token,
996: p_token1 => g_sqlcode_token,
997: p_token1_value => sqlcode,
998: p_token2 => g_sqlerrm_token,
999: p_token2_value => sqlerrm);
1000: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1001:
1002: end validate_object1_id1;
1003:
1004: -- Start of comments
1023: okc_debug.Set_Indentation('OKC_CTC_PVT');
1024: okc_debug.log('3500: Entered validate_dnz_chr_id', 2);
1025: END IF;
1026:
1027: x_return_status := OKC_API.G_RET_STS_SUCCESS;
1028: if (p_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM) then
1029: return;
1030: end if;
1031: if (p_ctcv_rec.dnz_chr_id is NULL) then
1024: okc_debug.log('3500: Entered validate_dnz_chr_id', 2);
1025: END IF;
1026:
1027: x_return_status := OKC_API.G_RET_STS_SUCCESS;
1028: if (p_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM) then
1029: return;
1030: end if;
1031: if (p_ctcv_rec.dnz_chr_id is NULL) then
1032: OKC_API.set_message(p_app_name => g_app_name,
1028: if (p_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM) then
1029: return;
1030: end if;
1031: if (p_ctcv_rec.dnz_chr_id is NULL) then
1032: OKC_API.set_message(p_app_name => g_app_name,
1033: p_msg_name => G_REQUIRED_VALUE,
1034: p_token1 => G_COL_NAME_TOKEN,
1035: p_token1_value => 'DNZ_CHR_ID');
1036: x_return_status := OKC_API.G_RET_STS_ERROR;
1032: OKC_API.set_message(p_app_name => g_app_name,
1033: p_msg_name => G_REQUIRED_VALUE,
1034: p_token1 => G_COL_NAME_TOKEN,
1035: p_token1_value => 'DNZ_CHR_ID');
1036: x_return_status := OKC_API.G_RET_STS_ERROR;
1037: return;
1038: end if;
1039: open Kt_Hr_Mj_Vr;
1040: fetch Kt_Hr_Mj_Vr into l_dummy;
1039: open Kt_Hr_Mj_Vr;
1040: fetch Kt_Hr_Mj_Vr into l_dummy;
1041: close Kt_Hr_Mj_Vr;
1042: if (l_dummy='?') then
1043: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'DNZ_CHR_ID');
1044: x_return_status := OKC_API.G_RET_STS_ERROR;
1045: return;
1046: end if;
1047:
1040: fetch Kt_Hr_Mj_Vr into l_dummy;
1041: close Kt_Hr_Mj_Vr;
1042: if (l_dummy='?') then
1043: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'DNZ_CHR_ID');
1044: x_return_status := OKC_API.G_RET_STS_ERROR;
1045: return;
1046: end if;
1047:
1048: IF (l_debug = 'Y') THEN
1057: okc_debug.log('3700: Exiting validate_dnz_chr_id:OTHERS Exception', 2);
1058: okc_debug.Reset_Indentation;
1059: END IF;
1060:
1061: OKC_API.set_message(p_app_name => g_app_name,
1062: p_msg_name => g_unexpected_error,
1063: p_token1 => g_sqlcode_token,
1064: p_token1_value => sqlcode,
1065: p_token2 => g_sqlerrm_token,
1063: p_token1 => g_sqlcode_token,
1064: p_token1_value => sqlcode,
1065: p_token2 => g_sqlerrm_token,
1066: p_token2_value => sqlerrm);
1067: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1068:
1069: end validate_dnz_chr_id;
1070:
1071: -- Start of comments
1100: okc_debug.log('4150: Entered validate_primary_yn', 2);
1101: END IF;
1102:
1103: -- initialize return status
1104: x_return_status := OKC_API.G_RET_STS_SUCCESS;
1105:
1106: -- check that data exists
1107: IF (p_ctcv_rec.primary_yn IS NOT NULL AND
1108: p_ctcv_rec.primary_yn <> OKC_API.G_MISS_CHAR) THEN
1104: x_return_status := OKC_API.G_RET_STS_SUCCESS;
1105:
1106: -- check that data exists
1107: IF (p_ctcv_rec.primary_yn IS NOT NULL AND
1108: p_ctcv_rec.primary_yn <> OKC_API.G_MISS_CHAR) THEN
1109:
1110: IF p_ctcv_rec.primary_yn NOT IN ('Y','N') Then
1111: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
1112: p_msg_name => g_invalid_value,
1107: IF (p_ctcv_rec.primary_yn IS NOT NULL AND
1108: p_ctcv_rec.primary_yn <> OKC_API.G_MISS_CHAR) THEN
1109:
1110: IF p_ctcv_rec.primary_yn NOT IN ('Y','N') Then
1111: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
1112: p_msg_name => g_invalid_value,
1113: p_token1 => g_col_name_token,
1114: p_token1_value => 'PRIMARY_YN');
1115: -- notify caller of an error
1112: p_msg_name => g_invalid_value,
1113: p_token1 => g_col_name_token,
1114: p_token1_value => 'PRIMARY_YN');
1115: -- notify caller of an error
1116: x_return_status := OKC_API.G_RET_STS_ERROR;
1117: -- halt validation
1118: raise G_EXCEPTION_HALT_VALIDATION;
1119: END IF;
1120: END IF; -- end of (p_ctcv_rec.primary_yn <> OKC_API.G_MISS_CHAR OR ---
1116: x_return_status := OKC_API.G_RET_STS_ERROR;
1117: -- halt validation
1118: raise G_EXCEPTION_HALT_VALIDATION;
1119: END IF;
1120: END IF; -- end of (p_ctcv_rec.primary_yn <> OKC_API.G_MISS_CHAR OR ---
1121:
1122: IF (p_ctcv_rec.primary_yn = 'Y') THEN
1123: --- (p_ctcv_rec.end_date >= trunc(SYSDATE)) THEN ---Bug#2284573
1124: -----(SYSDATE between p_ctcv_rec.start_date AND p_ctcv_rec.end_date) THEN ---Bug#2284573
1125: OPEN l_contacts_csr;
1126: FETCH l_contacts_csr INTO l_dummy;
1127: CLOSE l_contacts_csr;
1128: IF (l_dummy='!') THEN
1129: OKC_API.set_message(G_APP_NAME,'OKC_PRIMARY_CONTACT_ERROR');
1130: x_return_status := OKC_API.G_RET_STS_ERROR;
1131: IF (l_debug = 'Y') THEN
1132: okc_debug.Reset_Indentation;
1133: END IF;
1126: FETCH l_contacts_csr INTO l_dummy;
1127: CLOSE l_contacts_csr;
1128: IF (l_dummy='!') THEN
1129: OKC_API.set_message(G_APP_NAME,'OKC_PRIMARY_CONTACT_ERROR');
1130: x_return_status := OKC_API.G_RET_STS_ERROR;
1131: IF (l_debug = 'Y') THEN
1132: okc_debug.Reset_Indentation;
1133: END IF;
1134: RETURN;
1154: okc_debug.Reset_Indentation;
1155: END IF;
1156:
1157: -- store SQL error message on message stack
1158: OKC_API.SET_MESSAGE(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,
1162: p_token2 => g_sqlerrm_token,
1163: p_token2_value => sqlerrm);
1164:
1165: -- notify caller of an error as UNEXPETED error
1166: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1167:
1168: End validate_primary_yn;
1169:
1170:
1185: okc_debug.log('4250: Entered validate_resource_class', 2);
1186: END IF;
1187:
1188: -- initialize return status
1189: x_return_status := OKC_API.G_RET_STS_SUCCESS;
1190:
1191: -- check that data exists
1192: IF (p_ctcv_rec.resource_class IS NOT NULL AND
1193: p_ctcv_rec.resource_class <> OKC_API.G_MISS_CHAR) THEN
1189: x_return_status := OKC_API.G_RET_STS_SUCCESS;
1190:
1191: -- check that data exists
1192: IF (p_ctcv_rec.resource_class IS NOT NULL AND
1193: p_ctcv_rec.resource_class <> OKC_API.G_MISS_CHAR) THEN
1194:
1195: -- Check If the value is a valid code from lookup table
1196: x_return_status := OKC_UTIL.check_lookup_code('OKS_RESOURCE_CLASS',
1197: p_ctcv_rec.resource_class);
1195: -- Check If the value is a valid code from lookup table
1196: x_return_status := OKC_UTIL.check_lookup_code('OKS_RESOURCE_CLASS',
1197: p_ctcv_rec.resource_class);
1198:
1199: If (x_return_status = OKC_API.G_RET_STS_ERROR) Then
1200: --set error message in message stack
1201: OKC_API.SET_MESSAGE(
1202: p_app_name => G_APP_NAME,
1203: p_msg_name => G_INVALID_VALUE,
1197: p_ctcv_rec.resource_class);
1198:
1199: If (x_return_status = OKC_API.G_RET_STS_ERROR) Then
1200: --set error message in message stack
1201: OKC_API.SET_MESSAGE(
1202: p_app_name => G_APP_NAME,
1203: p_msg_name => G_INVALID_VALUE,
1204: p_token1 => G_COL_NAME_TOKEN,
1205: p_token1_value => 'RESOURCE_CLASS');
1204: p_token1 => G_COL_NAME_TOKEN,
1205: p_token1_value => 'RESOURCE_CLASS');
1206:
1207: RAISE G_EXCEPTION_HALT_VALIDATION;
1208: Elsif (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1209: raise G_EXCEPTION_HALT_VALIDATION;
1210: End If;
1211: End If;
1212: IF (l_debug = 'Y') THEN
1222: okc_debug.Reset_Indentation;
1223: END IF;
1224:
1225: -- store SQL error message on message stack
1226: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
1227: p_msg_name => g_unexpected_error,
1228: p_token1 => g_sqlcode_token,
1229: p_token2 => g_sqlerrm_token,
1230: p_token2_value => sqlerrm);
1229: p_token2 => g_sqlerrm_token,
1230: p_token2_value => sqlerrm);
1231:
1232: -- notify caller of an error as UNEXPETED error
1233: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1234:
1235: End validate_resource_class;
1236:
1237: /*+++++++++++++End of hand code +++++++++++++++++++*/
1240: --------------------------------------------
1241: FUNCTION Validate_Attributes (
1242: p_ctcv_rec IN ctcv_rec_type
1243: ) RETURN VARCHAR2 IS
1244: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1245:
1246: /*+++++++++++++Start of hand code +++++++++++++++++*/
1247: x_return_status varchar2(1) := OKC_API.G_RET_STS_SUCCESS;
1248: BEGIN
1243: ) RETURN VARCHAR2 IS
1244: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1245:
1246: /*+++++++++++++Start of hand code +++++++++++++++++*/
1247: x_return_status varchar2(1) := OKC_API.G_RET_STS_SUCCESS;
1248: BEGIN
1249:
1250: IF (l_debug = 'Y') THEN
1251: okc_debug.Set_Indentation('OKC_CTC_PVT');
1254:
1255: -- call each column-level validation
1256: validate_cpl_id(x_return_status => l_return_status,
1257: p_ctcv_rec => p_ctcv_rec);
1258: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1259: return OKC_API.G_RET_STS_UNEXP_ERROR;
1260: end if;
1261: if (l_return_status = OKC_API.G_RET_STS_ERROR
1262: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1255: -- call each column-level validation
1256: validate_cpl_id(x_return_status => l_return_status,
1257: p_ctcv_rec => p_ctcv_rec);
1258: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1259: return OKC_API.G_RET_STS_UNEXP_ERROR;
1260: end if;
1261: if (l_return_status = OKC_API.G_RET_STS_ERROR
1262: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1263: x_return_status := OKC_API.G_RET_STS_ERROR;
1257: p_ctcv_rec => p_ctcv_rec);
1258: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1259: return OKC_API.G_RET_STS_UNEXP_ERROR;
1260: end if;
1261: if (l_return_status = OKC_API.G_RET_STS_ERROR
1262: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1263: x_return_status := OKC_API.G_RET_STS_ERROR;
1264: end if;
1265: --
1258: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1259: return OKC_API.G_RET_STS_UNEXP_ERROR;
1260: end if;
1261: if (l_return_status = OKC_API.G_RET_STS_ERROR
1262: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1263: x_return_status := OKC_API.G_RET_STS_ERROR;
1264: end if;
1265: --
1266: validate_cro_code(x_return_status => l_return_status,
1259: return OKC_API.G_RET_STS_UNEXP_ERROR;
1260: end if;
1261: if (l_return_status = OKC_API.G_RET_STS_ERROR
1262: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1263: x_return_status := OKC_API.G_RET_STS_ERROR;
1264: end if;
1265: --
1266: validate_cro_code(x_return_status => l_return_status,
1267: p_ctcv_rec => p_ctcv_rec);
1264: end if;
1265: --
1266: validate_cro_code(x_return_status => l_return_status,
1267: p_ctcv_rec => p_ctcv_rec);
1268: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1269: return OKC_API.G_RET_STS_UNEXP_ERROR;
1270: end if;
1271: if (l_return_status = OKC_API.G_RET_STS_ERROR
1272: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1265: --
1266: validate_cro_code(x_return_status => l_return_status,
1267: p_ctcv_rec => p_ctcv_rec);
1268: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1269: return OKC_API.G_RET_STS_UNEXP_ERROR;
1270: end if;
1271: if (l_return_status = OKC_API.G_RET_STS_ERROR
1272: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1273: x_return_status := OKC_API.G_RET_STS_ERROR;
1267: p_ctcv_rec => p_ctcv_rec);
1268: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1269: return OKC_API.G_RET_STS_UNEXP_ERROR;
1270: end if;
1271: if (l_return_status = OKC_API.G_RET_STS_ERROR
1272: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1273: x_return_status := OKC_API.G_RET_STS_ERROR;
1274: end if;
1275: --
1268: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1269: return OKC_API.G_RET_STS_UNEXP_ERROR;
1270: end if;
1271: if (l_return_status = OKC_API.G_RET_STS_ERROR
1272: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1273: x_return_status := OKC_API.G_RET_STS_ERROR;
1274: end if;
1275: --
1276: validate_dnz_chr_id(x_return_status => l_return_status,
1269: return OKC_API.G_RET_STS_UNEXP_ERROR;
1270: end if;
1271: if (l_return_status = OKC_API.G_RET_STS_ERROR
1272: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1273: x_return_status := OKC_API.G_RET_STS_ERROR;
1274: end if;
1275: --
1276: validate_dnz_chr_id(x_return_status => l_return_status,
1277: p_ctcv_rec => p_ctcv_rec);
1274: end if;
1275: --
1276: validate_dnz_chr_id(x_return_status => l_return_status,
1277: p_ctcv_rec => p_ctcv_rec);
1278: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1279: return OKC_API.G_RET_STS_UNEXP_ERROR;
1280: end if;
1281: if (l_return_status = OKC_API.G_RET_STS_ERROR
1282: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1275: --
1276: validate_dnz_chr_id(x_return_status => l_return_status,
1277: p_ctcv_rec => p_ctcv_rec);
1278: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1279: return OKC_API.G_RET_STS_UNEXP_ERROR;
1280: end if;
1281: if (l_return_status = OKC_API.G_RET_STS_ERROR
1282: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1283: x_return_status := OKC_API.G_RET_STS_ERROR;
1277: p_ctcv_rec => p_ctcv_rec);
1278: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1279: return OKC_API.G_RET_STS_UNEXP_ERROR;
1280: end if;
1281: if (l_return_status = OKC_API.G_RET_STS_ERROR
1282: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1283: x_return_status := OKC_API.G_RET_STS_ERROR;
1284: end if;
1285: --
1278: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1279: return OKC_API.G_RET_STS_UNEXP_ERROR;
1280: end if;
1281: if (l_return_status = OKC_API.G_RET_STS_ERROR
1282: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1283: x_return_status := OKC_API.G_RET_STS_ERROR;
1284: end if;
1285: --
1286: validate_primary_yn(x_return_status => l_return_status,
1279: return OKC_API.G_RET_STS_UNEXP_ERROR;
1280: end if;
1281: if (l_return_status = OKC_API.G_RET_STS_ERROR
1282: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1283: x_return_status := OKC_API.G_RET_STS_ERROR;
1284: end if;
1285: --
1286: validate_primary_yn(x_return_status => l_return_status,
1287: p_ctcv_rec => p_ctcv_rec);
1284: end if;
1285: --
1286: validate_primary_yn(x_return_status => l_return_status,
1287: p_ctcv_rec => p_ctcv_rec);
1288: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1289: return OKC_API.G_RET_STS_UNEXP_ERROR;
1290: end If;
1291: If (l_return_status = OKC_API.G_RET_STS_ERROR
1292: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1285: --
1286: validate_primary_yn(x_return_status => l_return_status,
1287: p_ctcv_rec => p_ctcv_rec);
1288: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1289: return OKC_API.G_RET_STS_UNEXP_ERROR;
1290: end If;
1291: If (l_return_status = OKC_API.G_RET_STS_ERROR
1292: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1293: x_return_status := OKC_API.G_RET_STS_ERROR;
1287: p_ctcv_rec => p_ctcv_rec);
1288: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1289: return OKC_API.G_RET_STS_UNEXP_ERROR;
1290: end If;
1291: If (l_return_status = OKC_API.G_RET_STS_ERROR
1292: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1293: x_return_status := OKC_API.G_RET_STS_ERROR;
1294: end If;
1295: --
1288: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1289: return OKC_API.G_RET_STS_UNEXP_ERROR;
1290: end If;
1291: If (l_return_status = OKC_API.G_RET_STS_ERROR
1292: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1293: x_return_status := OKC_API.G_RET_STS_ERROR;
1294: end If;
1295: --
1296: validate_resource_class(x_return_status => l_return_status,
1289: return OKC_API.G_RET_STS_UNEXP_ERROR;
1290: end If;
1291: If (l_return_status = OKC_API.G_RET_STS_ERROR
1292: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1293: x_return_status := OKC_API.G_RET_STS_ERROR;
1294: end If;
1295: --
1296: validate_resource_class(x_return_status => l_return_status,
1297: p_ctcv_rec => p_ctcv_rec);
1294: end If;
1295: --
1296: validate_resource_class(x_return_status => l_return_status,
1297: p_ctcv_rec => p_ctcv_rec);
1298: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1299: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1300: END IF;
1301: IF (l_return_status = OKC_API.G_RET_STS_ERROR
1302: AND x_return_status = OKC_API.G_RET_STS_SUCCESS) THEN
1295: --
1296: validate_resource_class(x_return_status => l_return_status,
1297: p_ctcv_rec => p_ctcv_rec);
1298: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1299: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1300: END IF;
1301: IF (l_return_status = OKC_API.G_RET_STS_ERROR
1302: AND x_return_status = OKC_API.G_RET_STS_SUCCESS) THEN
1303: x_return_status := OKC_API.G_RET_STS_ERROR;
1297: p_ctcv_rec => p_ctcv_rec);
1298: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1299: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1300: END IF;
1301: IF (l_return_status = OKC_API.G_RET_STS_ERROR
1302: AND x_return_status = OKC_API.G_RET_STS_SUCCESS) THEN
1303: x_return_status := OKC_API.G_RET_STS_ERROR;
1304: END IF;
1305: --
1298: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1299: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1300: END IF;
1301: IF (l_return_status = OKC_API.G_RET_STS_ERROR
1302: AND x_return_status = OKC_API.G_RET_STS_SUCCESS) THEN
1303: x_return_status := OKC_API.G_RET_STS_ERROR;
1304: END IF;
1305: --
1306: return x_return_status;
1299: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1300: END IF;
1301: IF (l_return_status = OKC_API.G_RET_STS_ERROR
1302: AND x_return_status = OKC_API.G_RET_STS_SUCCESS) THEN
1303: x_return_status := OKC_API.G_RET_STS_ERROR;
1304: END IF;
1305: --
1306: return x_return_status;
1307:
1318: okc_debug.Reset_Indentation;
1319: END IF;
1320:
1321: -- store SQL error message on message stack for caller
1322: OKC_API.set_message(p_app_name => g_app_name,
1323: p_msg_name => g_unexpected_error,
1324: p_token1 => g_sqlcode_token,
1325: p_token1_value => sqlcode,
1326: p_token2 => g_sqlerrm_token,
1324: p_token1 => g_sqlcode_token,
1325: p_token1_value => sqlcode,
1326: p_token2 => g_sqlerrm_token,
1327: p_token2_value => sqlerrm);
1328: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1329: return x_return_status;
1330:
1331: END Validate_Attributes;
1332: /*+++++++++++++End of hand code +++++++++++++++++*/
1368: OR (p_ctcv_rec.END_DATE IS NULL AND (p_ctcv_rec.START_DATE <=END_DATE))
1369: OR (p_ctcv_rec.END_DATE IS NULL AND END_DATE IS NULL)));
1370:
1371:
1372: x_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1373: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1374: l_row_found BOOLEAN := FALSE;
1375: l_dummy VARCHAR2(1);
1376: -- indirection
1369: OR (p_ctcv_rec.END_DATE IS NULL AND END_DATE IS NULL)));
1370:
1371:
1372: x_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1373: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1374: l_row_found BOOLEAN := FALSE;
1375: l_dummy VARCHAR2(1);
1376: -- indirection
1377: l_rle_code varchar2(30);
1421:
1422: validate_JTOT_OBJECT1_CODE(x_return_status => l_return_status,
1423: p_ctcv_rec => p_ctcv_rec);
1424:
1425: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR)
1426: THEN
1427: IF (l_debug = 'Y') THEN
1428: okc_debug.log('4150: Exiting Validate_jtot_object1_code in validate_record:unexp err', 2);
1429: okc_debug.Reset_Indentation;
1427: IF (l_debug = 'Y') THEN
1428: okc_debug.log('4150: Exiting Validate_jtot_object1_code in validate_record:unexp err', 2);
1429: okc_debug.Reset_Indentation;
1430: END IF;
1431: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1432: END IF;
1433:
1434: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1435: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1430: END IF;
1431: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1432: END IF;
1433:
1434: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1435: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1436: THEN
1437: x_return_status := OKC_API.G_RET_STS_ERROR;
1438: END IF;
1431: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1432: END IF;
1433:
1434: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1435: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1436: THEN
1437: x_return_status := OKC_API.G_RET_STS_ERROR;
1438: END IF;
1439:
1433:
1434: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1435: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1436: THEN
1437: x_return_status := OKC_API.G_RET_STS_ERROR;
1438: END IF;
1439:
1440: -- -----------------------------------------------------
1441: validate_OBJECT1_ID1(x_return_status => l_return_status,
1440: -- -----------------------------------------------------
1441: validate_OBJECT1_ID1(x_return_status => l_return_status,
1442: p_ctcv_rec => p_ctcv_rec);
1443:
1444: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR)
1445: THEN
1446: IF (l_debug = 'Y') THEN
1447: okc_debug.log('4170: Exiting Validate_object1_id1 in validate_record:unexp err', 2);
1448: okc_debug.Reset_Indentation;
1446: IF (l_debug = 'Y') THEN
1447: okc_debug.log('4170: Exiting Validate_object1_id1 in validate_record:unexp err', 2);
1448: okc_debug.Reset_Indentation;
1449: END IF;
1450: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1451: END IF;
1452:
1453: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1454: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1449: END IF;
1450: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1451: END IF;
1452:
1453: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1454: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1455: THEN
1456: x_return_status := OKC_API.G_RET_STS_ERROR;
1457: END IF;
1450: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1451: END IF;
1452:
1453: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1454: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1455: THEN
1456: x_return_status := OKC_API.G_RET_STS_ERROR;
1457: END IF;
1458: End If; -- if user defined
1452:
1453: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1454: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1455: THEN
1456: x_return_status := OKC_API.G_RET_STS_ERROR;
1457: END IF;
1458: End If; -- if user defined
1459: -- ---------------------------------------------------------------------
1460: -- Bug 1636056 related changes - Shyam
1462: -- the explicit cursors above, for identical function to check
1463: -- uniqueness in OKC_CONTACTS table.
1464: -- ---------------------------------------------------------------------
1465: IF ( (p_ctcv_rec.CPL_ID IS NOT NULL)
1466: AND (p_ctcv_rec.CPL_ID <> OKC_API.G_MISS_NUM) )
1467: AND
1468: ( (p_ctcv_rec.CRO_CODE IS NOT NULL)
1469: AND (p_ctcv_rec.CRO_CODE <> OKC_API.G_MISS_CHAR) )
1470: THEN
1465: IF ( (p_ctcv_rec.CPL_ID IS NOT NULL)
1466: AND (p_ctcv_rec.CPL_ID <> OKC_API.G_MISS_NUM) )
1467: AND
1468: ( (p_ctcv_rec.CRO_CODE IS NOT NULL)
1469: AND (p_ctcv_rec.CRO_CODE <> OKC_API.G_MISS_CHAR) )
1470: THEN
1471: OPEN cur_ctcv;
1472: FETCH cur_ctcv INTO l_dummy;
1473: l_row_found := cur_ctcv%FOUND;
1475:
1476: IF (l_row_found)
1477: THEN
1478: -- Display the newly defined error message
1479: OKC_API.set_message(G_APP_NAME,
1480: 'OKC_DUP_CONTACT_PARTY_ID');
1481: x_return_status := OKC_API.G_RET_STS_ERROR;
1482: END IF;
1483: END IF;
1477: THEN
1478: -- Display the newly defined error message
1479: OKC_API.set_message(G_APP_NAME,
1480: 'OKC_DUP_CONTACT_PARTY_ID');
1481: x_return_status := OKC_API.G_RET_STS_ERROR;
1482: END IF;
1483: END IF;
1484:
1485: -- ---------------------------------------------------------------------
1488: -- ---------------------------------------------------------------------
1489:
1490: IF p_ctcv_rec.START_DATE IS NOT NULL AND p_ctcv_rec.END_DATE IS NOT NULL THEN
1491: IF p_ctcv_rec.END_DATE < p_ctcv_rec.START_DATE THEN
1492: OKC_API.set_message(G_APP_NAME,'OKC_INVALID_END_DATE');
1493: x_return_status := OKC_API.G_RET_STS_ERROR;
1494: END IF;
1495: END IF;
1496: RETURN x_return_status;
1489:
1490: IF p_ctcv_rec.START_DATE IS NOT NULL AND p_ctcv_rec.END_DATE IS NOT NULL THEN
1491: IF p_ctcv_rec.END_DATE < p_ctcv_rec.START_DATE THEN
1492: OKC_API.set_message(G_APP_NAME,'OKC_INVALID_END_DATE');
1493: x_return_status := OKC_API.G_RET_STS_ERROR;
1494: END IF;
1495: END IF;
1496: RETURN x_return_status;
1497:
1508: okc_debug.Reset_Indentation;
1509: END IF;
1510:
1511: -- store SQL error message on message stack for caller
1512: OKC_API.set_message(p_app_name => g_app_name,
1513: p_msg_name => g_unexpected_error,
1514: p_token1 => g_sqlcode_token,
1515: p_token1_value => sqlcode,
1516: p_token2 => g_sqlerrm_token,
1515: p_token1_value => sqlcode,
1516: p_token2 => g_sqlerrm_token,
1517: p_token2_value => sqlerrm);
1518:
1519: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1520:
1521: RETURN x_return_status;
1522:
1523: END Validate_Record;
1630: p_ctcv_rec IN ctcv_rec_type) IS
1631:
1632: l_api_version CONSTANT NUMBER := 1;
1633: l_api_name CONSTANT VARCHAR2(30) := 'V_validate_row';
1634: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1635: l_ctcv_rec ctcv_rec_type := p_ctcv_rec;
1636: l_ctc_rec ctc_rec_type;
1637: BEGIN
1638:
1640: okc_debug.Set_Indentation('OKC_CTC_PVT');
1641: okc_debug.log('4600: Entered validate_row', 2);
1642: END IF;
1643:
1644: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
1645: G_PKG_NAME,
1646: p_init_msg_list,
1647: l_api_version,
1648: p_api_version,
1647: l_api_version,
1648: p_api_version,
1649: '_PVT',
1650: x_return_status);
1651: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1652: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1653: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1654: RAISE OKC_API.G_EXCEPTION_ERROR;
1655: END IF;
1648: p_api_version,
1649: '_PVT',
1650: x_return_status);
1651: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1652: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1653: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1654: RAISE OKC_API.G_EXCEPTION_ERROR;
1655: END IF;
1656: --- Validate all non-missing attributes (Item Level Validation)
1649: '_PVT',
1650: x_return_status);
1651: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1652: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1653: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1654: RAISE OKC_API.G_EXCEPTION_ERROR;
1655: END IF;
1656: --- Validate all non-missing attributes (Item Level Validation)
1657: l_return_status := Validate_Attributes(l_ctcv_rec);
1650: x_return_status);
1651: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1652: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1653: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1654: RAISE OKC_API.G_EXCEPTION_ERROR;
1655: END IF;
1656: --- Validate all non-missing attributes (Item Level Validation)
1657: l_return_status := Validate_Attributes(l_ctcv_rec);
1658: --- If any errors happen abort API
1655: END IF;
1656: --- Validate all non-missing attributes (Item Level Validation)
1657: l_return_status := Validate_Attributes(l_ctcv_rec);
1658: --- If any errors happen abort API
1659: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1660: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1661: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1662: RAISE OKC_API.G_EXCEPTION_ERROR;
1663: END IF;
1656: --- Validate all non-missing attributes (Item Level Validation)
1657: l_return_status := Validate_Attributes(l_ctcv_rec);
1658: --- If any errors happen abort API
1659: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1660: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1661: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1662: RAISE OKC_API.G_EXCEPTION_ERROR;
1663: END IF;
1664: l_return_status := Validate_Record(l_ctcv_rec);
1657: l_return_status := Validate_Attributes(l_ctcv_rec);
1658: --- If any errors happen abort API
1659: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1660: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1661: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1662: RAISE OKC_API.G_EXCEPTION_ERROR;
1663: END IF;
1664: l_return_status := Validate_Record(l_ctcv_rec);
1665: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1658: --- If any errors happen abort API
1659: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1660: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1661: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1662: RAISE OKC_API.G_EXCEPTION_ERROR;
1663: END IF;
1664: l_return_status := Validate_Record(l_ctcv_rec);
1665: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1666: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1661: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1662: RAISE OKC_API.G_EXCEPTION_ERROR;
1663: END IF;
1664: l_return_status := Validate_Record(l_ctcv_rec);
1665: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1666: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1667: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1668: RAISE OKC_API.G_EXCEPTION_ERROR;
1669: END IF;
1662: RAISE OKC_API.G_EXCEPTION_ERROR;
1663: END IF;
1664: l_return_status := Validate_Record(l_ctcv_rec);
1665: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1666: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1667: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1668: RAISE OKC_API.G_EXCEPTION_ERROR;
1669: END IF;
1670: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1663: END IF;
1664: l_return_status := Validate_Record(l_ctcv_rec);
1665: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1666: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1667: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1668: RAISE OKC_API.G_EXCEPTION_ERROR;
1669: END IF;
1670: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1671:
1664: l_return_status := Validate_Record(l_ctcv_rec);
1665: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1666: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1667: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1668: RAISE OKC_API.G_EXCEPTION_ERROR;
1669: END IF;
1670: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1671:
1672: IF (l_debug = 'Y') THEN
1666: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1667: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1668: RAISE OKC_API.G_EXCEPTION_ERROR;
1669: END IF;
1670: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1671:
1672: IF (l_debug = 'Y') THEN
1673: okc_debug.log('4700: Leaving validate_row', 2);
1674: okc_debug.Reset_Indentation;
1674: okc_debug.Reset_Indentation;
1675: END IF;
1676:
1677: EXCEPTION
1678: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1679:
1680: IF (l_debug = 'Y') THEN
1681: okc_debug.log('4800: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1682: okc_debug.Reset_Indentation;
1677: EXCEPTION
1678: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1679:
1680: IF (l_debug = 'Y') THEN
1681: okc_debug.log('4800: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1682: okc_debug.Reset_Indentation;
1683: END IF;
1684:
1685: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1681: okc_debug.log('4800: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1682: okc_debug.Reset_Indentation;
1683: END IF;
1684:
1685: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1686: (
1687: l_api_name,
1688: G_PKG_NAME,
1689: 'OKC_API.G_RET_STS_ERROR',
1685: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1686: (
1687: l_api_name,
1688: G_PKG_NAME,
1689: 'OKC_API.G_RET_STS_ERROR',
1690: x_msg_count,
1691: x_msg_data,
1692: '_PVT'
1693: );
1690: x_msg_count,
1691: x_msg_data,
1692: '_PVT'
1693: );
1694: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1695:
1696: IF (l_debug = 'Y') THEN
1697: okc_debug.log('4900: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1698: okc_debug.Reset_Indentation;
1693: );
1694: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1695:
1696: IF (l_debug = 'Y') THEN
1697: okc_debug.log('4900: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1698: okc_debug.Reset_Indentation;
1699: END IF;
1700:
1701: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1697: okc_debug.log('4900: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1698: okc_debug.Reset_Indentation;
1699: END IF;
1700:
1701: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1702: (
1703: l_api_name,
1704: G_PKG_NAME,
1705: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1701: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1702: (
1703: l_api_name,
1704: G_PKG_NAME,
1705: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1706: x_msg_count,
1707: x_msg_data,
1708: '_PVT'
1709: );
1713: okc_debug.log('5000: Exiting validate_row:OTHERS Exception', 2);
1714: okc_debug.Reset_Indentation;
1715: END IF;
1716:
1717: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1718: (
1719: l_api_name,
1720: G_PKG_NAME,
1721: 'OTHERS',
1737: p_ctcv_tbl IN ctcv_tbl_type) IS
1738:
1739: l_api_version CONSTANT NUMBER := 1;
1740: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_validate_row';
1741: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1742: i NUMBER := 0;
1743: BEGIN
1744:
1745: IF (l_debug = 'Y') THEN
1746: okc_debug.Set_Indentation('OKC_CTC_PVT');
1747: okc_debug.log('5100: Entered validate_row', 2);
1748: END IF;
1749:
1750: OKC_API.init_msg_list(p_init_msg_list);
1751: -- Make sure PL/SQL table has records in it before passing
1752: IF (p_ctcv_tbl.COUNT > 0) THEN
1753: i := p_ctcv_tbl.FIRST;
1754: LOOP
1753: i := p_ctcv_tbl.FIRST;
1754: LOOP
1755: validate_row (
1756: p_api_version => p_api_version,
1757: p_init_msg_list => OKC_API.G_FALSE,
1758: x_return_status => x_return_status,
1759: x_msg_count => x_msg_count,
1760: x_msg_data => x_msg_data,
1761: p_ctcv_rec => p_ctcv_tbl(i));
1769: okc_debug.Reset_Indentation;
1770: END IF;
1771:
1772: EXCEPTION
1773: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1774:
1775: IF (l_debug = 'Y') THEN
1776: okc_debug.log('5300: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1777: okc_debug.Reset_Indentation;
1772: EXCEPTION
1773: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1774:
1775: IF (l_debug = 'Y') THEN
1776: okc_debug.log('5300: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1777: okc_debug.Reset_Indentation;
1778: END IF;
1779:
1780: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1776: okc_debug.log('5300: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1777: okc_debug.Reset_Indentation;
1778: END IF;
1779:
1780: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1781: (
1782: l_api_name,
1783: G_PKG_NAME,
1784: 'OKC_API.G_RET_STS_ERROR',
1780: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1781: (
1782: l_api_name,
1783: G_PKG_NAME,
1784: 'OKC_API.G_RET_STS_ERROR',
1785: x_msg_count,
1786: x_msg_data,
1787: '_PVT'
1788: );
1785: x_msg_count,
1786: x_msg_data,
1787: '_PVT'
1788: );
1789: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1790:
1791: IF (l_debug = 'Y') THEN
1792: okc_debug.log('5400: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1793: okc_debug.Reset_Indentation;
1788: );
1789: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1790:
1791: IF (l_debug = 'Y') THEN
1792: okc_debug.log('5400: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1793: okc_debug.Reset_Indentation;
1794: END IF;
1795:
1796: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1792: okc_debug.log('5400: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1793: okc_debug.Reset_Indentation;
1794: END IF;
1795:
1796: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1797: (
1798: l_api_name,
1799: G_PKG_NAME,
1800: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1796: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1797: (
1798: l_api_name,
1799: G_PKG_NAME,
1800: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1801: x_msg_count,
1802: x_msg_data,
1803: '_PVT'
1804: );
1808: okc_debug.log('5500: Exiting validate_row:OTHERS Exception', 2);
1809: okc_debug.Reset_Indentation;
1810: END IF;
1811:
1812: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1813: (
1814: l_api_name,
1815: G_PKG_NAME,
1816: 'OTHERS',
1836: x_ctc_rec OUT NOCOPY ctc_rec_type) IS
1837:
1838: l_api_version CONSTANT NUMBER := 1;
1839: l_api_name CONSTANT VARCHAR2(30) := 'CONTACTS_insert_row';
1840: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1841: l_ctc_rec ctc_rec_type := p_ctc_rec;
1842: l_def_ctc_rec ctc_rec_type;
1843: -------------------------------------
1844: -- Set_Attributes for:OKC_CONTACTS --
1846: FUNCTION Set_Attributes (
1847: p_ctc_rec IN ctc_rec_type,
1848: x_ctc_rec OUT NOCOPY ctc_rec_type
1849: ) RETURN VARCHAR2 IS
1850: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1851: BEGIN
1852:
1853: x_ctc_rec := p_ctc_rec;
1854: x_ctc_rec.primary_yn := UPPER(x_ctc_rec.PRIMARY_YN);
1862: okc_debug.Set_Indentation('OKC_CTC_PVT');
1863: okc_debug.log('5700: Entered insert_row', 2);
1864: END IF;
1865:
1866: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
1867: p_init_msg_list,
1868: '_PVT',
1869: x_return_status);
1870: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1866: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
1867: p_init_msg_list,
1868: '_PVT',
1869: x_return_status);
1870: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1871: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1872: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1873: RAISE OKC_API.G_EXCEPTION_ERROR;
1874: END IF;
1867: p_init_msg_list,
1868: '_PVT',
1869: x_return_status);
1870: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1871: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1872: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1873: RAISE OKC_API.G_EXCEPTION_ERROR;
1874: END IF;
1875: --- Setting item attributes
1868: '_PVT',
1869: x_return_status);
1870: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1871: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1872: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1873: RAISE OKC_API.G_EXCEPTION_ERROR;
1874: END IF;
1875: --- Setting item attributes
1876: l_return_status := Set_Attributes(
1869: x_return_status);
1870: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1871: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1872: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1873: RAISE OKC_API.G_EXCEPTION_ERROR;
1874: END IF;
1875: --- Setting item attributes
1876: l_return_status := Set_Attributes(
1877: p_ctc_rec, -- IN
1876: l_return_status := Set_Attributes(
1877: p_ctc_rec, -- IN
1878: l_ctc_rec); -- OUT
1879: --- If any errors happen abort API
1880: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1881: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1882: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1883: RAISE OKC_API.G_EXCEPTION_ERROR;
1884: END IF;
1877: p_ctc_rec, -- IN
1878: l_ctc_rec); -- OUT
1879: --- If any errors happen abort API
1880: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1881: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1882: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1883: RAISE OKC_API.G_EXCEPTION_ERROR;
1884: END IF;
1885: INSERT INTO OKC_CONTACTS(
1878: l_ctc_rec); -- OUT
1879: --- If any errors happen abort API
1880: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1881: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1882: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1883: RAISE OKC_API.G_EXCEPTION_ERROR;
1884: END IF;
1885: INSERT INTO OKC_CONTACTS(
1886: id,
1879: --- If any errors happen abort API
1880: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1881: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1882: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1883: RAISE OKC_API.G_EXCEPTION_ERROR;
1884: END IF;
1885: INSERT INTO OKC_CONTACTS(
1886: id,
1887: cpl_id,
1955: l_ctc_rec.start_date,
1956: l_ctc_rec.end_date);
1957: -- Set OUT values
1958: x_ctc_rec := l_ctc_rec;
1959: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1960:
1961: IF (l_debug = 'Y') THEN
1962: okc_debug.log('5800: Leaving insert_row', 2);
1963: okc_debug.Reset_Indentation;
1963: okc_debug.Reset_Indentation;
1964: END IF;
1965:
1966: EXCEPTION
1967: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1968:
1969: IF (l_debug = 'Y') THEN
1970: okc_debug.log('5900: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1971: okc_debug.Reset_Indentation;
1966: EXCEPTION
1967: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1968:
1969: IF (l_debug = 'Y') THEN
1970: okc_debug.log('5900: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1971: okc_debug.Reset_Indentation;
1972: END IF;
1973:
1974: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1970: okc_debug.log('5900: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1971: okc_debug.Reset_Indentation;
1972: END IF;
1973:
1974: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1975: (
1976: l_api_name,
1977: G_PKG_NAME,
1978: 'OKC_API.G_RET_STS_ERROR',
1974: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1975: (
1976: l_api_name,
1977: G_PKG_NAME,
1978: 'OKC_API.G_RET_STS_ERROR',
1979: x_msg_count,
1980: x_msg_data,
1981: '_PVT'
1982: );
1979: x_msg_count,
1980: x_msg_data,
1981: '_PVT'
1982: );
1983: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1984:
1985: IF (l_debug = 'Y') THEN
1986: okc_debug.log('6000: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1987: okc_debug.Reset_Indentation;
1982: );
1983: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1984:
1985: IF (l_debug = 'Y') THEN
1986: okc_debug.log('6000: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1987: okc_debug.Reset_Indentation;
1988: END IF;
1989:
1990: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1986: okc_debug.log('6000: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1987: okc_debug.Reset_Indentation;
1988: END IF;
1989:
1990: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1991: (
1992: l_api_name,
1993: G_PKG_NAME,
1994: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1990: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1991: (
1992: l_api_name,
1993: G_PKG_NAME,
1994: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1995: x_msg_count,
1996: x_msg_data,
1997: '_PVT'
1998: );
2002: okc_debug.log('6100: Exiting insert_row:OTHERS Exception', 2);
2003: okc_debug.Reset_Indentation;
2004: END IF;
2005:
2006: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2007: (
2008: l_api_name,
2009: G_PKG_NAME,
2010: 'OTHERS',
2027: x_ctcv_rec OUT NOCOPY ctcv_rec_type) IS
2028:
2029: l_api_version CONSTANT NUMBER := 1;
2030: l_api_name CONSTANT VARCHAR2(30) := 'V_insert_row';
2031: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2032: l_ctcv_rec ctcv_rec_type;
2033: l_def_ctcv_rec ctcv_rec_type;
2034: l_ctc_rec ctc_rec_type;
2035: lx_ctc_rec ctc_rec_type;
2057: FUNCTION Set_Attributes (
2058: p_ctcv_rec IN ctcv_rec_type,
2059: x_ctcv_rec OUT NOCOPY ctcv_rec_type
2060: ) RETURN VARCHAR2 IS
2061: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2062: BEGIN
2063:
2064: x_ctcv_rec := p_ctcv_rec;
2065: x_ctcv_rec.OBJECT_VERSION_NUMBER := 1;
2073: okc_debug.Set_Indentation('OKC_CTC_PVT');
2074: okc_debug.log('6400: Entered insert_row', 2);
2075: END IF;
2076:
2077: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2078: G_PKG_NAME,
2079: p_init_msg_list,
2080: l_api_version,
2081: p_api_version,
2080: l_api_version,
2081: p_api_version,
2082: '_PVT',
2083: x_return_status);
2084: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2085: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2086: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2087: RAISE OKC_API.G_EXCEPTION_ERROR;
2088: END IF;
2081: p_api_version,
2082: '_PVT',
2083: x_return_status);
2084: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2085: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2086: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2087: RAISE OKC_API.G_EXCEPTION_ERROR;
2088: END IF;
2089: l_ctcv_rec := null_out_defaults(p_ctcv_rec);
2082: '_PVT',
2083: x_return_status);
2084: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2085: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2086: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2087: RAISE OKC_API.G_EXCEPTION_ERROR;
2088: END IF;
2089: l_ctcv_rec := null_out_defaults(p_ctcv_rec);
2090: -- Set primary key value
2083: x_return_status);
2084: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2085: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2086: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2087: RAISE OKC_API.G_EXCEPTION_ERROR;
2088: END IF;
2089: l_ctcv_rec := null_out_defaults(p_ctcv_rec);
2090: -- Set primary key value
2091: l_ctcv_rec.ID := get_seq_id;
2093: l_return_status := Set_Attributes(
2094: l_ctcv_rec, -- IN
2095: l_def_ctcv_rec); -- OUT
2096: --- If any errors happen abort API
2097: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2098: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2099: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2100: RAISE OKC_API.G_EXCEPTION_ERROR;
2101: END IF;
2094: l_ctcv_rec, -- IN
2095: l_def_ctcv_rec); -- OUT
2096: --- If any errors happen abort API
2097: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2098: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2099: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2100: RAISE OKC_API.G_EXCEPTION_ERROR;
2101: END IF;
2102: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
2095: l_def_ctcv_rec); -- OUT
2096: --- If any errors happen abort API
2097: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2098: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2099: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2100: RAISE OKC_API.G_EXCEPTION_ERROR;
2101: END IF;
2102: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
2103: --- Validate all non-missing attributes (Item Level Validation)
2096: --- If any errors happen abort API
2097: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2098: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2099: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2100: RAISE OKC_API.G_EXCEPTION_ERROR;
2101: END IF;
2102: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
2103: --- Validate all non-missing attributes (Item Level Validation)
2104: l_return_status := Validate_Attributes(l_def_ctcv_rec);
2102: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
2103: --- Validate all non-missing attributes (Item Level Validation)
2104: l_return_status := Validate_Attributes(l_def_ctcv_rec);
2105: --- If any errors happen abort API
2106: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2107: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2108: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2109: RAISE OKC_API.G_EXCEPTION_ERROR;
2110: END IF;
2103: --- Validate all non-missing attributes (Item Level Validation)
2104: l_return_status := Validate_Attributes(l_def_ctcv_rec);
2105: --- If any errors happen abort API
2106: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2107: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2108: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2109: RAISE OKC_API.G_EXCEPTION_ERROR;
2110: END IF;
2111: l_return_status := Validate_Record(l_def_ctcv_rec);
2104: l_return_status := Validate_Attributes(l_def_ctcv_rec);
2105: --- If any errors happen abort API
2106: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2107: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2108: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2109: RAISE OKC_API.G_EXCEPTION_ERROR;
2110: END IF;
2111: l_return_status := Validate_Record(l_def_ctcv_rec);
2112: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2105: --- If any errors happen abort API
2106: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2107: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2108: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2109: RAISE OKC_API.G_EXCEPTION_ERROR;
2110: END IF;
2111: l_return_status := Validate_Record(l_def_ctcv_rec);
2112: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2113: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2108: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2109: RAISE OKC_API.G_EXCEPTION_ERROR;
2110: END IF;
2111: l_return_status := Validate_Record(l_def_ctcv_rec);
2112: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2113: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2114: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2115: RAISE OKC_API.G_EXCEPTION_ERROR;
2116: END IF;
2109: RAISE OKC_API.G_EXCEPTION_ERROR;
2110: END IF;
2111: l_return_status := Validate_Record(l_def_ctcv_rec);
2112: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2113: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2114: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2115: RAISE OKC_API.G_EXCEPTION_ERROR;
2116: END IF;
2117: --------------------------------------
2110: END IF;
2111: l_return_status := Validate_Record(l_def_ctcv_rec);
2112: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2113: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2114: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2115: RAISE OKC_API.G_EXCEPTION_ERROR;
2116: END IF;
2117: --------------------------------------
2118: -- Move VIEW record to "Child" records
2111: l_return_status := Validate_Record(l_def_ctcv_rec);
2112: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2113: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2114: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2115: RAISE OKC_API.G_EXCEPTION_ERROR;
2116: END IF;
2117: --------------------------------------
2118: -- Move VIEW record to "Child" records
2119: --------------------------------------
2128: x_msg_data,
2129: l_ctc_rec,
2130: lx_ctc_rec
2131: );
2132: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2133: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2134: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2135: RAISE OKC_API.G_EXCEPTION_ERROR;
2136: END IF;
2129: l_ctc_rec,
2130: lx_ctc_rec
2131: );
2132: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2133: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2134: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2135: RAISE OKC_API.G_EXCEPTION_ERROR;
2136: END IF;
2137: migrate(lx_ctc_rec, l_def_ctcv_rec);
2130: lx_ctc_rec
2131: );
2132: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2133: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2134: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2135: RAISE OKC_API.G_EXCEPTION_ERROR;
2136: END IF;
2137: migrate(lx_ctc_rec, l_def_ctcv_rec);
2138: -- Set OUT values
2131: );
2132: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2133: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2134: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2135: RAISE OKC_API.G_EXCEPTION_ERROR;
2136: END IF;
2137: migrate(lx_ctc_rec, l_def_ctcv_rec);
2138: -- Set OUT values
2139: x_ctcv_rec := l_def_ctcv_rec;
2136: END IF;
2137: migrate(lx_ctc_rec, l_def_ctcv_rec);
2138: -- Set OUT values
2139: x_ctcv_rec := l_def_ctcv_rec;
2140: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2141:
2142: IF (l_debug = 'Y') THEN
2143: okc_debug.log('6500: Leaving insert_row', 2);
2144: okc_debug.Reset_Indentation;
2144: okc_debug.Reset_Indentation;
2145: END IF;
2146:
2147: EXCEPTION
2148: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2149:
2150: IF (l_debug = 'Y') THEN
2151: okc_debug.log('6600: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2152: okc_debug.Reset_Indentation;
2147: EXCEPTION
2148: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2149:
2150: IF (l_debug = 'Y') THEN
2151: okc_debug.log('6600: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2152: okc_debug.Reset_Indentation;
2153: END IF;
2154:
2155: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2151: okc_debug.log('6600: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2152: okc_debug.Reset_Indentation;
2153: END IF;
2154:
2155: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2156: (
2157: l_api_name,
2158: G_PKG_NAME,
2159: 'OKC_API.G_RET_STS_ERROR',
2155: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2156: (
2157: l_api_name,
2158: G_PKG_NAME,
2159: 'OKC_API.G_RET_STS_ERROR',
2160: x_msg_count,
2161: x_msg_data,
2162: '_PVT'
2163: );
2160: x_msg_count,
2161: x_msg_data,
2162: '_PVT'
2163: );
2164: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2165:
2166: IF (l_debug = 'Y') THEN
2167: okc_debug.log('6700: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2168: okc_debug.Reset_Indentation;
2163: );
2164: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2165:
2166: IF (l_debug = 'Y') THEN
2167: okc_debug.log('6700: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2168: okc_debug.Reset_Indentation;
2169: END IF;
2170:
2171: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2167: okc_debug.log('6700: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2168: okc_debug.Reset_Indentation;
2169: END IF;
2170:
2171: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2172: (
2173: l_api_name,
2174: G_PKG_NAME,
2175: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2171: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2172: (
2173: l_api_name,
2174: G_PKG_NAME,
2175: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2176: x_msg_count,
2177: x_msg_data,
2178: '_PVT'
2179: );
2183: okc_debug.log('6800: Exiting insert_row:OTHERS Exception', 2);
2184: okc_debug.Reset_Indentation;
2185: END IF;
2186:
2187: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2188: (
2189: l_api_name,
2190: G_PKG_NAME,
2191: 'OTHERS',
2208: x_ctcv_tbl OUT NOCOPY ctcv_tbl_type) IS
2209:
2210: l_api_version CONSTANT NUMBER := 1;
2211: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_insert_row';
2212: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2213: i NUMBER := 0;
2214: BEGIN
2215:
2216: IF (l_debug = 'Y') THEN
2217: okc_debug.Set_Indentation('OKC_CTC_PVT');
2218: okc_debug.log('6900: Entered insert_row', 2);
2219: END IF;
2220:
2221: OKC_API.init_msg_list(p_init_msg_list);
2222: -- Make sure PL/SQL table has records in it before passing
2223: IF (p_ctcv_tbl.COUNT > 0) THEN
2224: i := p_ctcv_tbl.FIRST;
2225: LOOP
2224: i := p_ctcv_tbl.FIRST;
2225: LOOP
2226: insert_row (
2227: p_api_version => p_api_version,
2228: p_init_msg_list => OKC_API.G_FALSE,
2229: x_return_status => x_return_status,
2230: x_msg_count => x_msg_count,
2231: x_msg_data => x_msg_data,
2232: p_ctcv_rec => p_ctcv_tbl(i),
2241: okc_debug.Reset_Indentation;
2242: END IF;
2243:
2244: EXCEPTION
2245: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2246:
2247: IF (l_debug = 'Y') THEN
2248: okc_debug.log('7100: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2249: okc_debug.Reset_Indentation;
2244: EXCEPTION
2245: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2246:
2247: IF (l_debug = 'Y') THEN
2248: okc_debug.log('7100: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2249: okc_debug.Reset_Indentation;
2250: END IF;
2251:
2252: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2248: okc_debug.log('7100: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2249: okc_debug.Reset_Indentation;
2250: END IF;
2251:
2252: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2253: (
2254: l_api_name,
2255: G_PKG_NAME,
2256: 'OKC_API.G_RET_STS_ERROR',
2252: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2253: (
2254: l_api_name,
2255: G_PKG_NAME,
2256: 'OKC_API.G_RET_STS_ERROR',
2257: x_msg_count,
2258: x_msg_data,
2259: '_PVT'
2260: );
2257: x_msg_count,
2258: x_msg_data,
2259: '_PVT'
2260: );
2261: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2262:
2263: IF (l_debug = 'Y') THEN
2264: okc_debug.log('7200: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2265: okc_debug.Reset_Indentation;
2260: );
2261: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2262:
2263: IF (l_debug = 'Y') THEN
2264: okc_debug.log('7200: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2265: okc_debug.Reset_Indentation;
2266: END IF;
2267:
2268: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2264: okc_debug.log('7200: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2265: okc_debug.Reset_Indentation;
2266: END IF;
2267:
2268: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2269: (
2270: l_api_name,
2271: G_PKG_NAME,
2272: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2268: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2269: (
2270: l_api_name,
2271: G_PKG_NAME,
2272: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2273: x_msg_count,
2274: x_msg_data,
2275: '_PVT'
2276: );
2280: okc_debug.log('7300: Exiting insert_row:OTHERS Exception', 2);
2281: okc_debug.Reset_Indentation;
2282: END IF;
2283:
2284: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2285: (
2286: l_api_name,
2287: G_PKG_NAME,
2288: 'OTHERS',
2320: FROM OKC_CONTACTS
2321: WHERE ID = p_ctc_rec.id;
2322: l_api_version CONSTANT NUMBER := 1;
2323: l_api_name CONSTANT VARCHAR2(30) := 'CONTACTS_lock_row';
2324: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2325: l_object_version_number OKC_CONTACTS.OBJECT_VERSION_NUMBER%TYPE;
2326: lc_object_version_number OKC_CONTACTS.OBJECT_VERSION_NUMBER%TYPE;
2327: l_row_notfound BOOLEAN := FALSE;
2328: lc_row_notfound BOOLEAN := FALSE;
2332: okc_debug.Set_Indentation('OKC_CTC_PVT');
2333: okc_debug.log('7400: Entered lock_row', 2);
2334: END IF;
2335:
2336: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2337: p_init_msg_list,
2338: '_PVT',
2339: x_return_status);
2340: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2336: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2337: p_init_msg_list,
2338: '_PVT',
2339: x_return_status);
2340: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2341: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2342: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2343: RAISE OKC_API.G_EXCEPTION_ERROR;
2344: END IF;
2337: p_init_msg_list,
2338: '_PVT',
2339: x_return_status);
2340: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2341: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2342: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2343: RAISE OKC_API.G_EXCEPTION_ERROR;
2344: END IF;
2345: BEGIN
2338: '_PVT',
2339: x_return_status);
2340: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2341: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2342: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2343: RAISE OKC_API.G_EXCEPTION_ERROR;
2344: END IF;
2345: BEGIN
2346:
2339: x_return_status);
2340: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2341: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2342: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2343: RAISE OKC_API.G_EXCEPTION_ERROR;
2344: END IF;
2345: BEGIN
2346:
2347: IF (l_debug = 'Y') THEN
2369:
2370: IF (lock_csr%ISOPEN) THEN
2371: CLOSE lock_csr;
2372: END IF;
2373: OKC_API.set_message(G_FND_APP,G_FORM_UNABLE_TO_RESERVE_REC);
2374: RAISE APP_EXCEPTIONS.RECORD_LOCK_EXCEPTION;
2375: END;
2376:
2377: IF ( l_row_notfound ) THEN
2380: lc_row_notfound := lchk_csr%NOTFOUND;
2381: CLOSE lchk_csr;
2382: END IF;
2383: IF (lc_row_notfound) THEN
2384: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
2385: RAISE OKC_API.G_EXCEPTION_ERROR;
2386: ELSIF lc_object_version_number > p_ctc_rec.object_version_number THEN
2387: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2388: RAISE OKC_API.G_EXCEPTION_ERROR;
2381: CLOSE lchk_csr;
2382: END IF;
2383: IF (lc_row_notfound) THEN
2384: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
2385: RAISE OKC_API.G_EXCEPTION_ERROR;
2386: ELSIF lc_object_version_number > p_ctc_rec.object_version_number THEN
2387: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2388: RAISE OKC_API.G_EXCEPTION_ERROR;
2389: ELSIF lc_object_version_number <> p_ctc_rec.object_version_number THEN
2383: IF (lc_row_notfound) THEN
2384: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
2385: RAISE OKC_API.G_EXCEPTION_ERROR;
2386: ELSIF lc_object_version_number > p_ctc_rec.object_version_number THEN
2387: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2388: RAISE OKC_API.G_EXCEPTION_ERROR;
2389: ELSIF lc_object_version_number <> p_ctc_rec.object_version_number THEN
2390: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2391: RAISE OKC_API.G_EXCEPTION_ERROR;
2384: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
2385: RAISE OKC_API.G_EXCEPTION_ERROR;
2386: ELSIF lc_object_version_number > p_ctc_rec.object_version_number THEN
2387: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2388: RAISE OKC_API.G_EXCEPTION_ERROR;
2389: ELSIF lc_object_version_number <> p_ctc_rec.object_version_number THEN
2390: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2391: RAISE OKC_API.G_EXCEPTION_ERROR;
2392: ELSIF lc_object_version_number = -1 THEN
2386: ELSIF lc_object_version_number > p_ctc_rec.object_version_number THEN
2387: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2388: RAISE OKC_API.G_EXCEPTION_ERROR;
2389: ELSIF lc_object_version_number <> p_ctc_rec.object_version_number THEN
2390: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2391: RAISE OKC_API.G_EXCEPTION_ERROR;
2392: ELSIF lc_object_version_number = -1 THEN
2393: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
2394: RAISE OKC_API.G_EXCEPTION_ERROR;
2387: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2388: RAISE OKC_API.G_EXCEPTION_ERROR;
2389: ELSIF lc_object_version_number <> p_ctc_rec.object_version_number THEN
2390: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2391: RAISE OKC_API.G_EXCEPTION_ERROR;
2392: ELSIF lc_object_version_number = -1 THEN
2393: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
2394: RAISE OKC_API.G_EXCEPTION_ERROR;
2395: END IF;
2389: ELSIF lc_object_version_number <> p_ctc_rec.object_version_number THEN
2390: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2391: RAISE OKC_API.G_EXCEPTION_ERROR;
2392: ELSIF lc_object_version_number = -1 THEN
2393: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
2394: RAISE OKC_API.G_EXCEPTION_ERROR;
2395: END IF;
2396: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2397:
2390: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2391: RAISE OKC_API.G_EXCEPTION_ERROR;
2392: ELSIF lc_object_version_number = -1 THEN
2393: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
2394: RAISE OKC_API.G_EXCEPTION_ERROR;
2395: END IF;
2396: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2397:
2398: IF (l_debug = 'Y') THEN
2392: ELSIF lc_object_version_number = -1 THEN
2393: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
2394: RAISE OKC_API.G_EXCEPTION_ERROR;
2395: END IF;
2396: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2397:
2398: IF (l_debug = 'Y') THEN
2399: okc_debug.log('7800: Leaving lock_row', 2);
2400: okc_debug.Reset_Indentation;
2400: okc_debug.Reset_Indentation;
2401: END IF;
2402:
2403: EXCEPTION
2404: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2405:
2406: IF (l_debug = 'Y') THEN
2407: okc_debug.log('7900: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2408: okc_debug.Reset_Indentation;
2403: EXCEPTION
2404: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2405:
2406: IF (l_debug = 'Y') THEN
2407: okc_debug.log('7900: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2408: okc_debug.Reset_Indentation;
2409: END IF;
2410:
2411: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2407: okc_debug.log('7900: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2408: okc_debug.Reset_Indentation;
2409: END IF;
2410:
2411: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2412: (
2413: l_api_name,
2414: G_PKG_NAME,
2415: 'OKC_API.G_RET_STS_ERROR',
2411: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2412: (
2413: l_api_name,
2414: G_PKG_NAME,
2415: 'OKC_API.G_RET_STS_ERROR',
2416: x_msg_count,
2417: x_msg_data,
2418: '_PVT'
2419: );
2416: x_msg_count,
2417: x_msg_data,
2418: '_PVT'
2419: );
2420: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2421:
2422: IF (l_debug = 'Y') THEN
2423: okc_debug.log('8000: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2424: okc_debug.Reset_Indentation;
2419: );
2420: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2421:
2422: IF (l_debug = 'Y') THEN
2423: okc_debug.log('8000: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2424: okc_debug.Reset_Indentation;
2425: END IF;
2426:
2427: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2423: okc_debug.log('8000: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2424: okc_debug.Reset_Indentation;
2425: END IF;
2426:
2427: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2428: (
2429: l_api_name,
2430: G_PKG_NAME,
2431: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2427: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2428: (
2429: l_api_name,
2430: G_PKG_NAME,
2431: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2432: x_msg_count,
2433: x_msg_data,
2434: '_PVT'
2435: );
2439: okc_debug.log('8100: Exiting lock_row:OTHERS Exception', 2);
2440: okc_debug.Reset_Indentation;
2441: END IF;
2442:
2443: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2444: (
2445: l_api_name,
2446: G_PKG_NAME,
2447: 'OTHERS',
2463: p_ctcv_rec IN ctcv_rec_type) IS
2464:
2465: l_api_version CONSTANT NUMBER := 1;
2466: l_api_name CONSTANT VARCHAR2(30) := 'V_lock_row';
2467: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2468: l_ctc_rec ctc_rec_type;
2469: BEGIN
2470:
2471: IF (l_debug = 'Y') THEN
2472: okc_debug.Set_Indentation('OKC_CTC_PVT');
2473: okc_debug.log('8200: Entered lock_row', 2);
2474: END IF;
2475:
2476: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2477: G_PKG_NAME,
2478: p_init_msg_list,
2479: l_api_version,
2480: p_api_version,
2479: l_api_version,
2480: p_api_version,
2481: '_PVT',
2482: x_return_status);
2483: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2484: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2485: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2486: RAISE OKC_API.G_EXCEPTION_ERROR;
2487: END IF;
2480: p_api_version,
2481: '_PVT',
2482: x_return_status);
2483: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2484: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2485: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2486: RAISE OKC_API.G_EXCEPTION_ERROR;
2487: END IF;
2488: --------------------------------------
2481: '_PVT',
2482: x_return_status);
2483: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2484: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2485: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2486: RAISE OKC_API.G_EXCEPTION_ERROR;
2487: END IF;
2488: --------------------------------------
2489: -- Move VIEW record to "Child" records
2482: x_return_status);
2483: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2484: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2485: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2486: RAISE OKC_API.G_EXCEPTION_ERROR;
2487: END IF;
2488: --------------------------------------
2489: -- Move VIEW record to "Child" records
2490: --------------------------------------
2498: x_msg_count,
2499: x_msg_data,
2500: l_ctc_rec
2501: );
2502: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2503: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2504: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2505: RAISE OKC_API.G_EXCEPTION_ERROR;
2506: END IF;
2499: x_msg_data,
2500: l_ctc_rec
2501: );
2502: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2503: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2504: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2505: RAISE OKC_API.G_EXCEPTION_ERROR;
2506: END IF;
2507: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2500: l_ctc_rec
2501: );
2502: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2503: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2504: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2505: RAISE OKC_API.G_EXCEPTION_ERROR;
2506: END IF;
2507: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2508:
2501: );
2502: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2503: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2504: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2505: RAISE OKC_API.G_EXCEPTION_ERROR;
2506: END IF;
2507: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2508:
2509: IF (l_debug = 'Y') THEN
2503: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2504: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2505: RAISE OKC_API.G_EXCEPTION_ERROR;
2506: END IF;
2507: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2508:
2509: IF (l_debug = 'Y') THEN
2510: okc_debug.log('8300: Leaving lock_row', 2);
2511: okc_debug.Reset_Indentation;
2511: okc_debug.Reset_Indentation;
2512: END IF;
2513:
2514: EXCEPTION
2515: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2516:
2517: IF (l_debug = 'Y') THEN
2518: okc_debug.log('8400: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2519: okc_debug.Reset_Indentation;
2514: EXCEPTION
2515: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2516:
2517: IF (l_debug = 'Y') THEN
2518: okc_debug.log('8400: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2519: okc_debug.Reset_Indentation;
2520: END IF;
2521:
2522: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2518: okc_debug.log('8400: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2519: okc_debug.Reset_Indentation;
2520: END IF;
2521:
2522: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2523: (
2524: l_api_name,
2525: G_PKG_NAME,
2526: 'OKC_API.G_RET_STS_ERROR',
2522: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2523: (
2524: l_api_name,
2525: G_PKG_NAME,
2526: 'OKC_API.G_RET_STS_ERROR',
2527: x_msg_count,
2528: x_msg_data,
2529: '_PVT'
2530: );
2527: x_msg_count,
2528: x_msg_data,
2529: '_PVT'
2530: );
2531: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2532:
2533: IF (l_debug = 'Y') THEN
2534: okc_debug.log('8500: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2535: okc_debug.Reset_Indentation;
2530: );
2531: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2532:
2533: IF (l_debug = 'Y') THEN
2534: okc_debug.log('8500: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2535: okc_debug.Reset_Indentation;
2536: END IF;
2537:
2538: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2534: okc_debug.log('8500: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2535: okc_debug.Reset_Indentation;
2536: END IF;
2537:
2538: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2539: (
2540: l_api_name,
2541: G_PKG_NAME,
2542: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2538: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2539: (
2540: l_api_name,
2541: G_PKG_NAME,
2542: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2543: x_msg_count,
2544: x_msg_data,
2545: '_PVT'
2546: );
2550: okc_debug.log('8600: Exiting lock_row:OTHERS Exception', 2);
2551: okc_debug.Reset_Indentation;
2552: END IF;
2553:
2554: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2555: (
2556: l_api_name,
2557: G_PKG_NAME,
2558: 'OTHERS',
2574: p_ctcv_tbl IN ctcv_tbl_type) IS
2575:
2576: l_api_version CONSTANT NUMBER := 1;
2577: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_lock_row';
2578: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2579: i NUMBER := 0;
2580: BEGIN
2581:
2582: IF (l_debug = 'Y') THEN
2583: okc_debug.Set_Indentation('OKC_CTC_PVT');
2584: okc_debug.log('8700: Entered lock_row', 2);
2585: END IF;
2586:
2587: OKC_API.init_msg_list(p_init_msg_list);
2588: -- Make sure PL/SQL table has records in it before passing
2589: IF (p_ctcv_tbl.COUNT > 0) THEN
2590: i := p_ctcv_tbl.FIRST;
2591: LOOP
2590: i := p_ctcv_tbl.FIRST;
2591: LOOP
2592: lock_row (
2593: p_api_version => p_api_version,
2594: p_init_msg_list => OKC_API.G_FALSE,
2595: x_return_status => x_return_status,
2596: x_msg_count => x_msg_count,
2597: x_msg_data => x_msg_data,
2598: p_ctcv_rec => p_ctcv_tbl(i));
2606: okc_debug.Reset_Indentation;
2607: END IF;
2608:
2609: EXCEPTION
2610: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2611:
2612: IF (l_debug = 'Y') THEN
2613: okc_debug.log('8900: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2614: okc_debug.Reset_Indentation;
2609: EXCEPTION
2610: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2611:
2612: IF (l_debug = 'Y') THEN
2613: okc_debug.log('8900: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2614: okc_debug.Reset_Indentation;
2615: END IF;
2616:
2617: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2613: okc_debug.log('8900: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2614: okc_debug.Reset_Indentation;
2615: END IF;
2616:
2617: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2618: (
2619: l_api_name,
2620: G_PKG_NAME,
2621: 'OKC_API.G_RET_STS_ERROR',
2617: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2618: (
2619: l_api_name,
2620: G_PKG_NAME,
2621: 'OKC_API.G_RET_STS_ERROR',
2622: x_msg_count,
2623: x_msg_data,
2624: '_PVT'
2625: );
2622: x_msg_count,
2623: x_msg_data,
2624: '_PVT'
2625: );
2626: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2627:
2628: IF (l_debug = 'Y') THEN
2629: okc_debug.log('9000: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2630: okc_debug.Reset_Indentation;
2625: );
2626: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2627:
2628: IF (l_debug = 'Y') THEN
2629: okc_debug.log('9000: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2630: okc_debug.Reset_Indentation;
2631: END IF;
2632:
2633: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2629: okc_debug.log('9000: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2630: okc_debug.Reset_Indentation;
2631: END IF;
2632:
2633: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2634: (
2635: l_api_name,
2636: G_PKG_NAME,
2637: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2633: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2634: (
2635: l_api_name,
2636: G_PKG_NAME,
2637: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2638: x_msg_count,
2639: x_msg_data,
2640: '_PVT'
2641: );
2645: okc_debug.log('9100: Exiting lock_row:OTHERS Exception', 2);
2646: okc_debug.Reset_Indentation;
2647: END IF;
2648:
2649: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2650: (
2651: l_api_name,
2652: G_PKG_NAME,
2653: 'OTHERS',
2673: x_ctc_rec OUT NOCOPY ctc_rec_type) IS
2674:
2675: l_api_version CONSTANT NUMBER := 1;
2676: l_api_name CONSTANT VARCHAR2(30) := 'CONTACTS_update_row';
2677: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2678: l_ctc_rec ctc_rec_type := p_ctc_rec;
2679: l_def_ctc_rec ctc_rec_type;
2680: l_row_notfound BOOLEAN := TRUE;
2681: ----------------------------------
2686: x_ctc_rec OUT NOCOPY ctc_rec_type
2687: ) RETURN VARCHAR2 IS
2688: l_ctc_rec ctc_rec_type;
2689: l_row_notfound BOOLEAN := TRUE;
2690: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2691: BEGIN
2692:
2693: IF (l_debug = 'Y') THEN
2694: okc_debug.Set_Indentation('OKC_CTC_PVT');
2698: x_ctc_rec := p_ctc_rec;
2699: -- Get current database values
2700: l_ctc_rec := get_rec(p_ctc_rec, l_row_notfound);
2701: IF (l_row_notfound) THEN
2702: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2703: END IF;
2704: IF (x_ctc_rec.id = OKC_API.G_MISS_NUM)
2705: THEN
2706: x_ctc_rec.id := l_ctc_rec.id;
2700: l_ctc_rec := get_rec(p_ctc_rec, l_row_notfound);
2701: IF (l_row_notfound) THEN
2702: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2703: END IF;
2704: IF (x_ctc_rec.id = OKC_API.G_MISS_NUM)
2705: THEN
2706: x_ctc_rec.id := l_ctc_rec.id;
2707: END IF;
2708: IF (x_ctc_rec.cpl_id = OKC_API.G_MISS_NUM)
2704: IF (x_ctc_rec.id = OKC_API.G_MISS_NUM)
2705: THEN
2706: x_ctc_rec.id := l_ctc_rec.id;
2707: END IF;
2708: IF (x_ctc_rec.cpl_id = OKC_API.G_MISS_NUM)
2709: THEN
2710: x_ctc_rec.cpl_id := l_ctc_rec.cpl_id;
2711: END IF;
2712: IF (x_ctc_rec.cro_code = OKC_API.G_MISS_CHAR)
2708: IF (x_ctc_rec.cpl_id = OKC_API.G_MISS_NUM)
2709: THEN
2710: x_ctc_rec.cpl_id := l_ctc_rec.cpl_id;
2711: END IF;
2712: IF (x_ctc_rec.cro_code = OKC_API.G_MISS_CHAR)
2713: THEN
2714: x_ctc_rec.cro_code := l_ctc_rec.cro_code;
2715: END IF;
2716: IF (x_ctc_rec.dnz_chr_id = OKC_API.G_MISS_NUM)
2712: IF (x_ctc_rec.cro_code = OKC_API.G_MISS_CHAR)
2713: THEN
2714: x_ctc_rec.cro_code := l_ctc_rec.cro_code;
2715: END IF;
2716: IF (x_ctc_rec.dnz_chr_id = OKC_API.G_MISS_NUM)
2717: THEN
2718: x_ctc_rec.dnz_chr_id := l_ctc_rec.dnz_chr_id;
2719: END IF;
2720: IF (x_ctc_rec.object1_id1 = OKC_API.G_MISS_CHAR)
2716: IF (x_ctc_rec.dnz_chr_id = OKC_API.G_MISS_NUM)
2717: THEN
2718: x_ctc_rec.dnz_chr_id := l_ctc_rec.dnz_chr_id;
2719: END IF;
2720: IF (x_ctc_rec.object1_id1 = OKC_API.G_MISS_CHAR)
2721: THEN
2722: x_ctc_rec.object1_id1 := l_ctc_rec.object1_id1;
2723: END IF;
2724: IF (x_ctc_rec.object1_id2 = OKC_API.G_MISS_CHAR)
2720: IF (x_ctc_rec.object1_id1 = OKC_API.G_MISS_CHAR)
2721: THEN
2722: x_ctc_rec.object1_id1 := l_ctc_rec.object1_id1;
2723: END IF;
2724: IF (x_ctc_rec.object1_id2 = OKC_API.G_MISS_CHAR)
2725: THEN
2726: x_ctc_rec.object1_id2 := l_ctc_rec.object1_id2;
2727: END IF;
2728: IF (x_ctc_rec.jtot_object1_code = OKC_API.G_MISS_CHAR)
2724: IF (x_ctc_rec.object1_id2 = OKC_API.G_MISS_CHAR)
2725: THEN
2726: x_ctc_rec.object1_id2 := l_ctc_rec.object1_id2;
2727: END IF;
2728: IF (x_ctc_rec.jtot_object1_code = OKC_API.G_MISS_CHAR)
2729: THEN
2730: x_ctc_rec.JTOT_OBJECT1_CODE := l_ctc_rec.JTOT_OBJECT1_CODE;
2731: END IF;
2732: IF (x_ctc_rec.object_version_number = OKC_API.G_MISS_NUM)
2728: IF (x_ctc_rec.jtot_object1_code = OKC_API.G_MISS_CHAR)
2729: THEN
2730: x_ctc_rec.JTOT_OBJECT1_CODE := l_ctc_rec.JTOT_OBJECT1_CODE;
2731: END IF;
2732: IF (x_ctc_rec.object_version_number = OKC_API.G_MISS_NUM)
2733: THEN
2734: x_ctc_rec.object_version_number := l_ctc_rec.object_version_number;
2735: END IF;
2736: IF (x_ctc_rec.created_by = OKC_API.G_MISS_NUM)
2732: IF (x_ctc_rec.object_version_number = OKC_API.G_MISS_NUM)
2733: THEN
2734: x_ctc_rec.object_version_number := l_ctc_rec.object_version_number;
2735: END IF;
2736: IF (x_ctc_rec.created_by = OKC_API.G_MISS_NUM)
2737: THEN
2738: x_ctc_rec.created_by := l_ctc_rec.created_by;
2739: END IF;
2740: IF (x_ctc_rec.creation_date = OKC_API.G_MISS_DATE)
2736: IF (x_ctc_rec.created_by = OKC_API.G_MISS_NUM)
2737: THEN
2738: x_ctc_rec.created_by := l_ctc_rec.created_by;
2739: END IF;
2740: IF (x_ctc_rec.creation_date = OKC_API.G_MISS_DATE)
2741: THEN
2742: x_ctc_rec.creation_date := l_ctc_rec.creation_date;
2743: END IF;
2744: IF (x_ctc_rec.last_updated_by = OKC_API.G_MISS_NUM)
2740: IF (x_ctc_rec.creation_date = OKC_API.G_MISS_DATE)
2741: THEN
2742: x_ctc_rec.creation_date := l_ctc_rec.creation_date;
2743: END IF;
2744: IF (x_ctc_rec.last_updated_by = OKC_API.G_MISS_NUM)
2745: THEN
2746: x_ctc_rec.last_updated_by := l_ctc_rec.last_updated_by;
2747: END IF;
2748: IF (x_ctc_rec.last_update_date = OKC_API.G_MISS_DATE)
2744: IF (x_ctc_rec.last_updated_by = OKC_API.G_MISS_NUM)
2745: THEN
2746: x_ctc_rec.last_updated_by := l_ctc_rec.last_updated_by;
2747: END IF;
2748: IF (x_ctc_rec.last_update_date = OKC_API.G_MISS_DATE)
2749: THEN
2750: x_ctc_rec.last_update_date := l_ctc_rec.last_update_date;
2751: END IF;
2752: IF (x_ctc_rec.contact_sequence = OKC_API.G_MISS_NUM)
2748: IF (x_ctc_rec.last_update_date = OKC_API.G_MISS_DATE)
2749: THEN
2750: x_ctc_rec.last_update_date := l_ctc_rec.last_update_date;
2751: END IF;
2752: IF (x_ctc_rec.contact_sequence = OKC_API.G_MISS_NUM)
2753: THEN
2754: x_ctc_rec.contact_sequence := l_ctc_rec.contact_sequence;
2755: END IF;
2756: IF (x_ctc_rec.last_update_login = OKC_API.G_MISS_NUM)
2752: IF (x_ctc_rec.contact_sequence = OKC_API.G_MISS_NUM)
2753: THEN
2754: x_ctc_rec.contact_sequence := l_ctc_rec.contact_sequence;
2755: END IF;
2756: IF (x_ctc_rec.last_update_login = OKC_API.G_MISS_NUM)
2757: THEN
2758: x_ctc_rec.last_update_login := l_ctc_rec.last_update_login;
2759: END IF;
2760: IF (x_ctc_rec.primary_yn = OKC_API.G_MISS_CHAR)
2756: IF (x_ctc_rec.last_update_login = OKC_API.G_MISS_NUM)
2757: THEN
2758: x_ctc_rec.last_update_login := l_ctc_rec.last_update_login;
2759: END IF;
2760: IF (x_ctc_rec.primary_yn = OKC_API.G_MISS_CHAR)
2761: THEN
2762: x_ctc_rec.primary_yn := l_ctc_rec.primary_yn;
2763: END IF;
2764: --
2761: THEN
2762: x_ctc_rec.primary_yn := l_ctc_rec.primary_yn;
2763: END IF;
2764: --
2765: IF (x_ctc_rec.resource_class = OKC_API.G_MISS_CHAR)
2766: THEN
2767: x_ctc_rec.resource_class := l_ctc_rec.resource_class;
2768: END IF;
2769: --
2766: THEN
2767: x_ctc_rec.resource_class := l_ctc_rec.resource_class;
2768: END IF;
2769: --
2770: IF (x_ctc_rec.SALES_GROUP_ID = OKC_API.G_MISS_NUM)
2771: THEN
2772: x_ctc_rec.SALES_GROUP_ID :=l_ctc_rec.SALES_GROUP_ID;
2773: END IF;
2774: --
2771: THEN
2772: x_ctc_rec.SALES_GROUP_ID :=l_ctc_rec.SALES_GROUP_ID;
2773: END IF;
2774: --
2775: IF (x_ctc_rec.attribute_category = OKC_API.G_MISS_CHAR)
2776: THEN
2777: x_ctc_rec.attribute_category := l_ctc_rec.attribute_category;
2778: END IF;
2779: IF (x_ctc_rec.attribute1 = OKC_API.G_MISS_CHAR)
2775: IF (x_ctc_rec.attribute_category = OKC_API.G_MISS_CHAR)
2776: THEN
2777: x_ctc_rec.attribute_category := l_ctc_rec.attribute_category;
2778: END IF;
2779: IF (x_ctc_rec.attribute1 = OKC_API.G_MISS_CHAR)
2780: THEN
2781: x_ctc_rec.attribute1 := l_ctc_rec.attribute1;
2782: END IF;
2783: IF (x_ctc_rec.attribute2 = OKC_API.G_MISS_CHAR)
2779: IF (x_ctc_rec.attribute1 = OKC_API.G_MISS_CHAR)
2780: THEN
2781: x_ctc_rec.attribute1 := l_ctc_rec.attribute1;
2782: END IF;
2783: IF (x_ctc_rec.attribute2 = OKC_API.G_MISS_CHAR)
2784: THEN
2785: x_ctc_rec.attribute2 := l_ctc_rec.attribute2;
2786: END IF;
2787: IF (x_ctc_rec.attribute3 = OKC_API.G_MISS_CHAR)
2783: IF (x_ctc_rec.attribute2 = OKC_API.G_MISS_CHAR)
2784: THEN
2785: x_ctc_rec.attribute2 := l_ctc_rec.attribute2;
2786: END IF;
2787: IF (x_ctc_rec.attribute3 = OKC_API.G_MISS_CHAR)
2788: THEN
2789: x_ctc_rec.attribute3 := l_ctc_rec.attribute3;
2790: END IF;
2791: IF (x_ctc_rec.attribute4 = OKC_API.G_MISS_CHAR)
2787: IF (x_ctc_rec.attribute3 = OKC_API.G_MISS_CHAR)
2788: THEN
2789: x_ctc_rec.attribute3 := l_ctc_rec.attribute3;
2790: END IF;
2791: IF (x_ctc_rec.attribute4 = OKC_API.G_MISS_CHAR)
2792: THEN
2793: x_ctc_rec.attribute4 := l_ctc_rec.attribute4;
2794: END IF;
2795: IF (x_ctc_rec.attribute5 = OKC_API.G_MISS_CHAR)
2791: IF (x_ctc_rec.attribute4 = OKC_API.G_MISS_CHAR)
2792: THEN
2793: x_ctc_rec.attribute4 := l_ctc_rec.attribute4;
2794: END IF;
2795: IF (x_ctc_rec.attribute5 = OKC_API.G_MISS_CHAR)
2796: THEN
2797: x_ctc_rec.attribute5 := l_ctc_rec.attribute5;
2798: END IF;
2799: IF (x_ctc_rec.attribute6 = OKC_API.G_MISS_CHAR)
2795: IF (x_ctc_rec.attribute5 = OKC_API.G_MISS_CHAR)
2796: THEN
2797: x_ctc_rec.attribute5 := l_ctc_rec.attribute5;
2798: END IF;
2799: IF (x_ctc_rec.attribute6 = OKC_API.G_MISS_CHAR)
2800: THEN
2801: x_ctc_rec.attribute6 := l_ctc_rec.attribute6;
2802: END IF;
2803: IF (x_ctc_rec.attribute7 = OKC_API.G_MISS_CHAR)
2799: IF (x_ctc_rec.attribute6 = OKC_API.G_MISS_CHAR)
2800: THEN
2801: x_ctc_rec.attribute6 := l_ctc_rec.attribute6;
2802: END IF;
2803: IF (x_ctc_rec.attribute7 = OKC_API.G_MISS_CHAR)
2804: THEN
2805: x_ctc_rec.attribute7 := l_ctc_rec.attribute7;
2806: END IF;
2807: IF (x_ctc_rec.attribute8 = OKC_API.G_MISS_CHAR)
2803: IF (x_ctc_rec.attribute7 = OKC_API.G_MISS_CHAR)
2804: THEN
2805: x_ctc_rec.attribute7 := l_ctc_rec.attribute7;
2806: END IF;
2807: IF (x_ctc_rec.attribute8 = OKC_API.G_MISS_CHAR)
2808: THEN
2809: x_ctc_rec.attribute8 := l_ctc_rec.attribute8;
2810: END IF;
2811: IF (x_ctc_rec.attribute9 = OKC_API.G_MISS_CHAR)
2807: IF (x_ctc_rec.attribute8 = OKC_API.G_MISS_CHAR)
2808: THEN
2809: x_ctc_rec.attribute8 := l_ctc_rec.attribute8;
2810: END IF;
2811: IF (x_ctc_rec.attribute9 = OKC_API.G_MISS_CHAR)
2812: THEN
2813: x_ctc_rec.attribute9 := l_ctc_rec.attribute9;
2814: END IF;
2815: IF (x_ctc_rec.attribute10 = OKC_API.G_MISS_CHAR)
2811: IF (x_ctc_rec.attribute9 = OKC_API.G_MISS_CHAR)
2812: THEN
2813: x_ctc_rec.attribute9 := l_ctc_rec.attribute9;
2814: END IF;
2815: IF (x_ctc_rec.attribute10 = OKC_API.G_MISS_CHAR)
2816: THEN
2817: x_ctc_rec.attribute10 := l_ctc_rec.attribute10;
2818: END IF;
2819: IF (x_ctc_rec.attribute11 = OKC_API.G_MISS_CHAR)
2815: IF (x_ctc_rec.attribute10 = OKC_API.G_MISS_CHAR)
2816: THEN
2817: x_ctc_rec.attribute10 := l_ctc_rec.attribute10;
2818: END IF;
2819: IF (x_ctc_rec.attribute11 = OKC_API.G_MISS_CHAR)
2820: THEN
2821: x_ctc_rec.attribute11 := l_ctc_rec.attribute11;
2822: END IF;
2823: IF (x_ctc_rec.attribute12 = OKC_API.G_MISS_CHAR)
2819: IF (x_ctc_rec.attribute11 = OKC_API.G_MISS_CHAR)
2820: THEN
2821: x_ctc_rec.attribute11 := l_ctc_rec.attribute11;
2822: END IF;
2823: IF (x_ctc_rec.attribute12 = OKC_API.G_MISS_CHAR)
2824: THEN
2825: x_ctc_rec.attribute12 := l_ctc_rec.attribute12;
2826: END IF;
2827: IF (x_ctc_rec.attribute13 = OKC_API.G_MISS_CHAR)
2823: IF (x_ctc_rec.attribute12 = OKC_API.G_MISS_CHAR)
2824: THEN
2825: x_ctc_rec.attribute12 := l_ctc_rec.attribute12;
2826: END IF;
2827: IF (x_ctc_rec.attribute13 = OKC_API.G_MISS_CHAR)
2828: THEN
2829: x_ctc_rec.attribute13 := l_ctc_rec.attribute13;
2830: END IF;
2831: IF (x_ctc_rec.attribute14 = OKC_API.G_MISS_CHAR)
2827: IF (x_ctc_rec.attribute13 = OKC_API.G_MISS_CHAR)
2828: THEN
2829: x_ctc_rec.attribute13 := l_ctc_rec.attribute13;
2830: END IF;
2831: IF (x_ctc_rec.attribute14 = OKC_API.G_MISS_CHAR)
2832: THEN
2833: x_ctc_rec.attribute14 := l_ctc_rec.attribute14;
2834: END IF;
2835: IF (x_ctc_rec.attribute15 = OKC_API.G_MISS_CHAR)
2831: IF (x_ctc_rec.attribute14 = OKC_API.G_MISS_CHAR)
2832: THEN
2833: x_ctc_rec.attribute14 := l_ctc_rec.attribute14;
2834: END IF;
2835: IF (x_ctc_rec.attribute15 = OKC_API.G_MISS_CHAR)
2836: THEN
2837: x_ctc_rec.attribute15 := l_ctc_rec.attribute15;
2838: END IF;
2839:
2836: THEN
2837: x_ctc_rec.attribute15 := l_ctc_rec.attribute15;
2838: END IF;
2839:
2840: IF (x_ctc_rec.start_date = OKC_API.G_MISS_DATE)
2841: THEN
2842: x_ctc_rec.start_date := l_ctc_rec.start_date;
2843: END IF;
2844:
2841: THEN
2842: x_ctc_rec.start_date := l_ctc_rec.start_date;
2843: END IF;
2844:
2845: IF (x_ctc_rec.end_date = OKC_API.G_MISS_DATE)
2846: THEN
2847: x_ctc_rec.end_date := l_ctc_rec.end_date;
2848: END IF;
2849:
2861: FUNCTION Set_Attributes (
2862: p_ctc_rec IN ctc_rec_type,
2863: x_ctc_rec OUT NOCOPY ctc_rec_type
2864: ) RETURN VARCHAR2 IS
2865: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2866: BEGIN
2867:
2868: x_ctc_rec := p_ctc_rec;
2869:
2876: okc_debug.Set_Indentation('OKC_CTC_PVT');
2877: okc_debug.log('9400: Entered update_row', 2);
2878: END IF;
2879:
2880: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2881: p_init_msg_list,
2882: '_PVT',
2883: x_return_status);
2884: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2880: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2881: p_init_msg_list,
2882: '_PVT',
2883: x_return_status);
2884: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2885: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2886: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2887: RAISE OKC_API.G_EXCEPTION_ERROR;
2888: END IF;
2881: p_init_msg_list,
2882: '_PVT',
2883: x_return_status);
2884: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2885: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2886: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2887: RAISE OKC_API.G_EXCEPTION_ERROR;
2888: END IF;
2889: --- Setting item attributes
2882: '_PVT',
2883: x_return_status);
2884: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2885: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2886: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2887: RAISE OKC_API.G_EXCEPTION_ERROR;
2888: END IF;
2889: --- Setting item attributes
2890: l_return_status := Set_Attributes(
2883: x_return_status);
2884: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2885: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2886: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2887: RAISE OKC_API.G_EXCEPTION_ERROR;
2888: END IF;
2889: --- Setting item attributes
2890: l_return_status := Set_Attributes(
2891: p_ctc_rec, -- IN
2890: l_return_status := Set_Attributes(
2891: p_ctc_rec, -- IN
2892: l_ctc_rec); -- OUT
2893: --- If any errors happen abort API
2894: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2895: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2896: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2897: RAISE OKC_API.G_EXCEPTION_ERROR;
2898: END IF;
2891: p_ctc_rec, -- IN
2892: l_ctc_rec); -- OUT
2893: --- If any errors happen abort API
2894: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2895: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2896: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2897: RAISE OKC_API.G_EXCEPTION_ERROR;
2898: END IF;
2899: l_return_status := populate_new_record(l_ctc_rec, l_def_ctc_rec);
2892: l_ctc_rec); -- OUT
2893: --- If any errors happen abort API
2894: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2895: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2896: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2897: RAISE OKC_API.G_EXCEPTION_ERROR;
2898: END IF;
2899: l_return_status := populate_new_record(l_ctc_rec, l_def_ctc_rec);
2900: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2893: --- If any errors happen abort API
2894: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2895: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2896: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2897: RAISE OKC_API.G_EXCEPTION_ERROR;
2898: END IF;
2899: l_return_status := populate_new_record(l_ctc_rec, l_def_ctc_rec);
2900: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2901: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2896: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2897: RAISE OKC_API.G_EXCEPTION_ERROR;
2898: END IF;
2899: l_return_status := populate_new_record(l_ctc_rec, l_def_ctc_rec);
2900: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2901: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2902: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2903: RAISE OKC_API.G_EXCEPTION_ERROR;
2904: END IF;
2897: RAISE OKC_API.G_EXCEPTION_ERROR;
2898: END IF;
2899: l_return_status := populate_new_record(l_ctc_rec, l_def_ctc_rec);
2900: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2901: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2902: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2903: RAISE OKC_API.G_EXCEPTION_ERROR;
2904: END IF;
2905: UPDATE OKC_CONTACTS
2898: END IF;
2899: l_return_status := populate_new_record(l_ctc_rec, l_def_ctc_rec);
2900: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2901: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2902: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2903: RAISE OKC_API.G_EXCEPTION_ERROR;
2904: END IF;
2905: UPDATE OKC_CONTACTS
2906: SET CPL_ID = l_def_ctc_rec.cpl_id,
2899: l_return_status := populate_new_record(l_ctc_rec, l_def_ctc_rec);
2900: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2901: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2902: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2903: RAISE OKC_API.G_EXCEPTION_ERROR;
2904: END IF;
2905: UPDATE OKC_CONTACTS
2906: SET CPL_ID = l_def_ctc_rec.cpl_id,
2907: CRO_CODE = l_def_ctc_rec.cro_code,
2939: END_DATE = l_def_ctc_rec.end_date
2940: WHERE ID = l_def_ctc_rec.id;
2941:
2942: x_ctc_rec := l_def_ctc_rec;
2943: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2944:
2945: IF (l_debug = 'Y') THEN
2946: okc_debug.log('9500: Leaving update_row', 2);
2947: okc_debug.Reset_Indentation;
2947: okc_debug.Reset_Indentation;
2948: END IF;
2949:
2950: EXCEPTION
2951: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2952:
2953: IF (l_debug = 'Y') THEN
2954: okc_debug.log('9600: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2955: okc_debug.Reset_Indentation;
2950: EXCEPTION
2951: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2952:
2953: IF (l_debug = 'Y') THEN
2954: okc_debug.log('9600: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2955: okc_debug.Reset_Indentation;
2956: END IF;
2957:
2958: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2954: okc_debug.log('9600: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2955: okc_debug.Reset_Indentation;
2956: END IF;
2957:
2958: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2959: (
2960: l_api_name,
2961: G_PKG_NAME,
2962: 'OKC_API.G_RET_STS_ERROR',
2958: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2959: (
2960: l_api_name,
2961: G_PKG_NAME,
2962: 'OKC_API.G_RET_STS_ERROR',
2963: x_msg_count,
2964: x_msg_data,
2965: '_PVT'
2966: );
2963: x_msg_count,
2964: x_msg_data,
2965: '_PVT'
2966: );
2967: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2968:
2969: IF (l_debug = 'Y') THEN
2970: okc_debug.log('9700: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2971: okc_debug.Reset_Indentation;
2966: );
2967: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2968:
2969: IF (l_debug = 'Y') THEN
2970: okc_debug.log('9700: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2971: okc_debug.Reset_Indentation;
2972: END IF;
2973:
2974: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2970: okc_debug.log('9700: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2971: okc_debug.Reset_Indentation;
2972: END IF;
2973:
2974: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2975: (
2976: l_api_name,
2977: G_PKG_NAME,
2978: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2974: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2975: (
2976: l_api_name,
2977: G_PKG_NAME,
2978: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2979: x_msg_count,
2980: x_msg_data,
2981: '_PVT'
2982: );
2986: okc_debug.log('9800: Exiting update_row:OTHERS Exception', 2);
2987: okc_debug.Reset_Indentation;
2988: END IF;
2989:
2990: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2991: (
2992: l_api_name,
2993: G_PKG_NAME,
2994: 'OTHERS',
3011: x_ctcv_rec OUT NOCOPY ctcv_rec_type) IS
3012:
3013: l_api_version CONSTANT NUMBER := 1;
3014: l_api_name CONSTANT VARCHAR2(30) := 'V_update_row';
3015: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3016: l_ctcv_rec ctcv_rec_type := p_ctcv_rec;
3017: l_def_ctcv_rec ctcv_rec_type;
3018: l_ctc_rec ctc_rec_type;
3019: lx_ctc_rec ctc_rec_type;
3041: x_ctcv_rec OUT NOCOPY ctcv_rec_type
3042: ) RETURN VARCHAR2 IS
3043: l_ctcv_rec ctcv_rec_type;
3044: l_row_notfound BOOLEAN := TRUE;
3045: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3046: BEGIN
3047:
3048: IF (l_debug = 'Y') THEN
3049: okc_debug.Set_Indentation('OKC_CTC_PVT');
3053: x_ctcv_rec := p_ctcv_rec;
3054: -- Get current database values
3055: l_ctcv_rec := get_rec(p_ctcv_rec, l_row_notfound);
3056: IF (l_row_notfound) THEN
3057: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
3058: END IF;
3059: IF (x_ctcv_rec.id = OKC_API.G_MISS_NUM)
3060: THEN
3061: x_ctcv_rec.id := l_ctcv_rec.id;
3055: l_ctcv_rec := get_rec(p_ctcv_rec, l_row_notfound);
3056: IF (l_row_notfound) THEN
3057: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
3058: END IF;
3059: IF (x_ctcv_rec.id = OKC_API.G_MISS_NUM)
3060: THEN
3061: x_ctcv_rec.id := l_ctcv_rec.id;
3062: END IF;
3063: IF (x_ctcv_rec.object_version_number = OKC_API.G_MISS_NUM)
3059: IF (x_ctcv_rec.id = OKC_API.G_MISS_NUM)
3060: THEN
3061: x_ctcv_rec.id := l_ctcv_rec.id;
3062: END IF;
3063: IF (x_ctcv_rec.object_version_number = OKC_API.G_MISS_NUM)
3064: THEN
3065: x_ctcv_rec.object_version_number := l_ctcv_rec.object_version_number;
3066: END IF;
3067: IF (x_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM)
3063: IF (x_ctcv_rec.object_version_number = OKC_API.G_MISS_NUM)
3064: THEN
3065: x_ctcv_rec.object_version_number := l_ctcv_rec.object_version_number;
3066: END IF;
3067: IF (x_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM)
3068: THEN
3069: x_ctcv_rec.cpl_id := l_ctcv_rec.cpl_id;
3070: END IF;
3071: IF (x_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR)
3067: IF (x_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM)
3068: THEN
3069: x_ctcv_rec.cpl_id := l_ctcv_rec.cpl_id;
3070: END IF;
3071: IF (x_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR)
3072: THEN
3073: x_ctcv_rec.cro_code := l_ctcv_rec.cro_code;
3074: END IF;
3075: IF (x_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM)
3071: IF (x_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR)
3072: THEN
3073: x_ctcv_rec.cro_code := l_ctcv_rec.cro_code;
3074: END IF;
3075: IF (x_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM)
3076: THEN
3077: x_ctcv_rec.dnz_chr_id := l_ctcv_rec.dnz_chr_id;
3078: END IF;
3079: IF (x_ctcv_rec.contact_sequence = OKC_API.G_MISS_NUM)
3075: IF (x_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM)
3076: THEN
3077: x_ctcv_rec.dnz_chr_id := l_ctcv_rec.dnz_chr_id;
3078: END IF;
3079: IF (x_ctcv_rec.contact_sequence = OKC_API.G_MISS_NUM)
3080: THEN
3081: x_ctcv_rec.contact_sequence := l_ctcv_rec.contact_sequence;
3082: END IF;
3083: IF (x_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR)
3079: IF (x_ctcv_rec.contact_sequence = OKC_API.G_MISS_NUM)
3080: THEN
3081: x_ctcv_rec.contact_sequence := l_ctcv_rec.contact_sequence;
3082: END IF;
3083: IF (x_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR)
3084: THEN
3085: x_ctcv_rec.object1_id1 := l_ctcv_rec.object1_id1;
3086: END IF;
3087: IF (x_ctcv_rec.object1_id2 = OKC_API.G_MISS_CHAR)
3083: IF (x_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR)
3084: THEN
3085: x_ctcv_rec.object1_id1 := l_ctcv_rec.object1_id1;
3086: END IF;
3087: IF (x_ctcv_rec.object1_id2 = OKC_API.G_MISS_CHAR)
3088: THEN
3089: x_ctcv_rec.object1_id2 := l_ctcv_rec.object1_id2;
3090: END IF;
3091: IF (x_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR)
3087: IF (x_ctcv_rec.object1_id2 = OKC_API.G_MISS_CHAR)
3088: THEN
3089: x_ctcv_rec.object1_id2 := l_ctcv_rec.object1_id2;
3090: END IF;
3091: IF (x_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR)
3092: THEN
3093: x_ctcv_rec.JTOT_OBJECT1_CODE := l_ctcv_rec.JTOT_OBJECT1_CODE;
3094: END IF;
3095: IF (x_ctcv_rec.primary_yn = OKC_API.G_MISS_CHAR)
3091: IF (x_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR)
3092: THEN
3093: x_ctcv_rec.JTOT_OBJECT1_CODE := l_ctcv_rec.JTOT_OBJECT1_CODE;
3094: END IF;
3095: IF (x_ctcv_rec.primary_yn = OKC_API.G_MISS_CHAR)
3096: THEN
3097: x_ctcv_rec.PRIMARY_YN := l_ctcv_rec.PRIMARY_YN;
3098: END IF;
3099: IF (x_ctcv_rec.RESOURCE_CLASS= OKC_API.G_MISS_CHAR)
3095: IF (x_ctcv_rec.primary_yn = OKC_API.G_MISS_CHAR)
3096: THEN
3097: x_ctcv_rec.PRIMARY_YN := l_ctcv_rec.PRIMARY_YN;
3098: END IF;
3099: IF (x_ctcv_rec.RESOURCE_CLASS= OKC_API.G_MISS_CHAR)
3100: THEN
3101: x_ctcv_rec.RESOURCE_CLASS := l_ctcv_rec.RESOURCE_CLASS;
3102: END IF;
3103: --
3100: THEN
3101: x_ctcv_rec.RESOURCE_CLASS := l_ctcv_rec.RESOURCE_CLASS;
3102: END IF;
3103: --
3104: IF (x_ctcv_rec.SALES_GROUP_ID = OKC_API.G_MISS_NUM) THEN
3105: x_ctcv_rec.SALES_GROUP_ID := l_ctcv_rec.SALES_GROUP_ID;
3106: END IF;
3107: --
3108: IF (x_ctcv_rec.attribute_category = OKC_API.G_MISS_CHAR)
3104: IF (x_ctcv_rec.SALES_GROUP_ID = OKC_API.G_MISS_NUM) THEN
3105: x_ctcv_rec.SALES_GROUP_ID := l_ctcv_rec.SALES_GROUP_ID;
3106: END IF;
3107: --
3108: IF (x_ctcv_rec.attribute_category = OKC_API.G_MISS_CHAR)
3109: THEN
3110: x_ctcv_rec.attribute_category := l_ctcv_rec.attribute_category;
3111: END IF;
3112: IF (x_ctcv_rec.attribute1 = OKC_API.G_MISS_CHAR)
3108: IF (x_ctcv_rec.attribute_category = OKC_API.G_MISS_CHAR)
3109: THEN
3110: x_ctcv_rec.attribute_category := l_ctcv_rec.attribute_category;
3111: END IF;
3112: IF (x_ctcv_rec.attribute1 = OKC_API.G_MISS_CHAR)
3113: THEN
3114: x_ctcv_rec.attribute1 := l_ctcv_rec.attribute1;
3115: END IF;
3116: IF (x_ctcv_rec.attribute2 = OKC_API.G_MISS_CHAR)
3112: IF (x_ctcv_rec.attribute1 = OKC_API.G_MISS_CHAR)
3113: THEN
3114: x_ctcv_rec.attribute1 := l_ctcv_rec.attribute1;
3115: END IF;
3116: IF (x_ctcv_rec.attribute2 = OKC_API.G_MISS_CHAR)
3117: THEN
3118: x_ctcv_rec.attribute2 := l_ctcv_rec.attribute2;
3119: END IF;
3120: IF (x_ctcv_rec.attribute3 = OKC_API.G_MISS_CHAR)
3116: IF (x_ctcv_rec.attribute2 = OKC_API.G_MISS_CHAR)
3117: THEN
3118: x_ctcv_rec.attribute2 := l_ctcv_rec.attribute2;
3119: END IF;
3120: IF (x_ctcv_rec.attribute3 = OKC_API.G_MISS_CHAR)
3121: THEN
3122: x_ctcv_rec.attribute3 := l_ctcv_rec.attribute3;
3123: END IF;
3124: IF (x_ctcv_rec.attribute4 = OKC_API.G_MISS_CHAR)
3120: IF (x_ctcv_rec.attribute3 = OKC_API.G_MISS_CHAR)
3121: THEN
3122: x_ctcv_rec.attribute3 := l_ctcv_rec.attribute3;
3123: END IF;
3124: IF (x_ctcv_rec.attribute4 = OKC_API.G_MISS_CHAR)
3125: THEN
3126: x_ctcv_rec.attribute4 := l_ctcv_rec.attribute4;
3127: END IF;
3128: IF (x_ctcv_rec.attribute5 = OKC_API.G_MISS_CHAR)
3124: IF (x_ctcv_rec.attribute4 = OKC_API.G_MISS_CHAR)
3125: THEN
3126: x_ctcv_rec.attribute4 := l_ctcv_rec.attribute4;
3127: END IF;
3128: IF (x_ctcv_rec.attribute5 = OKC_API.G_MISS_CHAR)
3129: THEN
3130: x_ctcv_rec.attribute5 := l_ctcv_rec.attribute5;
3131: END IF;
3132: IF (x_ctcv_rec.attribute6 = OKC_API.G_MISS_CHAR)
3128: IF (x_ctcv_rec.attribute5 = OKC_API.G_MISS_CHAR)
3129: THEN
3130: x_ctcv_rec.attribute5 := l_ctcv_rec.attribute5;
3131: END IF;
3132: IF (x_ctcv_rec.attribute6 = OKC_API.G_MISS_CHAR)
3133: THEN
3134: x_ctcv_rec.attribute6 := l_ctcv_rec.attribute6;
3135: END IF;
3136: IF (x_ctcv_rec.attribute7 = OKC_API.G_MISS_CHAR)
3132: IF (x_ctcv_rec.attribute6 = OKC_API.G_MISS_CHAR)
3133: THEN
3134: x_ctcv_rec.attribute6 := l_ctcv_rec.attribute6;
3135: END IF;
3136: IF (x_ctcv_rec.attribute7 = OKC_API.G_MISS_CHAR)
3137: THEN
3138: x_ctcv_rec.attribute7 := l_ctcv_rec.attribute7;
3139: END IF;
3140: IF (x_ctcv_rec.attribute8 = OKC_API.G_MISS_CHAR)
3136: IF (x_ctcv_rec.attribute7 = OKC_API.G_MISS_CHAR)
3137: THEN
3138: x_ctcv_rec.attribute7 := l_ctcv_rec.attribute7;
3139: END IF;
3140: IF (x_ctcv_rec.attribute8 = OKC_API.G_MISS_CHAR)
3141: THEN
3142: x_ctcv_rec.attribute8 := l_ctcv_rec.attribute8;
3143: END IF;
3144: IF (x_ctcv_rec.attribute9 = OKC_API.G_MISS_CHAR)
3140: IF (x_ctcv_rec.attribute8 = OKC_API.G_MISS_CHAR)
3141: THEN
3142: x_ctcv_rec.attribute8 := l_ctcv_rec.attribute8;
3143: END IF;
3144: IF (x_ctcv_rec.attribute9 = OKC_API.G_MISS_CHAR)
3145: THEN
3146: x_ctcv_rec.attribute9 := l_ctcv_rec.attribute9;
3147: END IF;
3148: IF (x_ctcv_rec.attribute10 = OKC_API.G_MISS_CHAR)
3144: IF (x_ctcv_rec.attribute9 = OKC_API.G_MISS_CHAR)
3145: THEN
3146: x_ctcv_rec.attribute9 := l_ctcv_rec.attribute9;
3147: END IF;
3148: IF (x_ctcv_rec.attribute10 = OKC_API.G_MISS_CHAR)
3149: THEN
3150: x_ctcv_rec.attribute10 := l_ctcv_rec.attribute10;
3151: END IF;
3152: IF (x_ctcv_rec.attribute11 = OKC_API.G_MISS_CHAR)
3148: IF (x_ctcv_rec.attribute10 = OKC_API.G_MISS_CHAR)
3149: THEN
3150: x_ctcv_rec.attribute10 := l_ctcv_rec.attribute10;
3151: END IF;
3152: IF (x_ctcv_rec.attribute11 = OKC_API.G_MISS_CHAR)
3153: THEN
3154: x_ctcv_rec.attribute11 := l_ctcv_rec.attribute11;
3155: END IF;
3156: IF (x_ctcv_rec.attribute12 = OKC_API.G_MISS_CHAR)
3152: IF (x_ctcv_rec.attribute11 = OKC_API.G_MISS_CHAR)
3153: THEN
3154: x_ctcv_rec.attribute11 := l_ctcv_rec.attribute11;
3155: END IF;
3156: IF (x_ctcv_rec.attribute12 = OKC_API.G_MISS_CHAR)
3157: THEN
3158: x_ctcv_rec.attribute12 := l_ctcv_rec.attribute12;
3159: END IF;
3160: IF (x_ctcv_rec.attribute13 = OKC_API.G_MISS_CHAR)
3156: IF (x_ctcv_rec.attribute12 = OKC_API.G_MISS_CHAR)
3157: THEN
3158: x_ctcv_rec.attribute12 := l_ctcv_rec.attribute12;
3159: END IF;
3160: IF (x_ctcv_rec.attribute13 = OKC_API.G_MISS_CHAR)
3161: THEN
3162: x_ctcv_rec.attribute13 := l_ctcv_rec.attribute13;
3163: END IF;
3164: IF (x_ctcv_rec.attribute14 = OKC_API.G_MISS_CHAR)
3160: IF (x_ctcv_rec.attribute13 = OKC_API.G_MISS_CHAR)
3161: THEN
3162: x_ctcv_rec.attribute13 := l_ctcv_rec.attribute13;
3163: END IF;
3164: IF (x_ctcv_rec.attribute14 = OKC_API.G_MISS_CHAR)
3165: THEN
3166: x_ctcv_rec.attribute14 := l_ctcv_rec.attribute14;
3167: END IF;
3168: IF (x_ctcv_rec.attribute15 = OKC_API.G_MISS_CHAR)
3164: IF (x_ctcv_rec.attribute14 = OKC_API.G_MISS_CHAR)
3165: THEN
3166: x_ctcv_rec.attribute14 := l_ctcv_rec.attribute14;
3167: END IF;
3168: IF (x_ctcv_rec.attribute15 = OKC_API.G_MISS_CHAR)
3169: THEN
3170: x_ctcv_rec.attribute15 := l_ctcv_rec.attribute15;
3171: END IF;
3172: IF (x_ctcv_rec.created_by = OKC_API.G_MISS_NUM)
3168: IF (x_ctcv_rec.attribute15 = OKC_API.G_MISS_CHAR)
3169: THEN
3170: x_ctcv_rec.attribute15 := l_ctcv_rec.attribute15;
3171: END IF;
3172: IF (x_ctcv_rec.created_by = OKC_API.G_MISS_NUM)
3173: THEN
3174: x_ctcv_rec.created_by := l_ctcv_rec.created_by;
3175: END IF;
3176: IF (x_ctcv_rec.creation_date = OKC_API.G_MISS_DATE)
3172: IF (x_ctcv_rec.created_by = OKC_API.G_MISS_NUM)
3173: THEN
3174: x_ctcv_rec.created_by := l_ctcv_rec.created_by;
3175: END IF;
3176: IF (x_ctcv_rec.creation_date = OKC_API.G_MISS_DATE)
3177: THEN
3178: x_ctcv_rec.creation_date := l_ctcv_rec.creation_date;
3179: END IF;
3180: IF (x_ctcv_rec.last_updated_by = OKC_API.G_MISS_NUM)
3176: IF (x_ctcv_rec.creation_date = OKC_API.G_MISS_DATE)
3177: THEN
3178: x_ctcv_rec.creation_date := l_ctcv_rec.creation_date;
3179: END IF;
3180: IF (x_ctcv_rec.last_updated_by = OKC_API.G_MISS_NUM)
3181: THEN
3182: x_ctcv_rec.last_updated_by := l_ctcv_rec.last_updated_by;
3183: END IF;
3184: IF (x_ctcv_rec.last_update_date = OKC_API.G_MISS_DATE)
3180: IF (x_ctcv_rec.last_updated_by = OKC_API.G_MISS_NUM)
3181: THEN
3182: x_ctcv_rec.last_updated_by := l_ctcv_rec.last_updated_by;
3183: END IF;
3184: IF (x_ctcv_rec.last_update_date = OKC_API.G_MISS_DATE)
3185: THEN
3186: x_ctcv_rec.last_update_date := l_ctcv_rec.last_update_date;
3187: END IF;
3188: IF (x_ctcv_rec.last_update_login = OKC_API.G_MISS_NUM)
3184: IF (x_ctcv_rec.last_update_date = OKC_API.G_MISS_DATE)
3185: THEN
3186: x_ctcv_rec.last_update_date := l_ctcv_rec.last_update_date;
3187: END IF;
3188: IF (x_ctcv_rec.last_update_login = OKC_API.G_MISS_NUM)
3189: THEN
3190: x_ctcv_rec.last_update_login := l_ctcv_rec.last_update_login;
3191: END IF;
3192: IF (x_ctcv_rec.start_date = OKC_API.G_MISS_DATE)
3188: IF (x_ctcv_rec.last_update_login = OKC_API.G_MISS_NUM)
3189: THEN
3190: x_ctcv_rec.last_update_login := l_ctcv_rec.last_update_login;
3191: END IF;
3192: IF (x_ctcv_rec.start_date = OKC_API.G_MISS_DATE)
3193: THEN
3194: x_ctcv_rec.start_date := l_ctcv_rec.start_date;
3195: END IF;
3196: IF (x_ctcv_rec.end_date = OKC_API.G_MISS_DATE)
3192: IF (x_ctcv_rec.start_date = OKC_API.G_MISS_DATE)
3193: THEN
3194: x_ctcv_rec.start_date := l_ctcv_rec.start_date;
3195: END IF;
3196: IF (x_ctcv_rec.end_date = OKC_API.G_MISS_DATE)
3197: THEN
3198: x_ctcv_rec.end_date := l_ctcv_rec.end_date;
3199: END IF;
3200:
3212: FUNCTION Set_Attributes (
3213: p_ctcv_rec IN ctcv_rec_type,
3214: x_ctcv_rec OUT NOCOPY ctcv_rec_type
3215: ) RETURN VARCHAR2 IS
3216: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3217: BEGIN
3218:
3219: x_ctcv_rec := p_ctcv_rec;
3220: x_ctcv_rec.OBJECT_VERSION_NUMBER := NVL(x_ctcv_rec.OBJECT_VERSION_NUMBER, 0) + 1;
3228: okc_debug.Set_Indentation('OKC_CTC_PVT');
3229: okc_debug.log('10200: Entered update_row', 2);
3230: END IF;
3231:
3232: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
3233: G_PKG_NAME,
3234: p_init_msg_list,
3235: l_api_version,
3236: p_api_version,
3235: l_api_version,
3236: p_api_version,
3237: '_PVT',
3238: x_return_status);
3239: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3240: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3241: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3242: RAISE OKC_API.G_EXCEPTION_ERROR;
3243: END IF;
3236: p_api_version,
3237: '_PVT',
3238: x_return_status);
3239: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3240: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3241: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3242: RAISE OKC_API.G_EXCEPTION_ERROR;
3243: END IF;
3244: --- Setting item attributes
3237: '_PVT',
3238: x_return_status);
3239: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3240: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3241: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3242: RAISE OKC_API.G_EXCEPTION_ERROR;
3243: END IF;
3244: --- Setting item attributes
3245: l_return_status := Set_Attributes(
3238: x_return_status);
3239: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3240: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3241: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3242: RAISE OKC_API.G_EXCEPTION_ERROR;
3243: END IF;
3244: --- Setting item attributes
3245: l_return_status := Set_Attributes(
3246: p_ctcv_rec, -- IN
3245: l_return_status := Set_Attributes(
3246: p_ctcv_rec, -- IN
3247: l_ctcv_rec); -- OUT
3248: --- If any errors happen abort API
3249: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3250: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3251: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3252: RAISE OKC_API.G_EXCEPTION_ERROR;
3253: END IF;
3246: p_ctcv_rec, -- IN
3247: l_ctcv_rec); -- OUT
3248: --- If any errors happen abort API
3249: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3250: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3251: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3252: RAISE OKC_API.G_EXCEPTION_ERROR;
3253: END IF;
3254: l_return_status := populate_new_record(l_ctcv_rec, l_def_ctcv_rec);
3247: l_ctcv_rec); -- OUT
3248: --- If any errors happen abort API
3249: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3250: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3251: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3252: RAISE OKC_API.G_EXCEPTION_ERROR;
3253: END IF;
3254: l_return_status := populate_new_record(l_ctcv_rec, l_def_ctcv_rec);
3255: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3248: --- If any errors happen abort API
3249: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3250: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3251: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3252: RAISE OKC_API.G_EXCEPTION_ERROR;
3253: END IF;
3254: l_return_status := populate_new_record(l_ctcv_rec, l_def_ctcv_rec);
3255: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3256: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3251: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3252: RAISE OKC_API.G_EXCEPTION_ERROR;
3253: END IF;
3254: l_return_status := populate_new_record(l_ctcv_rec, l_def_ctcv_rec);
3255: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3256: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3257: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3258: RAISE OKC_API.G_EXCEPTION_ERROR;
3259: END IF;
3252: RAISE OKC_API.G_EXCEPTION_ERROR;
3253: END IF;
3254: l_return_status := populate_new_record(l_ctcv_rec, l_def_ctcv_rec);
3255: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3256: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3257: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3258: RAISE OKC_API.G_EXCEPTION_ERROR;
3259: END IF;
3260: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
3253: END IF;
3254: l_return_status := populate_new_record(l_ctcv_rec, l_def_ctcv_rec);
3255: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3256: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3257: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3258: RAISE OKC_API.G_EXCEPTION_ERROR;
3259: END IF;
3260: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
3261: --- Validate all non-missing attributes (Item Level Validation)
3254: l_return_status := populate_new_record(l_ctcv_rec, l_def_ctcv_rec);
3255: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3256: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3257: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3258: RAISE OKC_API.G_EXCEPTION_ERROR;
3259: END IF;
3260: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
3261: --- Validate all non-missing attributes (Item Level Validation)
3262: l_return_status := Validate_Attributes(l_def_ctcv_rec);
3260: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
3261: --- Validate all non-missing attributes (Item Level Validation)
3262: l_return_status := Validate_Attributes(l_def_ctcv_rec);
3263: --- If any errors happen abort API
3264: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3265: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3266: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3267: RAISE OKC_API.G_EXCEPTION_ERROR;
3268: END IF;
3261: --- Validate all non-missing attributes (Item Level Validation)
3262: l_return_status := Validate_Attributes(l_def_ctcv_rec);
3263: --- If any errors happen abort API
3264: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3265: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3266: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3267: RAISE OKC_API.G_EXCEPTION_ERROR;
3268: END IF;
3269: l_return_status := Validate_Record(l_def_ctcv_rec);
3262: l_return_status := Validate_Attributes(l_def_ctcv_rec);
3263: --- If any errors happen abort API
3264: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3265: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3266: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3267: RAISE OKC_API.G_EXCEPTION_ERROR;
3268: END IF;
3269: l_return_status := Validate_Record(l_def_ctcv_rec);
3270: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3263: --- If any errors happen abort API
3264: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3265: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3266: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3267: RAISE OKC_API.G_EXCEPTION_ERROR;
3268: END IF;
3269: l_return_status := Validate_Record(l_def_ctcv_rec);
3270: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3271: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3266: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3267: RAISE OKC_API.G_EXCEPTION_ERROR;
3268: END IF;
3269: l_return_status := Validate_Record(l_def_ctcv_rec);
3270: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3271: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3272: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3273: RAISE OKC_API.G_EXCEPTION_ERROR;
3274: END IF;
3267: RAISE OKC_API.G_EXCEPTION_ERROR;
3268: END IF;
3269: l_return_status := Validate_Record(l_def_ctcv_rec);
3270: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3271: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3272: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3273: RAISE OKC_API.G_EXCEPTION_ERROR;
3274: END IF;
3275:
3268: END IF;
3269: l_return_status := Validate_Record(l_def_ctcv_rec);
3270: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3271: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3272: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3273: RAISE OKC_API.G_EXCEPTION_ERROR;
3274: END IF;
3275:
3276: --------------------------------------
3269: l_return_status := Validate_Record(l_def_ctcv_rec);
3270: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3271: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3272: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3273: RAISE OKC_API.G_EXCEPTION_ERROR;
3274: END IF;
3275:
3276: --------------------------------------
3277: -- Move VIEW record to "Child" records
3287: x_msg_data,
3288: l_ctc_rec,
3289: lx_ctc_rec
3290: );
3291: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3292: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3293: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3294: RAISE OKC_API.G_EXCEPTION_ERROR;
3295: END IF;
3288: l_ctc_rec,
3289: lx_ctc_rec
3290: );
3291: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3292: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3293: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3294: RAISE OKC_API.G_EXCEPTION_ERROR;
3295: END IF;
3296: migrate(lx_ctc_rec, l_def_ctcv_rec);
3289: lx_ctc_rec
3290: );
3291: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3292: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3293: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3294: RAISE OKC_API.G_EXCEPTION_ERROR;
3295: END IF;
3296: migrate(lx_ctc_rec, l_def_ctcv_rec);
3297: x_ctcv_rec := l_def_ctcv_rec;
3290: );
3291: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3292: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3293: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3294: RAISE OKC_API.G_EXCEPTION_ERROR;
3295: END IF;
3296: migrate(lx_ctc_rec, l_def_ctcv_rec);
3297: x_ctcv_rec := l_def_ctcv_rec;
3298: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3294: RAISE OKC_API.G_EXCEPTION_ERROR;
3295: END IF;
3296: migrate(lx_ctc_rec, l_def_ctcv_rec);
3297: x_ctcv_rec := l_def_ctcv_rec;
3298: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3299:
3300: IF (l_debug = 'Y') THEN
3301: okc_debug.log('10300: Leaving update_row', 2);
3302: okc_debug.Reset_Indentation;
3302: okc_debug.Reset_Indentation;
3303: END IF;
3304:
3305: EXCEPTION
3306: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3307:
3308: IF (l_debug = 'Y') THEN
3309: okc_debug.log('10400: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3310: okc_debug.Reset_Indentation;
3305: EXCEPTION
3306: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3307:
3308: IF (l_debug = 'Y') THEN
3309: okc_debug.log('10400: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3310: okc_debug.Reset_Indentation;
3311: END IF;
3312:
3313: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3309: okc_debug.log('10400: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3310: okc_debug.Reset_Indentation;
3311: END IF;
3312:
3313: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3314: (
3315: l_api_name,
3316: G_PKG_NAME,
3317: 'OKC_API.G_RET_STS_ERROR',
3313: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3314: (
3315: l_api_name,
3316: G_PKG_NAME,
3317: 'OKC_API.G_RET_STS_ERROR',
3318: x_msg_count,
3319: x_msg_data,
3320: '_PVT'
3321: );
3318: x_msg_count,
3319: x_msg_data,
3320: '_PVT'
3321: );
3322: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3323:
3324: IF (l_debug = 'Y') THEN
3325: okc_debug.log('10500: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3326: okc_debug.Reset_Indentation;
3321: );
3322: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3323:
3324: IF (l_debug = 'Y') THEN
3325: okc_debug.log('10500: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3326: okc_debug.Reset_Indentation;
3327: END IF;
3328:
3329: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3325: okc_debug.log('10500: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3326: okc_debug.Reset_Indentation;
3327: END IF;
3328:
3329: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3330: (
3331: l_api_name,
3332: G_PKG_NAME,
3333: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3329: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3330: (
3331: l_api_name,
3332: G_PKG_NAME,
3333: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3334: x_msg_count,
3335: x_msg_data,
3336: '_PVT'
3337: );
3341: okc_debug.log('10600: Exiting update_row:OTHERS Exception', 2);
3342: okc_debug.Reset_Indentation;
3343: END IF;
3344:
3345: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3346: (
3347: l_api_name,
3348: G_PKG_NAME,
3349: 'OTHERS',
3366: x_ctcv_tbl OUT NOCOPY ctcv_tbl_type) IS
3367:
3368: l_api_version CONSTANT NUMBER := 1;
3369: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_update_row';
3370: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3371: i NUMBER := 0;
3372: BEGIN
3373:
3374: IF (l_debug = 'Y') THEN
3375: okc_debug.Set_Indentation('OKC_CTC_PVT');
3376: okc_debug.log('10700: Entered update_row', 2);
3377: END IF;
3378:
3379: OKC_API.init_msg_list(p_init_msg_list);
3380: -- Make sure PL/SQL table has records in it before passing
3381: IF (p_ctcv_tbl.COUNT > 0) THEN
3382: i := p_ctcv_tbl.FIRST;
3383: LOOP
3382: i := p_ctcv_tbl.FIRST;
3383: LOOP
3384: update_row (
3385: p_api_version => p_api_version,
3386: p_init_msg_list => OKC_API.G_FALSE,
3387: x_return_status => x_return_status,
3388: x_msg_count => x_msg_count,
3389: x_msg_data => x_msg_data,
3390: p_ctcv_rec => p_ctcv_tbl(i),
3399: okc_debug.Reset_Indentation;
3400: END IF;
3401:
3402: EXCEPTION
3403: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3404:
3405: IF (l_debug = 'Y') THEN
3406: okc_debug.log('10900: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3407: okc_debug.Reset_Indentation;
3402: EXCEPTION
3403: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3404:
3405: IF (l_debug = 'Y') THEN
3406: okc_debug.log('10900: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3407: okc_debug.Reset_Indentation;
3408: END IF;
3409:
3410: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3406: okc_debug.log('10900: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3407: okc_debug.Reset_Indentation;
3408: END IF;
3409:
3410: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3411: (
3412: l_api_name,
3413: G_PKG_NAME,
3414: 'OKC_API.G_RET_STS_ERROR',
3410: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3411: (
3412: l_api_name,
3413: G_PKG_NAME,
3414: 'OKC_API.G_RET_STS_ERROR',
3415: x_msg_count,
3416: x_msg_data,
3417: '_PVT'
3418: );
3415: x_msg_count,
3416: x_msg_data,
3417: '_PVT'
3418: );
3419: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3420:
3421: IF (l_debug = 'Y') THEN
3422: okc_debug.log('11000: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3423: okc_debug.Reset_Indentation;
3418: );
3419: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3420:
3421: IF (l_debug = 'Y') THEN
3422: okc_debug.log('11000: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3423: okc_debug.Reset_Indentation;
3424: END IF;
3425:
3426: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3422: okc_debug.log('11000: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3423: okc_debug.Reset_Indentation;
3424: END IF;
3425:
3426: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3427: (
3428: l_api_name,
3429: G_PKG_NAME,
3430: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3426: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3427: (
3428: l_api_name,
3429: G_PKG_NAME,
3430: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3431: x_msg_count,
3432: x_msg_data,
3433: '_PVT'
3434: );
3438: okc_debug.log('11100: Exiting update_row:OTHERS Exception', 2);
3439: okc_debug.Reset_Indentation;
3440: END IF;
3441:
3442: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3443: (
3444: l_api_name,
3445: G_PKG_NAME,
3446: 'OTHERS',
3465: p_ctc_rec IN ctc_rec_type) IS
3466:
3467: l_api_version CONSTANT NUMBER := 1;
3468: l_api_name CONSTANT VARCHAR2(30) := 'CONTACTS_delete_row';
3469: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3470: l_ctc_rec ctc_rec_type:= p_ctc_rec;
3471: l_row_notfound BOOLEAN := TRUE;
3472: BEGIN
3473:
3475: okc_debug.Set_Indentation('OKC_CTC_PVT');
3476: okc_debug.log('11200: Entered delete_row', 2);
3477: END IF;
3478:
3479: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
3480: p_init_msg_list,
3481: '_PVT',
3482: x_return_status);
3483: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3479: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
3480: p_init_msg_list,
3481: '_PVT',
3482: x_return_status);
3483: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3484: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3485: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3486: RAISE OKC_API.G_EXCEPTION_ERROR;
3487: END IF;
3480: p_init_msg_list,
3481: '_PVT',
3482: x_return_status);
3483: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3484: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3485: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3486: RAISE OKC_API.G_EXCEPTION_ERROR;
3487: END IF;
3488: DELETE FROM OKC_CONTACTS
3481: '_PVT',
3482: x_return_status);
3483: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3484: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3485: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3486: RAISE OKC_API.G_EXCEPTION_ERROR;
3487: END IF;
3488: DELETE FROM OKC_CONTACTS
3489: WHERE ID = l_ctc_rec.id;
3482: x_return_status);
3483: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3484: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3485: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3486: RAISE OKC_API.G_EXCEPTION_ERROR;
3487: END IF;
3488: DELETE FROM OKC_CONTACTS
3489: WHERE ID = l_ctc_rec.id;
3490:
3487: END IF;
3488: DELETE FROM OKC_CONTACTS
3489: WHERE ID = l_ctc_rec.id;
3490:
3491: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3492:
3493: IF (l_debug = 'Y') THEN
3494: okc_debug.log('11300: Leaving delete_row', 2);
3495: okc_debug.Reset_Indentation;
3495: okc_debug.Reset_Indentation;
3496: END IF;
3497:
3498: EXCEPTION
3499: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3500:
3501: IF (l_debug = 'Y') THEN
3502: okc_debug.log('11400: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3503: okc_debug.Reset_Indentation;
3498: EXCEPTION
3499: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3500:
3501: IF (l_debug = 'Y') THEN
3502: okc_debug.log('11400: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3503: okc_debug.Reset_Indentation;
3504: END IF;
3505:
3506: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3502: okc_debug.log('11400: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3503: okc_debug.Reset_Indentation;
3504: END IF;
3505:
3506: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3507: (
3508: l_api_name,
3509: G_PKG_NAME,
3510: 'OKC_API.G_RET_STS_ERROR',
3506: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3507: (
3508: l_api_name,
3509: G_PKG_NAME,
3510: 'OKC_API.G_RET_STS_ERROR',
3511: x_msg_count,
3512: x_msg_data,
3513: '_PVT'
3514: );
3511: x_msg_count,
3512: x_msg_data,
3513: '_PVT'
3514: );
3515: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3516:
3517: IF (l_debug = 'Y') THEN
3518: okc_debug.log('11500: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3519: okc_debug.Reset_Indentation;
3514: );
3515: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3516:
3517: IF (l_debug = 'Y') THEN
3518: okc_debug.log('11500: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3519: okc_debug.Reset_Indentation;
3520: END IF;
3521:
3522: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3518: okc_debug.log('11500: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3519: okc_debug.Reset_Indentation;
3520: END IF;
3521:
3522: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3523: (
3524: l_api_name,
3525: G_PKG_NAME,
3526: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3522: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3523: (
3524: l_api_name,
3525: G_PKG_NAME,
3526: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3527: x_msg_count,
3528: x_msg_data,
3529: '_PVT'
3530: );
3534: okc_debug.log('11600: Exiting delete_row:OTHERS Exception', 2);
3535: okc_debug.Reset_Indentation;
3536: END IF;
3537:
3538: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3539: (
3540: l_api_name,
3541: G_PKG_NAME,
3542: 'OTHERS',
3558: p_ctcv_rec IN ctcv_rec_type) IS
3559:
3560: l_api_version CONSTANT NUMBER := 1;
3561: l_api_name CONSTANT VARCHAR2(30) := 'V_delete_row';
3562: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3563: l_ctcv_rec ctcv_rec_type := p_ctcv_rec;
3564: l_ctc_rec ctc_rec_type;
3565: BEGIN
3566:
3568: okc_debug.Set_Indentation('OKC_CTC_PVT');
3569: okc_debug.log('11700: Entered delete_row', 2);
3570: END IF;
3571:
3572: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
3573: G_PKG_NAME,
3574: p_init_msg_list,
3575: l_api_version,
3576: p_api_version,
3575: l_api_version,
3576: p_api_version,
3577: '_PVT',
3578: x_return_status);
3579: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3580: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3581: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3582: RAISE OKC_API.G_EXCEPTION_ERROR;
3583: END IF;
3576: p_api_version,
3577: '_PVT',
3578: x_return_status);
3579: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3580: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3581: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3582: RAISE OKC_API.G_EXCEPTION_ERROR;
3583: END IF;
3584: --------------------------------------
3577: '_PVT',
3578: x_return_status);
3579: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3580: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3581: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3582: RAISE OKC_API.G_EXCEPTION_ERROR;
3583: END IF;
3584: --------------------------------------
3585: -- Move VIEW record to "Child" records
3578: x_return_status);
3579: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3580: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3581: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3582: RAISE OKC_API.G_EXCEPTION_ERROR;
3583: END IF;
3584: --------------------------------------
3585: -- Move VIEW record to "Child" records
3586: --------------------------------------
3594: x_msg_count,
3595: x_msg_data,
3596: l_ctc_rec
3597: );
3598: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3599: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3600: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3601: RAISE OKC_API.G_EXCEPTION_ERROR;
3602: END IF;
3595: x_msg_data,
3596: l_ctc_rec
3597: );
3598: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3599: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3600: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3601: RAISE OKC_API.G_EXCEPTION_ERROR;
3602: END IF;
3603: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3596: l_ctc_rec
3597: );
3598: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3599: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3600: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3601: RAISE OKC_API.G_EXCEPTION_ERROR;
3602: END IF;
3603: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3604:
3597: );
3598: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3599: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3600: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3601: RAISE OKC_API.G_EXCEPTION_ERROR;
3602: END IF;
3603: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3604:
3605: IF (l_debug = 'Y') THEN
3599: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3600: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3601: RAISE OKC_API.G_EXCEPTION_ERROR;
3602: END IF;
3603: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3604:
3605: IF (l_debug = 'Y') THEN
3606: okc_debug.log('11800: Leaving delete_row', 2);
3607: okc_debug.Reset_Indentation;
3607: okc_debug.Reset_Indentation;
3608: END IF;
3609:
3610: EXCEPTION
3611: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3612:
3613: IF (l_debug = 'Y') THEN
3614: okc_debug.log('11900: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3615: okc_debug.Reset_Indentation;
3610: EXCEPTION
3611: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3612:
3613: IF (l_debug = 'Y') THEN
3614: okc_debug.log('11900: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3615: okc_debug.Reset_Indentation;
3616: END IF;
3617:
3618: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3614: okc_debug.log('11900: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3615: okc_debug.Reset_Indentation;
3616: END IF;
3617:
3618: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3619: (
3620: l_api_name,
3621: G_PKG_NAME,
3622: 'OKC_API.G_RET_STS_ERROR',
3618: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3619: (
3620: l_api_name,
3621: G_PKG_NAME,
3622: 'OKC_API.G_RET_STS_ERROR',
3623: x_msg_count,
3624: x_msg_data,
3625: '_PVT'
3626: );
3623: x_msg_count,
3624: x_msg_data,
3625: '_PVT'
3626: );
3627: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3628:
3629: IF (l_debug = 'Y') THEN
3630: okc_debug.log('12000: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3631: okc_debug.Reset_Indentation;
3626: );
3627: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3628:
3629: IF (l_debug = 'Y') THEN
3630: okc_debug.log('12000: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3631: okc_debug.Reset_Indentation;
3632: END IF;
3633:
3634: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3630: okc_debug.log('12000: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3631: okc_debug.Reset_Indentation;
3632: END IF;
3633:
3634: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3635: (
3636: l_api_name,
3637: G_PKG_NAME,
3638: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3634: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3635: (
3636: l_api_name,
3637: G_PKG_NAME,
3638: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3639: x_msg_count,
3640: x_msg_data,
3641: '_PVT'
3642: );
3646: okc_debug.log('12100: Exiting delete_row:OTHERS Exception', 2);
3647: okc_debug.Reset_Indentation;
3648: END IF;
3649:
3650: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3651: (
3652: l_api_name,
3653: G_PKG_NAME,
3654: 'OTHERS',
3670: p_ctcv_tbl IN ctcv_tbl_type) IS
3671:
3672: l_api_version CONSTANT NUMBER := 1;
3673: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_delete_row';
3674: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3675: i NUMBER := 0;
3676: BEGIN
3677:
3678: IF (l_debug = 'Y') THEN
3679: okc_debug.Set_Indentation('OKC_CTC_PVT');
3680: okc_debug.log('12200: Entered delete_row', 2);
3681: END IF;
3682:
3683: OKC_API.init_msg_list(p_init_msg_list);
3684: -- Make sure PL/SQL table has records in it before passing
3685: IF (p_ctcv_tbl.COUNT > 0) THEN
3686: i := p_ctcv_tbl.FIRST;
3687: LOOP
3686: i := p_ctcv_tbl.FIRST;
3687: LOOP
3688: delete_row (
3689: p_api_version => p_api_version,
3690: p_init_msg_list => OKC_API.G_FALSE,
3691: x_return_status => x_return_status,
3692: x_msg_count => x_msg_count,
3693: x_msg_data => x_msg_data,
3694: p_ctcv_rec => p_ctcv_tbl(i));
3702: okc_debug.Reset_Indentation;
3703: END IF;
3704:
3705: EXCEPTION
3706: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3707:
3708: IF (l_debug = 'Y') THEN
3709: okc_debug.log('12400: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3710: okc_debug.Reset_Indentation;
3705: EXCEPTION
3706: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3707:
3708: IF (l_debug = 'Y') THEN
3709: okc_debug.log('12400: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3710: okc_debug.Reset_Indentation;
3711: END IF;
3712:
3713: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3709: okc_debug.log('12400: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3710: okc_debug.Reset_Indentation;
3711: END IF;
3712:
3713: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3714: (
3715: l_api_name,
3716: G_PKG_NAME,
3717: 'OKC_API.G_RET_STS_ERROR',
3713: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3714: (
3715: l_api_name,
3716: G_PKG_NAME,
3717: 'OKC_API.G_RET_STS_ERROR',
3718: x_msg_count,
3719: x_msg_data,
3720: '_PVT'
3721: );
3718: x_msg_count,
3719: x_msg_data,
3720: '_PVT'
3721: );
3722: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3723:
3724: IF (l_debug = 'Y') THEN
3725: okc_debug.log('12500: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3726: okc_debug.Reset_Indentation;
3721: );
3722: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3723:
3724: IF (l_debug = 'Y') THEN
3725: okc_debug.log('12500: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3726: okc_debug.Reset_Indentation;
3727: END IF;
3728:
3729: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3725: okc_debug.log('12500: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3726: okc_debug.Reset_Indentation;
3727: END IF;
3728:
3729: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3730: (
3731: l_api_name,
3732: G_PKG_NAME,
3733: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3729: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3730: (
3731: l_api_name,
3732: G_PKG_NAME,
3733: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3734: x_msg_count,
3735: x_msg_data,
3736: '_PVT'
3737: );
3741: okc_debug.log('12600: Exiting delete_row:OTHERS Exception', 2);
3742: okc_debug.Reset_Indentation;
3743: END IF;
3744:
3745: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3746: (
3747: l_api_name,
3748: G_PKG_NAME,
3749: 'OTHERS',
3799: i number;
3800: j number;
3801: BEGIN
3802: -- initialize return status
3803: x_return_status := OKC_API.G_RET_STS_SUCCESS;
3804:
3805: IF (l_debug = 'Y') THEN
3806: okc_debug.Set_Indentation('OKC_CTC_PVT');
3807: okc_debug.log('12700: Entered INSERT_ROW_UPG', 2);
3936:
3937: EXCEPTION
3938: WHEN OTHERS THEN
3939: -- store SQL error message on message stack
3940: OKC_API.SET_MESSAGE(
3941: p_app_name => G_APP_NAME,
3942: p_msg_name => G_UNEXPECTED_ERROR,
3943: p_token1 => G_SQLCODE_TOKEN,
3944: p_token1_value => SQLCODE,
3944: p_token1_value => SQLCODE,
3945: p_token2 => G_SQLERRM_TOKEN,
3946: p_token2_value => SQLERRM);
3947: -- notify caller of an error as UNEXPECTED error
3948: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
3949:
3950:
3951: /*okc_debug.log('12900: Exiting INSERT_ROW_UPG:OTHERS Exception', 2);
3952: IF (l_debug = 'Y') THEN
3966: p_chr_id IN NUMBER,
3967: p_major_version IN NUMBER
3968: ) RETURN VARCHAR2 IS
3969:
3970: l_return_status VARCHAR2(1):= OKC_API.G_RET_STS_SUCCESS;
3971:
3972: BEGIN
3973:
3974: IF (l_debug = 'Y') THEN
4071: okc_debug.Reset_Indentation;
4072: END IF;
4073:
4074: -- store SQL error message on message stack
4075: OKC_API.SET_MESSAGE(p_app_name => okc_version_pvt.G_APP_NAME,
4076: p_msg_name => okc_version_pvt.G_UNEXPECTED_ERROR,
4077: p_token1 => okc_version_pvt.G_SQLCODE_TOKEN,
4078: p_token1_value => sqlcode,
4079: p_token2 => okc_version_pvt.G_SQLERRM_TOKEN,
4079: p_token2 => okc_version_pvt.G_SQLERRM_TOKEN,
4080: p_token2_value => sqlerrm);
4081:
4082: -- notify UNEXPECTED error
4083: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
4084: return l_return_status;
4085:
4086: END create_version;
4087:
4093: p_chr_id IN NUMBER,
4094: p_major_version IN NUMBER
4095: ) RETURN VARCHAR2 IS
4096:
4097: l_return_status VARCHAR2(1):= OKC_API.G_RET_STS_SUCCESS;
4098:
4099: BEGIN
4100:
4101: IF (l_debug = 'Y') THEN
4197: okc_debug.Reset_Indentation;
4198: END IF;
4199:
4200: -- store SQL error message on message stack
4201: OKC_API.SET_MESSAGE(p_app_name => okc_version_pvt.G_APP_NAME,
4202: p_msg_name => okc_version_pvt.G_UNEXPECTED_ERROR,
4203: p_token1 => okc_version_pvt.G_SQLCODE_TOKEN,
4204: p_token1_value => sqlcode,
4205: p_token2 => okc_version_pvt.G_SQLERRM_TOKEN,
4205: p_token2 => okc_version_pvt.G_SQLERRM_TOKEN,
4206: p_token2_value => sqlerrm);
4207:
4208: -- notify UNEXPECTED error
4209: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
4210: return l_return_status;
4211:
4212: END restore_version;
4213: