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
67: okc_debug.Set_Indentation('OKC_CTC_PVT');
68: okc_debug.log('100: Entered update_contact_stecode', 2);
69: END IF;
70:
71: x_return_status := OKC_API.G_RET_STS_SUCCESS;
72:
73: OPEN c_get_contract_status(p_chr_id);
74: FETCH c_get_contract_status INTO l_ste_code;
75: CLOSE c_get_contract_status;
74: FETCH c_get_contract_status INTO l_ste_code;
75: CLOSE c_get_contract_status;
76:
77: IF l_ste_code is null then
78: RAISE OKC_API.G_EXCEPTION_ERROR;
79: END IF;
80:
81: UPDATE OKC_CONTACTS SET dnz_ste_code=l_ste_code WHERE DNZ_CHR_ID=p_chr_id;
82:
85: okc_debug.log('110: Exiting update_contact_stecode', 2);
86: END IF;
87:
88: EXCEPTION
89: WHEN OKC_API.G_EXCEPTION_ERROR THEN
90:
91: IF (l_debug = 'Y') THEN
92: okc_debug.log('120: Exiting update_contact_stecode:OKC_API.G_EXCEPTION_ERROR Exception', 2);
93: okc_debug.Reset_Indentation;
88: EXCEPTION
89: WHEN OKC_API.G_EXCEPTION_ERROR THEN
90:
91: IF (l_debug = 'Y') THEN
92: okc_debug.log('120: Exiting update_contact_stecode:OKC_API.G_EXCEPTION_ERROR Exception', 2);
93: okc_debug.Reset_Indentation;
94: END IF;
95:
96: x_return_status := 'E';
351: okc_debug.Set_Indentation('OKC_CTC_PVT');
352: okc_debug.log('900: Entered null_out_defaults', 2);
353: END IF;
354:
355: IF (l_ctcv_rec.object_version_number = OKC_API.G_MISS_NUM) THEN
356: l_ctcv_rec.object_version_number := NULL;
357: END IF;
358: IF (l_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM) THEN
359: l_ctcv_rec.cpl_id := NULL;
354:
355: IF (l_ctcv_rec.object_version_number = OKC_API.G_MISS_NUM) THEN
356: l_ctcv_rec.object_version_number := NULL;
357: END IF;
358: IF (l_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM) THEN
359: l_ctcv_rec.cpl_id := NULL;
360: END IF;
361: IF (l_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR) THEN
362: l_ctcv_rec.cro_code := NULL;
357: END IF;
358: IF (l_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM) THEN
359: l_ctcv_rec.cpl_id := NULL;
360: END IF;
361: IF (l_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR) THEN
362: l_ctcv_rec.cro_code := NULL;
363: END IF;
364: IF (l_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM) THEN
365: l_ctcv_rec.dnz_chr_id := NULL;
360: END IF;
361: IF (l_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR) THEN
362: l_ctcv_rec.cro_code := NULL;
363: END IF;
364: IF (l_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM) THEN
365: l_ctcv_rec.dnz_chr_id := NULL;
366: END IF;
367: IF (l_ctcv_rec.contact_sequence = OKC_API.G_MISS_NUM) THEN
368: l_ctcv_rec.contact_sequence := NULL;
363: END IF;
364: IF (l_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM) THEN
365: l_ctcv_rec.dnz_chr_id := NULL;
366: END IF;
367: IF (l_ctcv_rec.contact_sequence = OKC_API.G_MISS_NUM) THEN
368: l_ctcv_rec.contact_sequence := NULL;
369: END IF;
370: IF (l_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR) THEN
371: l_ctcv_rec.object1_id1 := NULL;
366: END IF;
367: IF (l_ctcv_rec.contact_sequence = OKC_API.G_MISS_NUM) THEN
368: l_ctcv_rec.contact_sequence := NULL;
369: END IF;
370: IF (l_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR) THEN
371: l_ctcv_rec.object1_id1 := NULL;
372: END IF;
373: IF (l_ctcv_rec.object1_id2 = OKC_API.G_MISS_CHAR) THEN
374: l_ctcv_rec.object1_id2 := NULL;
369: END IF;
370: IF (l_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR) THEN
371: l_ctcv_rec.object1_id1 := NULL;
372: END IF;
373: IF (l_ctcv_rec.object1_id2 = OKC_API.G_MISS_CHAR) THEN
374: l_ctcv_rec.object1_id2 := NULL;
375: END IF;
376: IF (l_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR) THEN
377: l_ctcv_rec.JTOT_OBJECT1_CODE := NULL;
372: END IF;
373: IF (l_ctcv_rec.object1_id2 = OKC_API.G_MISS_CHAR) THEN
374: l_ctcv_rec.object1_id2 := NULL;
375: END IF;
376: IF (l_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR) THEN
377: l_ctcv_rec.JTOT_OBJECT1_CODE := NULL;
378: END IF;
379: IF (l_ctcv_rec.primary_yn = OKC_API.G_MISS_CHAR) THEN
380: l_ctcv_rec.PRIMARY_YN :=NULL;
375: END IF;
376: IF (l_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR) THEN
377: l_ctcv_rec.JTOT_OBJECT1_CODE := NULL;
378: END IF;
379: IF (l_ctcv_rec.primary_yn = OKC_API.G_MISS_CHAR) THEN
380: l_ctcv_rec.PRIMARY_YN :=NULL;
381: END IF;
382: IF (l_ctcv_rec.resource_class = OKC_API.G_MISS_CHAR) THEN
383: l_ctcv_rec.RESOURCE_CLASS :=NULL;
378: END IF;
379: IF (l_ctcv_rec.primary_yn = OKC_API.G_MISS_CHAR) THEN
380: l_ctcv_rec.PRIMARY_YN :=NULL;
381: END IF;
382: IF (l_ctcv_rec.resource_class = OKC_API.G_MISS_CHAR) THEN
383: l_ctcv_rec.RESOURCE_CLASS :=NULL;
384: END IF;
385: IF (l_ctcv_rec.SALES_GROUP_ID = OKC_API.G_MISS_NUM) THEN
386: l_ctcv_rec.SALES_GROUP_ID :=NULL;
381: END IF;
382: IF (l_ctcv_rec.resource_class = OKC_API.G_MISS_CHAR) THEN
383: l_ctcv_rec.RESOURCE_CLASS :=NULL;
384: END IF;
385: IF (l_ctcv_rec.SALES_GROUP_ID = OKC_API.G_MISS_NUM) THEN
386: l_ctcv_rec.SALES_GROUP_ID :=NULL;
387: END IF;
388: IF (l_ctcv_rec.attribute_category = OKC_API.G_MISS_CHAR) THEN
389: l_ctcv_rec.attribute_category := NULL;
384: END IF;
385: IF (l_ctcv_rec.SALES_GROUP_ID = OKC_API.G_MISS_NUM) THEN
386: l_ctcv_rec.SALES_GROUP_ID :=NULL;
387: END IF;
388: IF (l_ctcv_rec.attribute_category = OKC_API.G_MISS_CHAR) THEN
389: l_ctcv_rec.attribute_category := NULL;
390: END IF;
391: IF (l_ctcv_rec.attribute1 = OKC_API.G_MISS_CHAR) THEN
392: l_ctcv_rec.attribute1 := NULL;
387: END IF;
388: IF (l_ctcv_rec.attribute_category = OKC_API.G_MISS_CHAR) THEN
389: l_ctcv_rec.attribute_category := NULL;
390: END IF;
391: IF (l_ctcv_rec.attribute1 = OKC_API.G_MISS_CHAR) THEN
392: l_ctcv_rec.attribute1 := NULL;
393: END IF;
394: IF (l_ctcv_rec.attribute2 = OKC_API.G_MISS_CHAR) THEN
395: l_ctcv_rec.attribute2 := NULL;
390: END IF;
391: IF (l_ctcv_rec.attribute1 = OKC_API.G_MISS_CHAR) THEN
392: l_ctcv_rec.attribute1 := NULL;
393: END IF;
394: IF (l_ctcv_rec.attribute2 = OKC_API.G_MISS_CHAR) THEN
395: l_ctcv_rec.attribute2 := NULL;
396: END IF;
397: IF (l_ctcv_rec.attribute3 = OKC_API.G_MISS_CHAR) THEN
398: l_ctcv_rec.attribute3 := NULL;
393: END IF;
394: IF (l_ctcv_rec.attribute2 = OKC_API.G_MISS_CHAR) THEN
395: l_ctcv_rec.attribute2 := NULL;
396: END IF;
397: IF (l_ctcv_rec.attribute3 = OKC_API.G_MISS_CHAR) THEN
398: l_ctcv_rec.attribute3 := NULL;
399: END IF;
400: IF (l_ctcv_rec.attribute4 = OKC_API.G_MISS_CHAR) THEN
401: l_ctcv_rec.attribute4 := NULL;
396: END IF;
397: IF (l_ctcv_rec.attribute3 = OKC_API.G_MISS_CHAR) THEN
398: l_ctcv_rec.attribute3 := NULL;
399: END IF;
400: IF (l_ctcv_rec.attribute4 = OKC_API.G_MISS_CHAR) THEN
401: l_ctcv_rec.attribute4 := NULL;
402: END IF;
403: IF (l_ctcv_rec.attribute5 = OKC_API.G_MISS_CHAR) THEN
404: l_ctcv_rec.attribute5 := NULL;
399: END IF;
400: IF (l_ctcv_rec.attribute4 = OKC_API.G_MISS_CHAR) THEN
401: l_ctcv_rec.attribute4 := NULL;
402: END IF;
403: IF (l_ctcv_rec.attribute5 = OKC_API.G_MISS_CHAR) THEN
404: l_ctcv_rec.attribute5 := NULL;
405: END IF;
406: IF (l_ctcv_rec.attribute6 = OKC_API.G_MISS_CHAR) THEN
407: l_ctcv_rec.attribute6 := NULL;
402: END IF;
403: IF (l_ctcv_rec.attribute5 = OKC_API.G_MISS_CHAR) THEN
404: l_ctcv_rec.attribute5 := NULL;
405: END IF;
406: IF (l_ctcv_rec.attribute6 = OKC_API.G_MISS_CHAR) THEN
407: l_ctcv_rec.attribute6 := NULL;
408: END IF;
409: IF (l_ctcv_rec.attribute7 = OKC_API.G_MISS_CHAR) THEN
410: l_ctcv_rec.attribute7 := NULL;
405: END IF;
406: IF (l_ctcv_rec.attribute6 = OKC_API.G_MISS_CHAR) THEN
407: l_ctcv_rec.attribute6 := NULL;
408: END IF;
409: IF (l_ctcv_rec.attribute7 = OKC_API.G_MISS_CHAR) THEN
410: l_ctcv_rec.attribute7 := NULL;
411: END IF;
412: IF (l_ctcv_rec.attribute8 = OKC_API.G_MISS_CHAR) THEN
413: l_ctcv_rec.attribute8 := NULL;
408: END IF;
409: IF (l_ctcv_rec.attribute7 = OKC_API.G_MISS_CHAR) THEN
410: l_ctcv_rec.attribute7 := NULL;
411: END IF;
412: IF (l_ctcv_rec.attribute8 = OKC_API.G_MISS_CHAR) THEN
413: l_ctcv_rec.attribute8 := NULL;
414: END IF;
415: IF (l_ctcv_rec.attribute9 = OKC_API.G_MISS_CHAR) THEN
416: l_ctcv_rec.attribute9 := NULL;
411: END IF;
412: IF (l_ctcv_rec.attribute8 = OKC_API.G_MISS_CHAR) THEN
413: l_ctcv_rec.attribute8 := NULL;
414: END IF;
415: IF (l_ctcv_rec.attribute9 = OKC_API.G_MISS_CHAR) THEN
416: l_ctcv_rec.attribute9 := NULL;
417: END IF;
418: IF (l_ctcv_rec.attribute10 = OKC_API.G_MISS_CHAR) THEN
419: l_ctcv_rec.attribute10 := NULL;
414: END IF;
415: IF (l_ctcv_rec.attribute9 = OKC_API.G_MISS_CHAR) THEN
416: l_ctcv_rec.attribute9 := NULL;
417: END IF;
418: IF (l_ctcv_rec.attribute10 = OKC_API.G_MISS_CHAR) THEN
419: l_ctcv_rec.attribute10 := NULL;
420: END IF;
421: IF (l_ctcv_rec.attribute11 = OKC_API.G_MISS_CHAR) THEN
422: l_ctcv_rec.attribute11 := NULL;
417: END IF;
418: IF (l_ctcv_rec.attribute10 = OKC_API.G_MISS_CHAR) THEN
419: l_ctcv_rec.attribute10 := NULL;
420: END IF;
421: IF (l_ctcv_rec.attribute11 = OKC_API.G_MISS_CHAR) THEN
422: l_ctcv_rec.attribute11 := NULL;
423: END IF;
424: IF (l_ctcv_rec.attribute12 = OKC_API.G_MISS_CHAR) THEN
425: l_ctcv_rec.attribute12 := NULL;
420: END IF;
421: IF (l_ctcv_rec.attribute11 = OKC_API.G_MISS_CHAR) THEN
422: l_ctcv_rec.attribute11 := NULL;
423: END IF;
424: IF (l_ctcv_rec.attribute12 = OKC_API.G_MISS_CHAR) THEN
425: l_ctcv_rec.attribute12 := NULL;
426: END IF;
427: IF (l_ctcv_rec.attribute13 = OKC_API.G_MISS_CHAR) THEN
428: l_ctcv_rec.attribute13 := NULL;
423: END IF;
424: IF (l_ctcv_rec.attribute12 = OKC_API.G_MISS_CHAR) THEN
425: l_ctcv_rec.attribute12 := NULL;
426: END IF;
427: IF (l_ctcv_rec.attribute13 = OKC_API.G_MISS_CHAR) THEN
428: l_ctcv_rec.attribute13 := NULL;
429: END IF;
430: IF (l_ctcv_rec.attribute14 = OKC_API.G_MISS_CHAR) THEN
431: l_ctcv_rec.attribute14 := NULL;
426: END IF;
427: IF (l_ctcv_rec.attribute13 = OKC_API.G_MISS_CHAR) THEN
428: l_ctcv_rec.attribute13 := NULL;
429: END IF;
430: IF (l_ctcv_rec.attribute14 = OKC_API.G_MISS_CHAR) THEN
431: l_ctcv_rec.attribute14 := NULL;
432: END IF;
433: IF (l_ctcv_rec.attribute15 = OKC_API.G_MISS_CHAR) THEN
434: l_ctcv_rec.attribute15 := NULL;
429: END IF;
430: IF (l_ctcv_rec.attribute14 = OKC_API.G_MISS_CHAR) THEN
431: l_ctcv_rec.attribute14 := NULL;
432: END IF;
433: IF (l_ctcv_rec.attribute15 = OKC_API.G_MISS_CHAR) THEN
434: l_ctcv_rec.attribute15 := NULL;
435: END IF;
436: IF (l_ctcv_rec.created_by = OKC_API.G_MISS_NUM) THEN
437: l_ctcv_rec.created_by := NULL;
432: END IF;
433: IF (l_ctcv_rec.attribute15 = OKC_API.G_MISS_CHAR) THEN
434: l_ctcv_rec.attribute15 := NULL;
435: END IF;
436: IF (l_ctcv_rec.created_by = OKC_API.G_MISS_NUM) THEN
437: l_ctcv_rec.created_by := NULL;
438: END IF;
439: IF (l_ctcv_rec.creation_date = OKC_API.G_MISS_DATE) THEN
440: l_ctcv_rec.creation_date := NULL;
435: END IF;
436: IF (l_ctcv_rec.created_by = OKC_API.G_MISS_NUM) THEN
437: l_ctcv_rec.created_by := NULL;
438: END IF;
439: IF (l_ctcv_rec.creation_date = OKC_API.G_MISS_DATE) THEN
440: l_ctcv_rec.creation_date := NULL;
441: END IF;
442: IF (l_ctcv_rec.last_updated_by = OKC_API.G_MISS_NUM) THEN
443: l_ctcv_rec.last_updated_by := NULL;
438: END IF;
439: IF (l_ctcv_rec.creation_date = OKC_API.G_MISS_DATE) THEN
440: l_ctcv_rec.creation_date := NULL;
441: END IF;
442: IF (l_ctcv_rec.last_updated_by = OKC_API.G_MISS_NUM) THEN
443: l_ctcv_rec.last_updated_by := NULL;
444: END IF;
445: IF (l_ctcv_rec.last_update_date = OKC_API.G_MISS_DATE) THEN
446: l_ctcv_rec.last_update_date := NULL;
441: END IF;
442: IF (l_ctcv_rec.last_updated_by = OKC_API.G_MISS_NUM) THEN
443: l_ctcv_rec.last_updated_by := NULL;
444: END IF;
445: IF (l_ctcv_rec.last_update_date = OKC_API.G_MISS_DATE) THEN
446: l_ctcv_rec.last_update_date := NULL;
447: END IF;
448: IF (l_ctcv_rec.last_update_login = OKC_API.G_MISS_NUM) THEN
449: l_ctcv_rec.last_update_login := NULL;
444: END IF;
445: IF (l_ctcv_rec.last_update_date = OKC_API.G_MISS_DATE) THEN
446: l_ctcv_rec.last_update_date := NULL;
447: END IF;
448: IF (l_ctcv_rec.last_update_login = OKC_API.G_MISS_NUM) THEN
449: l_ctcv_rec.last_update_login := NULL;
450: END IF;
451: IF (l_ctcv_rec.start_date = OKC_API.G_MISS_DATE) THEN
452: l_ctcv_rec.start_date := NULL;
447: END IF;
448: IF (l_ctcv_rec.last_update_login = OKC_API.G_MISS_NUM) THEN
449: l_ctcv_rec.last_update_login := NULL;
450: END IF;
451: IF (l_ctcv_rec.start_date = OKC_API.G_MISS_DATE) THEN
452: l_ctcv_rec.start_date := NULL;
453: END IF;
454: IF (l_ctcv_rec.end_date = OKC_API.G_MISS_DATE) THEN
455: l_ctcv_rec.end_date := NULL;
450: END IF;
451: IF (l_ctcv_rec.start_date = OKC_API.G_MISS_DATE) THEN
452: l_ctcv_rec.start_date := NULL;
453: END IF;
454: IF (l_ctcv_rec.end_date = OKC_API.G_MISS_DATE) THEN
455: l_ctcv_rec.end_date := NULL;
456: END IF;
457:
458: IF (l_debug = 'Y') THEN
490: okc_debug.Set_Indentation('OKC_CTC_PVT');
491: okc_debug.log('1000: Entered validate_cpl_id', 2);
492: END IF;
493:
494: x_return_status := OKC_API.G_RET_STS_SUCCESS;
495: if (p_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM) then
496: return;
497: end if;
498: if (p_ctcv_rec.cpl_id is NULL) then
491: okc_debug.log('1000: Entered validate_cpl_id', 2);
492: END IF;
493:
494: x_return_status := OKC_API.G_RET_STS_SUCCESS;
495: if (p_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM) then
496: return;
497: end if;
498: if (p_ctcv_rec.cpl_id is NULL) then
499: OKC_API.set_message(p_app_name => g_app_name,
495: if (p_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM) then
496: return;
497: end if;
498: if (p_ctcv_rec.cpl_id is NULL) then
499: OKC_API.set_message(p_app_name => g_app_name,
500: p_msg_name => G_REQUIRED_VALUE,
501: p_token1 => G_COL_NAME_TOKEN,
502: p_token1_value => 'CPL_ID');
503: raise G_EXCEPTION_HALT_VALIDATION;
505: open l_cpl_csr;
506: fetch l_cpl_csr into l_dummy_var;
507: close l_cpl_csr;
508: if (l_dummy_var = '?') then
509: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'CPL_ID');
510: raise G_EXCEPTION_HALT_VALIDATION;
511: end if;
512:
513: IF (l_debug = 'Y') THEN
522: okc_debug.log('1200: Exiting validate_cpl_id:G_EXCEPTION_HALT_VALIDATION Exception', 2);
523: okc_debug.Reset_Indentation;
524: END IF;
525:
526: x_return_status := OKC_API.G_RET_STS_ERROR;
527: when OTHERS then
528:
529: IF (l_debug = 'Y') THEN
530: okc_debug.log('1300: Exiting validate_cpl_id:OTHERS Exception', 2);
533:
534: if l_cpl_csr%ISOPEN then
535: close l_cpl_csr;
536: end if;
537: OKC_API.set_message(p_app_name => g_app_name,
538: p_msg_name => g_unexpected_error,
539: p_token1 => g_sqlcode_token,
540: p_token1_value => sqlcode,
541: p_token2 => g_sqlerrm_token,
539: p_token1 => g_sqlcode_token,
540: p_token1_value => sqlcode,
541: p_token2 => g_sqlerrm_token,
542: p_token2_value => sqlerrm);
543: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
544:
545: end validate_cpl_id;
546:
547: -- Start of comments
563: okc_debug.Set_Indentation('OKC_CTC_PVT');
564: okc_debug.log('1400: Entered validate_cro_code', 2);
565: END IF;
566:
567: x_return_status := OKC_API.G_RET_STS_SUCCESS;
568: if (p_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR) then
569: return;
570: end if;
571: if (p_ctcv_rec.cro_code is NULL) then
564: okc_debug.log('1400: Entered validate_cro_code', 2);
565: END IF;
566:
567: x_return_status := OKC_API.G_RET_STS_SUCCESS;
568: if (p_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR) then
569: return;
570: end if;
571: if (p_ctcv_rec.cro_code is NULL) then
572: OKC_API.set_message(p_app_name => g_app_name,
568: if (p_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR) then
569: return;
570: end if;
571: if (p_ctcv_rec.cro_code is NULL) then
572: OKC_API.set_message(p_app_name => g_app_name,
573: p_msg_name => G_REQUIRED_VALUE,
574: p_token1 => G_COL_NAME_TOKEN,
575: p_token1_value => 'CRO_CODE');
576: raise G_EXCEPTION_HALT_VALIDATION;
577: end if;
578:
579: --
580: x_return_status := OKC_UTIL.check_lookup_code('OKC_CONTACT_ROLE',p_ctcv_rec.cro_code);
581: if (x_return_status <> OKC_API.G_RET_STS_SUCCESS) then
582: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'CRO_CODE');
583: x_return_status := OKC_API.G_RET_STS_ERROR;
584: end if;
585: IF (l_debug = 'Y') THEN
578:
579: --
580: x_return_status := OKC_UTIL.check_lookup_code('OKC_CONTACT_ROLE',p_ctcv_rec.cro_code);
581: if (x_return_status <> OKC_API.G_RET_STS_SUCCESS) then
582: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'CRO_CODE');
583: x_return_status := OKC_API.G_RET_STS_ERROR;
584: end if;
585: IF (l_debug = 'Y') THEN
586: okc_debug.log('1500: Leaving validate_cro_code', 2);
579: --
580: x_return_status := OKC_UTIL.check_lookup_code('OKC_CONTACT_ROLE',p_ctcv_rec.cro_code);
581: if (x_return_status <> OKC_API.G_RET_STS_SUCCESS) then
582: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'CRO_CODE');
583: x_return_status := OKC_API.G_RET_STS_ERROR;
584: end if;
585: IF (l_debug = 'Y') THEN
586: okc_debug.log('1500: Leaving validate_cro_code', 2);
587: okc_debug.Reset_Indentation;
594: okc_debug.log('1600: Exiting validate_cro_code:G_EXCEPTION_HALT_VALIDATION Exception', 2);
595: okc_debug.Reset_Indentation;
596: END IF;
597:
598: x_return_status := OKC_API.G_RET_STS_ERROR;
599: when OTHERS then
600:
601: IF (l_debug = 'Y') THEN
602: okc_debug.log('1700: Exiting validate_cro_code:OTHERS Exception', 2);
602: okc_debug.log('1700: Exiting validate_cro_code:OTHERS Exception', 2);
603: okc_debug.Reset_Indentation;
604: END IF;
605:
606: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
607: p_msg_name => g_unexpected_error,
608: p_token1 => g_sqlcode_token,
609: p_token1_value => sqlcode,
610: p_token2 => g_sqlerrm_token,
608: p_token1 => g_sqlcode_token,
609: p_token1_value => sqlcode,
610: p_token2 => g_sqlerrm_token,
611: p_token2_value => sqlerrm);
612: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
613:
614: end validate_cro_code;
615:
616: -- Start of comments
648: okc_debug.Set_Indentation('OKC_CTC_PVT');
649: okc_debug.log('1800: Entered validate_JTOT_OBJECT1_CODE', 2);
650: END IF;
651:
652: x_return_status := OKC_API.G_RET_STS_SUCCESS;
653: if (p_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR or p_ctcv_rec.jtot_object1_code is NULL) then
654: return;
655: end if;
656: --
649: okc_debug.log('1800: Entered validate_JTOT_OBJECT1_CODE', 2);
650: END IF;
651:
652: x_return_status := OKC_API.G_RET_STS_SUCCESS;
653: if (p_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR or p_ctcv_rec.jtot_object1_code is NULL) then
654: return;
655: end if;
656: --
657: open l_object1_csr;
657: open l_object1_csr;
658: fetch l_object1_csr into l_dummy_var;
659: close l_object1_csr;
660: if (l_dummy_var = '?') then
661: OKC_API.set_message(G_APP_NAME,G_INVALID_VALUE,G_COL_NAME_TOKEN,'JTOT_OBJECT1_CODE');
662: x_return_status := OKC_API.G_RET_STS_ERROR;
663: end if;
664:
665: IF (l_debug = 'Y') THEN
658: fetch l_object1_csr into l_dummy_var;
659: close l_object1_csr;
660: if (l_dummy_var = '?') then
661: OKC_API.set_message(G_APP_NAME,G_INVALID_VALUE,G_COL_NAME_TOKEN,'JTOT_OBJECT1_CODE');
662: x_return_status := OKC_API.G_RET_STS_ERROR;
663: end if;
664:
665: IF (l_debug = 'Y') THEN
666: okc_debug.log('1900: Leaving validate_JTOT_OBJECT1_CODE', 2);
677:
678: if l_object1_csr%ISOPEN then
679: close l_object1_csr;
680: end if;
681: OKC_API.set_message(p_app_name => g_app_name,
682: p_msg_name => g_unexpected_error,
683: p_token1 => g_sqlcode_token,
684: p_token1_value => sqlcode,
685: p_token2 => g_sqlerrm_token,
683: p_token1 => g_sqlcode_token,
684: p_token1_value => sqlcode,
685: p_token2 => g_sqlerrm_token,
686: p_token2_value => sqlerrm);
687: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
688:
689: end validate_JTOT_OBJECT1_CODE;
690:
691: -- Start of comments
888: okc_debug.Set_Indentation('OKC_CTC_PVT');
889: okc_debug.log('2100: Entered validate_object1_id1', 2);
890: END IF;
891:
892: x_return_status := OKC_API.G_RET_STS_SUCCESS;
893: if (p_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR or p_ctcv_rec.JTOT_OBJECT1_CODE is NULL) then
894: return;
895: end if;
896: if (p_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR or p_ctcv_rec.object1_id1 is NULL) then
889: okc_debug.log('2100: Entered validate_object1_id1', 2);
890: END IF;
891:
892: x_return_status := OKC_API.G_RET_STS_SUCCESS;
893: if (p_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR or p_ctcv_rec.JTOT_OBJECT1_CODE is NULL) then
894: return;
895: end if;
896: if (p_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR or p_ctcv_rec.object1_id1 is NULL) then
897: return;
892: x_return_status := OKC_API.G_RET_STS_SUCCESS;
893: if (p_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR or p_ctcv_rec.JTOT_OBJECT1_CODE is NULL) then
894: return;
895: end if;
896: if (p_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR or p_ctcv_rec.object1_id1 is NULL) then
897: return;
898: end if;
899: open l_object1_csr;
900: fetch l_object1_csr into l_from_table, l_where_clause;
932: okc_debug.log('2400: Exiting validate_object1_id1:e_column_not_exists Exception', 2);
933: okc_debug.Reset_Indentation;
934: END IF;
935:
936: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2');
937: x_return_status := OKC_API.G_RET_STS_ERROR;
938: return;
939: when e_too_many_rows then
940:
933: okc_debug.Reset_Indentation;
934: END IF;
935:
936: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2');
937: x_return_status := OKC_API.G_RET_STS_ERROR;
938: return;
939: when e_too_many_rows then
940:
941: IF (l_debug = 'Y') THEN
942: okc_debug.log('2500: Exiting validate_object1_id1:e_too_many_rows Exception', 2);
943: okc_debug.Reset_Indentation;
944: END IF;
945:
946: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2');
947: x_return_status := OKC_API.G_RET_STS_ERROR;
948: return;
949: end;
950: else
943: okc_debug.Reset_Indentation;
944: END IF;
945:
946: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2');
947: x_return_status := OKC_API.G_RET_STS_ERROR;
948: return;
949: end;
950: else
951: begin
985: okc_debug.log('2800: Exiting validate_object1_id1:e_column_not_exists Exception', 2);
986: okc_debug.Reset_Indentation;
987: END IF;
988:
989: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2, .PARTY_ID, .PARTY_ID2');
990: x_return_status := OKC_API.G_RET_STS_ERROR;
991: return;
992: when e_too_many_rows then
993:
986: okc_debug.Reset_Indentation;
987: END IF;
988:
989: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2, .PARTY_ID, .PARTY_ID2');
990: x_return_status := OKC_API.G_RET_STS_ERROR;
991: return;
992: when e_too_many_rows then
993:
994: IF (l_debug = 'Y') THEN
995: okc_debug.log('2900: Exiting validate_object1_id1:e_too_many_rows Exception', 2);
996: okc_debug.Reset_Indentation;
997: END IF;
998:
999: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2, .PARTY_ID, .PARTY_ID2');
1000: x_return_status := OKC_API.G_RET_STS_ERROR;
1001: return;
1002: end;
1003: end if;
996: okc_debug.Reset_Indentation;
997: END IF;
998:
999: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,l_from_table||'.ID1, .ID2, .PARTY_ID, .PARTY_ID2');
1000: x_return_status := OKC_API.G_RET_STS_ERROR;
1001: return;
1002: end;
1003: end if;
1004: --
1014: okc_debug.log('3100: Exiting validate_object1_id1:e_source_not_exists Exception', 2);
1015: okc_debug.Reset_Indentation;
1016: END IF;
1017:
1018: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'JTOT_OBJECT1_CODE');
1019: x_return_status := OKC_API.G_RET_STS_ERROR;
1020: when e_source_not_exists1 then
1021:
1022: IF (l_debug = 'Y') THEN
1015: okc_debug.Reset_Indentation;
1016: END IF;
1017:
1018: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'JTOT_OBJECT1_CODE');
1019: x_return_status := OKC_API.G_RET_STS_ERROR;
1020: when e_source_not_exists1 then
1021:
1022: IF (l_debug = 'Y') THEN
1023: okc_debug.log('3200: Exiting validate_object1_id1:e_source_not_exists1 Exception', 2);
1023: okc_debug.log('3200: Exiting validate_object1_id1:e_source_not_exists1 Exception', 2);
1024: okc_debug.Reset_Indentation;
1025: END IF;
1026:
1027: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'JTOT_OBJECT1_CODE');
1028: x_return_status := OKC_API.G_RET_STS_ERROR;
1029: when e_no_data_found then
1030:
1031: IF (l_debug = 'Y') THEN
1024: okc_debug.Reset_Indentation;
1025: END IF;
1026:
1027: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'JTOT_OBJECT1_CODE');
1028: x_return_status := OKC_API.G_RET_STS_ERROR;
1029: when e_no_data_found then
1030:
1031: IF (l_debug = 'Y') THEN
1032: okc_debug.log('3300: Exiting validate_object1_id1:e_no_data_found Exception', 2);
1032: okc_debug.log('3300: Exiting validate_object1_id1:e_no_data_found Exception', 2);
1033: okc_debug.Reset_Indentation;
1034: END IF;
1035:
1036: OKC_API.set_message(G_APP_NAME,'OKC_INVALID_CONTACT');
1037: x_return_status := OKC_API.G_RET_STS_ERROR;
1038: when OTHERS then
1039:
1040: IF (l_debug = 'Y') THEN
1033: okc_debug.Reset_Indentation;
1034: END IF;
1035:
1036: OKC_API.set_message(G_APP_NAME,'OKC_INVALID_CONTACT');
1037: x_return_status := OKC_API.G_RET_STS_ERROR;
1038: when OTHERS then
1039:
1040: IF (l_debug = 'Y') THEN
1041: okc_debug.log('3400: Exiting validate_object1_id1:OTHERS Exception', 2);
1047: end if;
1048: if l2_object1_csr%ISOPEN then
1049: close l2_object1_csr;
1050: end if;
1051: OKC_API.set_message(p_app_name => g_app_name,
1052: p_msg_name => g_unexpected_error,
1053: p_token1 => g_sqlcode_token,
1054: p_token1_value => sqlcode,
1055: p_token2 => g_sqlerrm_token,
1053: p_token1 => g_sqlcode_token,
1054: p_token1_value => sqlcode,
1055: p_token2 => g_sqlerrm_token,
1056: p_token2_value => sqlerrm);
1057: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1058:
1059: end validate_object1_id1;
1060:
1061: -- Start of comments
1080: okc_debug.Set_Indentation('OKC_CTC_PVT');
1081: okc_debug.log('3500: Entered validate_dnz_chr_id', 2);
1082: END IF;
1083:
1084: x_return_status := OKC_API.G_RET_STS_SUCCESS;
1085: if (p_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM) then
1086: return;
1087: end if;
1088: if (p_ctcv_rec.dnz_chr_id is NULL) then
1081: okc_debug.log('3500: Entered validate_dnz_chr_id', 2);
1082: END IF;
1083:
1084: x_return_status := OKC_API.G_RET_STS_SUCCESS;
1085: if (p_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM) then
1086: return;
1087: end if;
1088: if (p_ctcv_rec.dnz_chr_id is NULL) then
1089: OKC_API.set_message(p_app_name => g_app_name,
1085: if (p_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM) then
1086: return;
1087: end if;
1088: if (p_ctcv_rec.dnz_chr_id is NULL) then
1089: OKC_API.set_message(p_app_name => g_app_name,
1090: p_msg_name => G_REQUIRED_VALUE,
1091: p_token1 => G_COL_NAME_TOKEN,
1092: p_token1_value => 'DNZ_CHR_ID');
1093: x_return_status := OKC_API.G_RET_STS_ERROR;
1089: OKC_API.set_message(p_app_name => g_app_name,
1090: p_msg_name => G_REQUIRED_VALUE,
1091: p_token1 => G_COL_NAME_TOKEN,
1092: p_token1_value => 'DNZ_CHR_ID');
1093: x_return_status := OKC_API.G_RET_STS_ERROR;
1094: return;
1095: end if;
1096: open Kt_Hr_Mj_Vr;
1097: fetch Kt_Hr_Mj_Vr into l_dummy;
1096: open Kt_Hr_Mj_Vr;
1097: fetch Kt_Hr_Mj_Vr into l_dummy;
1098: close Kt_Hr_Mj_Vr;
1099: if (l_dummy='?') then
1100: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'DNZ_CHR_ID');
1101: x_return_status := OKC_API.G_RET_STS_ERROR;
1102: return;
1103: end if;
1104:
1097: fetch Kt_Hr_Mj_Vr into l_dummy;
1098: close Kt_Hr_Mj_Vr;
1099: if (l_dummy='?') then
1100: OKC_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'DNZ_CHR_ID');
1101: x_return_status := OKC_API.G_RET_STS_ERROR;
1102: return;
1103: end if;
1104:
1105: IF (l_debug = 'Y') THEN
1114: okc_debug.log('3700: Exiting validate_dnz_chr_id:OTHERS Exception', 2);
1115: okc_debug.Reset_Indentation;
1116: END IF;
1117:
1118: OKC_API.set_message(p_app_name => g_app_name,
1119: p_msg_name => g_unexpected_error,
1120: p_token1 => g_sqlcode_token,
1121: p_token1_value => sqlcode,
1122: p_token2 => g_sqlerrm_token,
1120: p_token1 => g_sqlcode_token,
1121: p_token1_value => sqlcode,
1122: p_token2 => g_sqlerrm_token,
1123: p_token2_value => sqlerrm);
1124: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1125:
1126: end validate_dnz_chr_id;
1127:
1128: -- Start of comments
1157: okc_debug.log('4150: Entered validate_primary_yn', 2);
1158: END IF;
1159:
1160: -- initialize return status
1161: x_return_status := OKC_API.G_RET_STS_SUCCESS;
1162:
1163: -- check that data exists
1164: IF (p_ctcv_rec.primary_yn IS NOT NULL AND
1165: p_ctcv_rec.primary_yn <> OKC_API.G_MISS_CHAR) THEN
1161: x_return_status := OKC_API.G_RET_STS_SUCCESS;
1162:
1163: -- check that data exists
1164: IF (p_ctcv_rec.primary_yn IS NOT NULL AND
1165: p_ctcv_rec.primary_yn <> OKC_API.G_MISS_CHAR) THEN
1166:
1167: IF p_ctcv_rec.primary_yn NOT IN ('Y','N') Then
1168: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
1169: p_msg_name => g_invalid_value,
1164: IF (p_ctcv_rec.primary_yn IS NOT NULL AND
1165: p_ctcv_rec.primary_yn <> OKC_API.G_MISS_CHAR) THEN
1166:
1167: IF p_ctcv_rec.primary_yn NOT IN ('Y','N') Then
1168: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
1169: p_msg_name => g_invalid_value,
1170: p_token1 => g_col_name_token,
1171: p_token1_value => 'PRIMARY_YN');
1172: -- notify caller of an error
1169: p_msg_name => g_invalid_value,
1170: p_token1 => g_col_name_token,
1171: p_token1_value => 'PRIMARY_YN');
1172: -- notify caller of an error
1173: x_return_status := OKC_API.G_RET_STS_ERROR;
1174: -- halt validation
1175: raise G_EXCEPTION_HALT_VALIDATION;
1176: END IF;
1177: END IF; -- end of (p_ctcv_rec.primary_yn <> OKC_API.G_MISS_CHAR OR ---
1173: x_return_status := OKC_API.G_RET_STS_ERROR;
1174: -- halt validation
1175: raise G_EXCEPTION_HALT_VALIDATION;
1176: END IF;
1177: END IF; -- end of (p_ctcv_rec.primary_yn <> OKC_API.G_MISS_CHAR OR ---
1178:
1179: IF (p_ctcv_rec.primary_yn = 'Y') THEN
1180: --- (p_ctcv_rec.end_date >= trunc(SYSDATE)) THEN ---Bug#2284573
1181: -----(SYSDATE between p_ctcv_rec.start_date AND p_ctcv_rec.end_date) THEN ---Bug#2284573
1182: OPEN l_contacts_csr;
1183: FETCH l_contacts_csr INTO l_dummy;
1184: CLOSE l_contacts_csr;
1185: IF (l_dummy='!') THEN
1186: OKC_API.set_message(G_APP_NAME,'OKC_PRIMARY_CONTACT_ERROR');
1187: x_return_status := OKC_API.G_RET_STS_ERROR;
1188: IF (l_debug = 'Y') THEN
1189: okc_debug.Reset_Indentation;
1190: END IF;
1183: FETCH l_contacts_csr INTO l_dummy;
1184: CLOSE l_contacts_csr;
1185: IF (l_dummy='!') THEN
1186: OKC_API.set_message(G_APP_NAME,'OKC_PRIMARY_CONTACT_ERROR');
1187: x_return_status := OKC_API.G_RET_STS_ERROR;
1188: IF (l_debug = 'Y') THEN
1189: okc_debug.Reset_Indentation;
1190: END IF;
1191: RETURN;
1211: okc_debug.Reset_Indentation;
1212: END IF;
1213:
1214: -- store SQL error message on message stack
1215: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
1216: p_msg_name => g_unexpected_error,
1217: p_token1 => g_sqlcode_token,
1218: p_token1_value => sqlcode,
1219: p_token2 => g_sqlerrm_token,
1219: p_token2 => g_sqlerrm_token,
1220: p_token2_value => sqlerrm);
1221:
1222: -- notify caller of an error as UNEXPETED error
1223: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1224:
1225: End validate_primary_yn;
1226:
1227:
1242: okc_debug.log('4250: Entered validate_resource_class', 2);
1243: END IF;
1244:
1245: -- initialize return status
1246: x_return_status := OKC_API.G_RET_STS_SUCCESS;
1247:
1248: -- check that data exists
1249: IF (p_ctcv_rec.resource_class IS NOT NULL AND
1250: p_ctcv_rec.resource_class <> OKC_API.G_MISS_CHAR) THEN
1246: x_return_status := OKC_API.G_RET_STS_SUCCESS;
1247:
1248: -- check that data exists
1249: IF (p_ctcv_rec.resource_class IS NOT NULL AND
1250: p_ctcv_rec.resource_class <> OKC_API.G_MISS_CHAR) THEN
1251:
1252: -- Check If the value is a valid code from lookup table
1253: x_return_status := OKC_UTIL.check_lookup_code('OKS_RESOURCE_CLASS',
1254: p_ctcv_rec.resource_class);
1252: -- Check If the value is a valid code from lookup table
1253: x_return_status := OKC_UTIL.check_lookup_code('OKS_RESOURCE_CLASS',
1254: p_ctcv_rec.resource_class);
1255:
1256: If (x_return_status = OKC_API.G_RET_STS_ERROR) Then
1257: --set error message in message stack
1258: OKC_API.SET_MESSAGE(
1259: p_app_name => G_APP_NAME,
1260: p_msg_name => G_INVALID_VALUE,
1254: p_ctcv_rec.resource_class);
1255:
1256: If (x_return_status = OKC_API.G_RET_STS_ERROR) Then
1257: --set error message in message stack
1258: OKC_API.SET_MESSAGE(
1259: p_app_name => G_APP_NAME,
1260: p_msg_name => G_INVALID_VALUE,
1261: p_token1 => G_COL_NAME_TOKEN,
1262: p_token1_value => 'RESOURCE_CLASS');
1261: p_token1 => G_COL_NAME_TOKEN,
1262: p_token1_value => 'RESOURCE_CLASS');
1263:
1264: RAISE G_EXCEPTION_HALT_VALIDATION;
1265: Elsif (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1266: raise G_EXCEPTION_HALT_VALIDATION;
1267: End If;
1268: End If;
1269: IF (l_debug = 'Y') THEN
1279: okc_debug.Reset_Indentation;
1280: END IF;
1281:
1282: -- store SQL error message on message stack
1283: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
1284: p_msg_name => g_unexpected_error,
1285: p_token1 => g_sqlcode_token,
1286: p_token2 => g_sqlerrm_token,
1287: p_token2_value => sqlerrm);
1286: p_token2 => g_sqlerrm_token,
1287: p_token2_value => sqlerrm);
1288:
1289: -- notify caller of an error as UNEXPETED error
1290: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1291:
1292: End validate_resource_class;
1293:
1294: /*+++++++++++++End of hand code +++++++++++++++++++*/
1297: --------------------------------------------
1298: FUNCTION Validate_Attributes (
1299: p_ctcv_rec IN ctcv_rec_type
1300: ) RETURN VARCHAR2 IS
1301: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1302:
1303: /*+++++++++++++Start of hand code +++++++++++++++++*/
1304: x_return_status varchar2(1) := OKC_API.G_RET_STS_SUCCESS;
1305: BEGIN
1300: ) RETURN VARCHAR2 IS
1301: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1302:
1303: /*+++++++++++++Start of hand code +++++++++++++++++*/
1304: x_return_status varchar2(1) := OKC_API.G_RET_STS_SUCCESS;
1305: BEGIN
1306:
1307: IF (l_debug = 'Y') THEN
1308: okc_debug.Set_Indentation('OKC_CTC_PVT');
1311:
1312: -- call each column-level validation
1313: validate_cpl_id(x_return_status => l_return_status,
1314: p_ctcv_rec => p_ctcv_rec);
1315: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1316: return OKC_API.G_RET_STS_UNEXP_ERROR;
1317: end if;
1318: if (l_return_status = OKC_API.G_RET_STS_ERROR
1319: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1312: -- call each column-level validation
1313: validate_cpl_id(x_return_status => l_return_status,
1314: p_ctcv_rec => p_ctcv_rec);
1315: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1316: return OKC_API.G_RET_STS_UNEXP_ERROR;
1317: end if;
1318: if (l_return_status = OKC_API.G_RET_STS_ERROR
1319: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1320: x_return_status := OKC_API.G_RET_STS_ERROR;
1314: p_ctcv_rec => p_ctcv_rec);
1315: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1316: return OKC_API.G_RET_STS_UNEXP_ERROR;
1317: end if;
1318: if (l_return_status = OKC_API.G_RET_STS_ERROR
1319: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1320: x_return_status := OKC_API.G_RET_STS_ERROR;
1321: end if;
1322: --
1315: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1316: return OKC_API.G_RET_STS_UNEXP_ERROR;
1317: end if;
1318: if (l_return_status = OKC_API.G_RET_STS_ERROR
1319: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1320: x_return_status := OKC_API.G_RET_STS_ERROR;
1321: end if;
1322: --
1323: validate_cro_code(x_return_status => l_return_status,
1316: return OKC_API.G_RET_STS_UNEXP_ERROR;
1317: end if;
1318: if (l_return_status = OKC_API.G_RET_STS_ERROR
1319: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1320: x_return_status := OKC_API.G_RET_STS_ERROR;
1321: end if;
1322: --
1323: validate_cro_code(x_return_status => l_return_status,
1324: p_ctcv_rec => p_ctcv_rec);
1321: end if;
1322: --
1323: validate_cro_code(x_return_status => l_return_status,
1324: p_ctcv_rec => p_ctcv_rec);
1325: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1326: return OKC_API.G_RET_STS_UNEXP_ERROR;
1327: end if;
1328: if (l_return_status = OKC_API.G_RET_STS_ERROR
1329: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1322: --
1323: validate_cro_code(x_return_status => l_return_status,
1324: p_ctcv_rec => p_ctcv_rec);
1325: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1326: return OKC_API.G_RET_STS_UNEXP_ERROR;
1327: end if;
1328: if (l_return_status = OKC_API.G_RET_STS_ERROR
1329: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1330: x_return_status := OKC_API.G_RET_STS_ERROR;
1324: p_ctcv_rec => p_ctcv_rec);
1325: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1326: return OKC_API.G_RET_STS_UNEXP_ERROR;
1327: end if;
1328: if (l_return_status = OKC_API.G_RET_STS_ERROR
1329: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1330: x_return_status := OKC_API.G_RET_STS_ERROR;
1331: end if;
1332: --
1325: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1326: return OKC_API.G_RET_STS_UNEXP_ERROR;
1327: end if;
1328: if (l_return_status = OKC_API.G_RET_STS_ERROR
1329: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1330: x_return_status := OKC_API.G_RET_STS_ERROR;
1331: end if;
1332: --
1333: validate_dnz_chr_id(x_return_status => l_return_status,
1326: return OKC_API.G_RET_STS_UNEXP_ERROR;
1327: end if;
1328: if (l_return_status = OKC_API.G_RET_STS_ERROR
1329: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1330: x_return_status := OKC_API.G_RET_STS_ERROR;
1331: end if;
1332: --
1333: validate_dnz_chr_id(x_return_status => l_return_status,
1334: p_ctcv_rec => p_ctcv_rec);
1331: end if;
1332: --
1333: validate_dnz_chr_id(x_return_status => l_return_status,
1334: p_ctcv_rec => p_ctcv_rec);
1335: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1336: return OKC_API.G_RET_STS_UNEXP_ERROR;
1337: end if;
1338: if (l_return_status = OKC_API.G_RET_STS_ERROR
1339: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1332: --
1333: validate_dnz_chr_id(x_return_status => l_return_status,
1334: p_ctcv_rec => p_ctcv_rec);
1335: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1336: return OKC_API.G_RET_STS_UNEXP_ERROR;
1337: end if;
1338: if (l_return_status = OKC_API.G_RET_STS_ERROR
1339: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1340: x_return_status := OKC_API.G_RET_STS_ERROR;
1334: p_ctcv_rec => p_ctcv_rec);
1335: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1336: return OKC_API.G_RET_STS_UNEXP_ERROR;
1337: end if;
1338: if (l_return_status = OKC_API.G_RET_STS_ERROR
1339: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1340: x_return_status := OKC_API.G_RET_STS_ERROR;
1341: end if;
1342: --
1335: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1336: return OKC_API.G_RET_STS_UNEXP_ERROR;
1337: end if;
1338: if (l_return_status = OKC_API.G_RET_STS_ERROR
1339: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1340: x_return_status := OKC_API.G_RET_STS_ERROR;
1341: end if;
1342: --
1343: validate_primary_yn(x_return_status => l_return_status,
1336: return OKC_API.G_RET_STS_UNEXP_ERROR;
1337: end if;
1338: if (l_return_status = OKC_API.G_RET_STS_ERROR
1339: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1340: x_return_status := OKC_API.G_RET_STS_ERROR;
1341: end if;
1342: --
1343: validate_primary_yn(x_return_status => l_return_status,
1344: p_ctcv_rec => p_ctcv_rec);
1341: end if;
1342: --
1343: validate_primary_yn(x_return_status => l_return_status,
1344: p_ctcv_rec => p_ctcv_rec);
1345: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1346: return OKC_API.G_RET_STS_UNEXP_ERROR;
1347: end If;
1348: If (l_return_status = OKC_API.G_RET_STS_ERROR
1349: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1342: --
1343: validate_primary_yn(x_return_status => l_return_status,
1344: p_ctcv_rec => p_ctcv_rec);
1345: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1346: return OKC_API.G_RET_STS_UNEXP_ERROR;
1347: end If;
1348: If (l_return_status = OKC_API.G_RET_STS_ERROR
1349: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1350: x_return_status := OKC_API.G_RET_STS_ERROR;
1344: p_ctcv_rec => p_ctcv_rec);
1345: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1346: return OKC_API.G_RET_STS_UNEXP_ERROR;
1347: end If;
1348: If (l_return_status = OKC_API.G_RET_STS_ERROR
1349: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1350: x_return_status := OKC_API.G_RET_STS_ERROR;
1351: end If;
1352: --
1345: if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
1346: return OKC_API.G_RET_STS_UNEXP_ERROR;
1347: end If;
1348: If (l_return_status = OKC_API.G_RET_STS_ERROR
1349: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1350: x_return_status := OKC_API.G_RET_STS_ERROR;
1351: end If;
1352: --
1353: validate_resource_class(x_return_status => l_return_status,
1346: return OKC_API.G_RET_STS_UNEXP_ERROR;
1347: end If;
1348: If (l_return_status = OKC_API.G_RET_STS_ERROR
1349: and x_return_status = OKC_API.G_RET_STS_SUCCESS) then
1350: x_return_status := OKC_API.G_RET_STS_ERROR;
1351: end If;
1352: --
1353: validate_resource_class(x_return_status => l_return_status,
1354: p_ctcv_rec => p_ctcv_rec);
1351: end If;
1352: --
1353: validate_resource_class(x_return_status => l_return_status,
1354: p_ctcv_rec => p_ctcv_rec);
1355: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1356: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1357: END IF;
1358: IF (l_return_status = OKC_API.G_RET_STS_ERROR
1359: AND x_return_status = OKC_API.G_RET_STS_SUCCESS) THEN
1352: --
1353: validate_resource_class(x_return_status => l_return_status,
1354: p_ctcv_rec => p_ctcv_rec);
1355: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1356: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1357: END IF;
1358: IF (l_return_status = OKC_API.G_RET_STS_ERROR
1359: AND x_return_status = OKC_API.G_RET_STS_SUCCESS) THEN
1360: x_return_status := OKC_API.G_RET_STS_ERROR;
1354: p_ctcv_rec => p_ctcv_rec);
1355: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1356: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1357: END IF;
1358: IF (l_return_status = OKC_API.G_RET_STS_ERROR
1359: AND x_return_status = OKC_API.G_RET_STS_SUCCESS) THEN
1360: x_return_status := OKC_API.G_RET_STS_ERROR;
1361: END IF;
1362: --
1355: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1356: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1357: END IF;
1358: IF (l_return_status = OKC_API.G_RET_STS_ERROR
1359: AND x_return_status = OKC_API.G_RET_STS_SUCCESS) THEN
1360: x_return_status := OKC_API.G_RET_STS_ERROR;
1361: END IF;
1362: --
1363: return x_return_status;
1356: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1357: END IF;
1358: IF (l_return_status = OKC_API.G_RET_STS_ERROR
1359: AND x_return_status = OKC_API.G_RET_STS_SUCCESS) THEN
1360: x_return_status := OKC_API.G_RET_STS_ERROR;
1361: END IF;
1362: --
1363: return x_return_status;
1364:
1375: okc_debug.Reset_Indentation;
1376: END IF;
1377:
1378: -- store SQL error message on message stack for caller
1379: OKC_API.set_message(p_app_name => g_app_name,
1380: p_msg_name => g_unexpected_error,
1381: p_token1 => g_sqlcode_token,
1382: p_token1_value => sqlcode,
1383: p_token2 => g_sqlerrm_token,
1381: p_token1 => g_sqlcode_token,
1382: p_token1_value => sqlcode,
1383: p_token2 => g_sqlerrm_token,
1384: p_token2_value => sqlerrm);
1385: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1386: return x_return_status;
1387:
1388: END Validate_Attributes;
1389: /*+++++++++++++End of hand code +++++++++++++++++*/
1425: OR (p_ctcv_rec.END_DATE IS NULL AND (p_ctcv_rec.START_DATE <=END_DATE))
1426: OR (p_ctcv_rec.END_DATE IS NULL AND END_DATE IS NULL)));
1427:
1428:
1429: x_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1430: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1431: l_row_found BOOLEAN := FALSE;
1432: l_dummy VARCHAR2(1);
1433: -- indirection
1426: OR (p_ctcv_rec.END_DATE IS NULL AND END_DATE IS NULL)));
1427:
1428:
1429: x_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1430: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1431: l_row_found BOOLEAN := FALSE;
1432: l_dummy VARCHAR2(1);
1433: -- indirection
1434: l_rle_code varchar2(30);
1478:
1479: validate_JTOT_OBJECT1_CODE(x_return_status => l_return_status,
1480: p_ctcv_rec => p_ctcv_rec);
1481:
1482: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR)
1483: THEN
1484: IF (l_debug = 'Y') THEN
1485: okc_debug.log('4150: Exiting Validate_jtot_object1_code in validate_record:unexp err', 2);
1486: okc_debug.Reset_Indentation;
1484: IF (l_debug = 'Y') THEN
1485: okc_debug.log('4150: Exiting Validate_jtot_object1_code in validate_record:unexp err', 2);
1486: okc_debug.Reset_Indentation;
1487: END IF;
1488: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1489: END IF;
1490:
1491: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1492: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1487: END IF;
1488: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1489: END IF;
1490:
1491: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1492: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1493: THEN
1494: x_return_status := OKC_API.G_RET_STS_ERROR;
1495: END IF;
1488: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1489: END IF;
1490:
1491: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1492: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1493: THEN
1494: x_return_status := OKC_API.G_RET_STS_ERROR;
1495: END IF;
1496:
1490:
1491: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1492: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1493: THEN
1494: x_return_status := OKC_API.G_RET_STS_ERROR;
1495: END IF;
1496:
1497: -- -----------------------------------------------------
1498: validate_OBJECT1_ID1(x_return_status => l_return_status,
1497: -- -----------------------------------------------------
1498: validate_OBJECT1_ID1(x_return_status => l_return_status,
1499: p_ctcv_rec => p_ctcv_rec);
1500:
1501: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR)
1502: THEN
1503: IF (l_debug = 'Y') THEN
1504: okc_debug.log('4170: Exiting Validate_object1_id1 in validate_record:unexp err', 2);
1505: okc_debug.Reset_Indentation;
1503: IF (l_debug = 'Y') THEN
1504: okc_debug.log('4170: Exiting Validate_object1_id1 in validate_record:unexp err', 2);
1505: okc_debug.Reset_Indentation;
1506: END IF;
1507: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1508: END IF;
1509:
1510: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1511: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1506: END IF;
1507: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1508: END IF;
1509:
1510: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1511: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1512: THEN
1513: x_return_status := OKC_API.G_RET_STS_ERROR;
1514: END IF;
1507: RETURN OKC_API.G_RET_STS_UNEXP_ERROR;
1508: END IF;
1509:
1510: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1511: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1512: THEN
1513: x_return_status := OKC_API.G_RET_STS_ERROR;
1514: END IF;
1515: End If; -- if user defined
1509:
1510: IF ( l_return_status = OKC_API.G_RET_STS_ERROR
1511: AND x_return_status = OKC_API.G_RET_STS_SUCCESS)
1512: THEN
1513: x_return_status := OKC_API.G_RET_STS_ERROR;
1514: END IF;
1515: End If; -- if user defined
1516: -- ---------------------------------------------------------------------
1517: -- Bug 1636056 related changes - Shyam
1519: -- the explicit cursors above, for identical function to check
1520: -- uniqueness in OKC_CONTACTS table.
1521: -- ---------------------------------------------------------------------
1522: IF ( (p_ctcv_rec.CPL_ID IS NOT NULL)
1523: AND (p_ctcv_rec.CPL_ID <> OKC_API.G_MISS_NUM) )
1524: AND
1525: ( (p_ctcv_rec.CRO_CODE IS NOT NULL)
1526: AND (p_ctcv_rec.CRO_CODE <> OKC_API.G_MISS_CHAR) )
1527: THEN
1522: IF ( (p_ctcv_rec.CPL_ID IS NOT NULL)
1523: AND (p_ctcv_rec.CPL_ID <> OKC_API.G_MISS_NUM) )
1524: AND
1525: ( (p_ctcv_rec.CRO_CODE IS NOT NULL)
1526: AND (p_ctcv_rec.CRO_CODE <> OKC_API.G_MISS_CHAR) )
1527: THEN
1528: OPEN cur_ctcv;
1529: FETCH cur_ctcv INTO l_dummy;
1530: l_row_found := cur_ctcv%FOUND;
1532:
1533: IF (l_row_found)
1534: THEN
1535: -- Display the newly defined error message
1536: OKC_API.set_message(G_APP_NAME,
1537: 'OKC_DUP_CONTACT_PARTY_ID');
1538: x_return_status := OKC_API.G_RET_STS_ERROR;
1539: END IF;
1540: END IF;
1534: THEN
1535: -- Display the newly defined error message
1536: OKC_API.set_message(G_APP_NAME,
1537: 'OKC_DUP_CONTACT_PARTY_ID');
1538: x_return_status := OKC_API.G_RET_STS_ERROR;
1539: END IF;
1540: END IF;
1541:
1542: -- ---------------------------------------------------------------------
1545: -- ---------------------------------------------------------------------
1546:
1547: IF p_ctcv_rec.START_DATE IS NOT NULL AND p_ctcv_rec.END_DATE IS NOT NULL THEN
1548: IF p_ctcv_rec.END_DATE < p_ctcv_rec.START_DATE THEN
1549: OKC_API.set_message(G_APP_NAME,'OKC_INVALID_END_DATE');
1550: x_return_status := OKC_API.G_RET_STS_ERROR;
1551: END IF;
1552: END IF;
1553: RETURN x_return_status;
1546:
1547: IF p_ctcv_rec.START_DATE IS NOT NULL AND p_ctcv_rec.END_DATE IS NOT NULL THEN
1548: IF p_ctcv_rec.END_DATE < p_ctcv_rec.START_DATE THEN
1549: OKC_API.set_message(G_APP_NAME,'OKC_INVALID_END_DATE');
1550: x_return_status := OKC_API.G_RET_STS_ERROR;
1551: END IF;
1552: END IF;
1553: RETURN x_return_status;
1554:
1565: okc_debug.Reset_Indentation;
1566: END IF;
1567:
1568: -- store SQL error message on message stack for caller
1569: OKC_API.set_message(p_app_name => g_app_name,
1570: p_msg_name => g_unexpected_error,
1571: p_token1 => g_sqlcode_token,
1572: p_token1_value => sqlcode,
1573: p_token2 => g_sqlerrm_token,
1572: p_token1_value => sqlcode,
1573: p_token2 => g_sqlerrm_token,
1574: p_token2_value => sqlerrm);
1575:
1576: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1577:
1578: RETURN x_return_status;
1579:
1580: END Validate_Record;
1687: p_ctcv_rec IN ctcv_rec_type) IS
1688:
1689: l_api_version CONSTANT NUMBER := 1;
1690: l_api_name CONSTANT VARCHAR2(30) := 'V_validate_row';
1691: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1692: l_ctcv_rec ctcv_rec_type := p_ctcv_rec;
1693: l_ctc_rec ctc_rec_type;
1694: BEGIN
1695:
1697: okc_debug.Set_Indentation('OKC_CTC_PVT');
1698: okc_debug.log('4600: Entered validate_row', 2);
1699: END IF;
1700:
1701: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
1702: G_PKG_NAME,
1703: p_init_msg_list,
1704: l_api_version,
1705: p_api_version,
1704: l_api_version,
1705: p_api_version,
1706: '_PVT',
1707: x_return_status);
1708: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1709: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1710: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1711: RAISE OKC_API.G_EXCEPTION_ERROR;
1712: END IF;
1705: p_api_version,
1706: '_PVT',
1707: x_return_status);
1708: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1709: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1710: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1711: RAISE OKC_API.G_EXCEPTION_ERROR;
1712: END IF;
1713: --- Validate all non-missing attributes (Item Level Validation)
1706: '_PVT',
1707: x_return_status);
1708: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1709: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1710: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1711: RAISE OKC_API.G_EXCEPTION_ERROR;
1712: END IF;
1713: --- Validate all non-missing attributes (Item Level Validation)
1714: l_return_status := Validate_Attributes(l_ctcv_rec);
1707: x_return_status);
1708: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1709: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1710: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1711: RAISE OKC_API.G_EXCEPTION_ERROR;
1712: END IF;
1713: --- Validate all non-missing attributes (Item Level Validation)
1714: l_return_status := Validate_Attributes(l_ctcv_rec);
1715: --- If any errors happen abort API
1712: END IF;
1713: --- Validate all non-missing attributes (Item Level Validation)
1714: l_return_status := Validate_Attributes(l_ctcv_rec);
1715: --- If any errors happen abort API
1716: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1717: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1718: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1719: RAISE OKC_API.G_EXCEPTION_ERROR;
1720: END IF;
1713: --- Validate all non-missing attributes (Item Level Validation)
1714: l_return_status := Validate_Attributes(l_ctcv_rec);
1715: --- If any errors happen abort API
1716: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1717: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1718: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1719: RAISE OKC_API.G_EXCEPTION_ERROR;
1720: END IF;
1721: l_return_status := Validate_Record(l_ctcv_rec);
1714: l_return_status := Validate_Attributes(l_ctcv_rec);
1715: --- If any errors happen abort API
1716: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1717: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1718: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1719: RAISE OKC_API.G_EXCEPTION_ERROR;
1720: END IF;
1721: l_return_status := Validate_Record(l_ctcv_rec);
1722: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1715: --- If any errors happen abort API
1716: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1717: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1718: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1719: RAISE OKC_API.G_EXCEPTION_ERROR;
1720: END IF;
1721: l_return_status := Validate_Record(l_ctcv_rec);
1722: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1723: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1718: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1719: RAISE OKC_API.G_EXCEPTION_ERROR;
1720: END IF;
1721: l_return_status := Validate_Record(l_ctcv_rec);
1722: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1723: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1724: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1725: RAISE OKC_API.G_EXCEPTION_ERROR;
1726: END IF;
1719: RAISE OKC_API.G_EXCEPTION_ERROR;
1720: END IF;
1721: l_return_status := Validate_Record(l_ctcv_rec);
1722: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1723: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1724: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1725: RAISE OKC_API.G_EXCEPTION_ERROR;
1726: END IF;
1727: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1720: END IF;
1721: l_return_status := Validate_Record(l_ctcv_rec);
1722: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1723: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1724: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1725: RAISE OKC_API.G_EXCEPTION_ERROR;
1726: END IF;
1727: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1728:
1721: l_return_status := Validate_Record(l_ctcv_rec);
1722: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1723: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1724: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1725: RAISE OKC_API.G_EXCEPTION_ERROR;
1726: END IF;
1727: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1728:
1729: IF (l_debug = 'Y') THEN
1723: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1724: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1725: RAISE OKC_API.G_EXCEPTION_ERROR;
1726: END IF;
1727: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1728:
1729: IF (l_debug = 'Y') THEN
1730: okc_debug.log('4700: Leaving validate_row', 2);
1731: okc_debug.Reset_Indentation;
1731: okc_debug.Reset_Indentation;
1732: END IF;
1733:
1734: EXCEPTION
1735: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1736:
1737: IF (l_debug = 'Y') THEN
1738: okc_debug.log('4800: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1739: okc_debug.Reset_Indentation;
1734: EXCEPTION
1735: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1736:
1737: IF (l_debug = 'Y') THEN
1738: okc_debug.log('4800: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1739: okc_debug.Reset_Indentation;
1740: END IF;
1741:
1742: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1738: okc_debug.log('4800: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1739: okc_debug.Reset_Indentation;
1740: END IF;
1741:
1742: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1743: (
1744: l_api_name,
1745: G_PKG_NAME,
1746: 'OKC_API.G_RET_STS_ERROR',
1742: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1743: (
1744: l_api_name,
1745: G_PKG_NAME,
1746: 'OKC_API.G_RET_STS_ERROR',
1747: x_msg_count,
1748: x_msg_data,
1749: '_PVT'
1750: );
1747: x_msg_count,
1748: x_msg_data,
1749: '_PVT'
1750: );
1751: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1752:
1753: IF (l_debug = 'Y') THEN
1754: okc_debug.log('4900: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1755: okc_debug.Reset_Indentation;
1750: );
1751: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1752:
1753: IF (l_debug = 'Y') THEN
1754: okc_debug.log('4900: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1755: okc_debug.Reset_Indentation;
1756: END IF;
1757:
1758: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1754: okc_debug.log('4900: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1755: okc_debug.Reset_Indentation;
1756: END IF;
1757:
1758: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1759: (
1760: l_api_name,
1761: G_PKG_NAME,
1762: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1758: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1759: (
1760: l_api_name,
1761: G_PKG_NAME,
1762: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1763: x_msg_count,
1764: x_msg_data,
1765: '_PVT'
1766: );
1770: okc_debug.log('5000: Exiting validate_row:OTHERS Exception', 2);
1771: okc_debug.Reset_Indentation;
1772: END IF;
1773:
1774: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1775: (
1776: l_api_name,
1777: G_PKG_NAME,
1778: 'OTHERS',
1794: p_ctcv_tbl IN ctcv_tbl_type) IS
1795:
1796: l_api_version CONSTANT NUMBER := 1;
1797: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_validate_row';
1798: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1799: i NUMBER := 0;
1800: BEGIN
1801:
1802: IF (l_debug = 'Y') THEN
1803: okc_debug.Set_Indentation('OKC_CTC_PVT');
1804: okc_debug.log('5100: Entered validate_row', 2);
1805: END IF;
1806:
1807: OKC_API.init_msg_list(p_init_msg_list);
1808: -- Make sure PL/SQL table has records in it before passing
1809: IF (p_ctcv_tbl.COUNT > 0) THEN
1810: i := p_ctcv_tbl.FIRST;
1811: LOOP
1810: i := p_ctcv_tbl.FIRST;
1811: LOOP
1812: validate_row (
1813: p_api_version => p_api_version,
1814: p_init_msg_list => OKC_API.G_FALSE,
1815: x_return_status => x_return_status,
1816: x_msg_count => x_msg_count,
1817: x_msg_data => x_msg_data,
1818: p_ctcv_rec => p_ctcv_tbl(i));
1826: okc_debug.Reset_Indentation;
1827: END IF;
1828:
1829: EXCEPTION
1830: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1831:
1832: IF (l_debug = 'Y') THEN
1833: okc_debug.log('5300: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1834: okc_debug.Reset_Indentation;
1829: EXCEPTION
1830: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1831:
1832: IF (l_debug = 'Y') THEN
1833: okc_debug.log('5300: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1834: okc_debug.Reset_Indentation;
1835: END IF;
1836:
1837: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1833: okc_debug.log('5300: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1834: okc_debug.Reset_Indentation;
1835: END IF;
1836:
1837: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1838: (
1839: l_api_name,
1840: G_PKG_NAME,
1841: 'OKC_API.G_RET_STS_ERROR',
1837: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1838: (
1839: l_api_name,
1840: G_PKG_NAME,
1841: 'OKC_API.G_RET_STS_ERROR',
1842: x_msg_count,
1843: x_msg_data,
1844: '_PVT'
1845: );
1842: x_msg_count,
1843: x_msg_data,
1844: '_PVT'
1845: );
1846: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1847:
1848: IF (l_debug = 'Y') THEN
1849: okc_debug.log('5400: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1850: okc_debug.Reset_Indentation;
1845: );
1846: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1847:
1848: IF (l_debug = 'Y') THEN
1849: okc_debug.log('5400: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1850: okc_debug.Reset_Indentation;
1851: END IF;
1852:
1853: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1849: okc_debug.log('5400: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1850: okc_debug.Reset_Indentation;
1851: END IF;
1852:
1853: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1854: (
1855: l_api_name,
1856: G_PKG_NAME,
1857: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1853: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1854: (
1855: l_api_name,
1856: G_PKG_NAME,
1857: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1858: x_msg_count,
1859: x_msg_data,
1860: '_PVT'
1861: );
1865: okc_debug.log('5500: Exiting validate_row:OTHERS Exception', 2);
1866: okc_debug.Reset_Indentation;
1867: END IF;
1868:
1869: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1870: (
1871: l_api_name,
1872: G_PKG_NAME,
1873: 'OTHERS',
1893: x_ctc_rec OUT NOCOPY ctc_rec_type) IS
1894:
1895: l_api_version CONSTANT NUMBER := 1;
1896: l_api_name CONSTANT VARCHAR2(30) := 'CONTACTS_insert_row';
1897: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1898: l_ctc_rec ctc_rec_type := p_ctc_rec;
1899: l_def_ctc_rec ctc_rec_type;
1900: -------------------------------------
1901: -- Set_Attributes for:OKC_CONTACTS --
1903: FUNCTION Set_Attributes (
1904: p_ctc_rec IN ctc_rec_type,
1905: x_ctc_rec OUT NOCOPY ctc_rec_type
1906: ) RETURN VARCHAR2 IS
1907: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1908: BEGIN
1909:
1910: x_ctc_rec := p_ctc_rec;
1911: x_ctc_rec.primary_yn := UPPER(x_ctc_rec.PRIMARY_YN);
1919: okc_debug.Set_Indentation('OKC_CTC_PVT');
1920: okc_debug.log('5700: Entered insert_row', 2);
1921: END IF;
1922:
1923: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
1924: p_init_msg_list,
1925: '_PVT',
1926: x_return_status);
1927: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1923: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
1924: p_init_msg_list,
1925: '_PVT',
1926: x_return_status);
1927: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1928: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1929: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1930: RAISE OKC_API.G_EXCEPTION_ERROR;
1931: END IF;
1924: p_init_msg_list,
1925: '_PVT',
1926: x_return_status);
1927: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1928: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1929: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1930: RAISE OKC_API.G_EXCEPTION_ERROR;
1931: END IF;
1932: --- Setting item attributes
1925: '_PVT',
1926: x_return_status);
1927: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1928: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1929: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1930: RAISE OKC_API.G_EXCEPTION_ERROR;
1931: END IF;
1932: --- Setting item attributes
1933: l_return_status := Set_Attributes(
1926: x_return_status);
1927: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1928: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1929: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1930: RAISE OKC_API.G_EXCEPTION_ERROR;
1931: END IF;
1932: --- Setting item attributes
1933: l_return_status := Set_Attributes(
1934: p_ctc_rec, -- IN
1933: l_return_status := Set_Attributes(
1934: p_ctc_rec, -- IN
1935: l_ctc_rec); -- OUT
1936: --- If any errors happen abort API
1937: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1938: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1939: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1940: RAISE OKC_API.G_EXCEPTION_ERROR;
1941: END IF;
1934: p_ctc_rec, -- IN
1935: l_ctc_rec); -- OUT
1936: --- If any errors happen abort API
1937: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1938: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1939: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1940: RAISE OKC_API.G_EXCEPTION_ERROR;
1941: END IF;
1942: INSERT INTO OKC_CONTACTS(
1935: l_ctc_rec); -- OUT
1936: --- If any errors happen abort API
1937: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1938: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1939: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1940: RAISE OKC_API.G_EXCEPTION_ERROR;
1941: END IF;
1942: INSERT INTO OKC_CONTACTS(
1943: id,
1936: --- If any errors happen abort API
1937: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1938: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1939: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1940: RAISE OKC_API.G_EXCEPTION_ERROR;
1941: END IF;
1942: INSERT INTO OKC_CONTACTS(
1943: id,
1944: cpl_id,
2015: /* Bug fix for 6882512*/
2016: update_contact_stecode(p_chr_id => l_ctc_rec.dnz_chr_id,
2017: x_return_status=>l_return_status);
2018:
2019: IF l_return_status <> OKC_API.G_RET_STS_SUCCESS THEN
2020: RAISE OKC_API.G_EXCEPTION_ERROR;
2021: END IF;
2022: /* Bug fix for 6882512*/
2023: x_ctc_rec := l_ctc_rec;
2016: update_contact_stecode(p_chr_id => l_ctc_rec.dnz_chr_id,
2017: x_return_status=>l_return_status);
2018:
2019: IF l_return_status <> OKC_API.G_RET_STS_SUCCESS THEN
2020: RAISE OKC_API.G_EXCEPTION_ERROR;
2021: END IF;
2022: /* Bug fix for 6882512*/
2023: x_ctc_rec := l_ctc_rec;
2024: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2020: RAISE OKC_API.G_EXCEPTION_ERROR;
2021: END IF;
2022: /* Bug fix for 6882512*/
2023: x_ctc_rec := l_ctc_rec;
2024: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2025:
2026: IF (l_debug = 'Y') THEN
2027: okc_debug.log('5800: Leaving insert_row', 2);
2028: okc_debug.Reset_Indentation;
2028: okc_debug.Reset_Indentation;
2029: END IF;
2030:
2031: EXCEPTION
2032: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2033:
2034: IF (l_debug = 'Y') THEN
2035: okc_debug.log('5900: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2036: okc_debug.Reset_Indentation;
2031: EXCEPTION
2032: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2033:
2034: IF (l_debug = 'Y') THEN
2035: okc_debug.log('5900: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2036: okc_debug.Reset_Indentation;
2037: END IF;
2038:
2039: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2035: okc_debug.log('5900: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2036: okc_debug.Reset_Indentation;
2037: END IF;
2038:
2039: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2040: (
2041: l_api_name,
2042: G_PKG_NAME,
2043: 'OKC_API.G_RET_STS_ERROR',
2039: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2040: (
2041: l_api_name,
2042: G_PKG_NAME,
2043: 'OKC_API.G_RET_STS_ERROR',
2044: x_msg_count,
2045: x_msg_data,
2046: '_PVT'
2047: );
2044: x_msg_count,
2045: x_msg_data,
2046: '_PVT'
2047: );
2048: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2049:
2050: IF (l_debug = 'Y') THEN
2051: okc_debug.log('6000: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2052: okc_debug.Reset_Indentation;
2047: );
2048: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2049:
2050: IF (l_debug = 'Y') THEN
2051: okc_debug.log('6000: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2052: okc_debug.Reset_Indentation;
2053: END IF;
2054:
2055: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2051: okc_debug.log('6000: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2052: okc_debug.Reset_Indentation;
2053: END IF;
2054:
2055: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2056: (
2057: l_api_name,
2058: G_PKG_NAME,
2059: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2055: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2056: (
2057: l_api_name,
2058: G_PKG_NAME,
2059: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2060: x_msg_count,
2061: x_msg_data,
2062: '_PVT'
2063: );
2067: okc_debug.log('6100: Exiting insert_row:OTHERS Exception', 2);
2068: okc_debug.Reset_Indentation;
2069: END IF;
2070:
2071: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2072: (
2073: l_api_name,
2074: G_PKG_NAME,
2075: 'OTHERS',
2092: x_ctcv_rec OUT NOCOPY ctcv_rec_type) IS
2093:
2094: l_api_version CONSTANT NUMBER := 1;
2095: l_api_name CONSTANT VARCHAR2(30) := 'V_insert_row';
2096: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2097: l_ctcv_rec ctcv_rec_type;
2098: l_def_ctcv_rec ctcv_rec_type;
2099: l_ctc_rec ctc_rec_type;
2100: lx_ctc_rec ctc_rec_type;
2122: FUNCTION Set_Attributes (
2123: p_ctcv_rec IN ctcv_rec_type,
2124: x_ctcv_rec OUT NOCOPY ctcv_rec_type
2125: ) RETURN VARCHAR2 IS
2126: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2127: BEGIN
2128:
2129: x_ctcv_rec := p_ctcv_rec;
2130: x_ctcv_rec.OBJECT_VERSION_NUMBER := 1;
2138: okc_debug.Set_Indentation('OKC_CTC_PVT');
2139: okc_debug.log('6400: Entered insert_row', 2);
2140: END IF;
2141:
2142: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2143: G_PKG_NAME,
2144: p_init_msg_list,
2145: l_api_version,
2146: p_api_version,
2145: l_api_version,
2146: p_api_version,
2147: '_PVT',
2148: x_return_status);
2149: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2150: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2151: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2152: RAISE OKC_API.G_EXCEPTION_ERROR;
2153: END IF;
2146: p_api_version,
2147: '_PVT',
2148: x_return_status);
2149: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2150: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2151: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2152: RAISE OKC_API.G_EXCEPTION_ERROR;
2153: END IF;
2154: l_ctcv_rec := null_out_defaults(p_ctcv_rec);
2147: '_PVT',
2148: x_return_status);
2149: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2150: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2151: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2152: RAISE OKC_API.G_EXCEPTION_ERROR;
2153: END IF;
2154: l_ctcv_rec := null_out_defaults(p_ctcv_rec);
2155: -- Set primary key value
2148: x_return_status);
2149: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2150: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2151: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2152: RAISE OKC_API.G_EXCEPTION_ERROR;
2153: END IF;
2154: l_ctcv_rec := null_out_defaults(p_ctcv_rec);
2155: -- Set primary key value
2156: l_ctcv_rec.ID := get_seq_id;
2158: l_return_status := Set_Attributes(
2159: l_ctcv_rec, -- IN
2160: l_def_ctcv_rec); -- OUT
2161: --- If any errors happen abort API
2162: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2163: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2164: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2165: RAISE OKC_API.G_EXCEPTION_ERROR;
2166: END IF;
2159: l_ctcv_rec, -- IN
2160: l_def_ctcv_rec); -- OUT
2161: --- If any errors happen abort API
2162: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2163: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2164: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2165: RAISE OKC_API.G_EXCEPTION_ERROR;
2166: END IF;
2167: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
2160: l_def_ctcv_rec); -- OUT
2161: --- If any errors happen abort API
2162: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2163: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2164: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2165: RAISE OKC_API.G_EXCEPTION_ERROR;
2166: END IF;
2167: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
2168: --- Validate all non-missing attributes (Item Level Validation)
2161: --- If any errors happen abort API
2162: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2163: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2164: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2165: RAISE OKC_API.G_EXCEPTION_ERROR;
2166: END IF;
2167: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
2168: --- Validate all non-missing attributes (Item Level Validation)
2169: l_return_status := Validate_Attributes(l_def_ctcv_rec);
2167: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
2168: --- Validate all non-missing attributes (Item Level Validation)
2169: l_return_status := Validate_Attributes(l_def_ctcv_rec);
2170: --- If any errors happen abort API
2171: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2172: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2173: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2174: RAISE OKC_API.G_EXCEPTION_ERROR;
2175: END IF;
2168: --- Validate all non-missing attributes (Item Level Validation)
2169: l_return_status := Validate_Attributes(l_def_ctcv_rec);
2170: --- If any errors happen abort API
2171: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2172: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2173: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2174: RAISE OKC_API.G_EXCEPTION_ERROR;
2175: END IF;
2176: l_return_status := Validate_Record(l_def_ctcv_rec);
2169: l_return_status := Validate_Attributes(l_def_ctcv_rec);
2170: --- If any errors happen abort API
2171: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2172: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2173: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2174: RAISE OKC_API.G_EXCEPTION_ERROR;
2175: END IF;
2176: l_return_status := Validate_Record(l_def_ctcv_rec);
2177: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2170: --- If any errors happen abort API
2171: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2172: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2173: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2174: RAISE OKC_API.G_EXCEPTION_ERROR;
2175: END IF;
2176: l_return_status := Validate_Record(l_def_ctcv_rec);
2177: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2178: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2173: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2174: RAISE OKC_API.G_EXCEPTION_ERROR;
2175: END IF;
2176: l_return_status := Validate_Record(l_def_ctcv_rec);
2177: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2178: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2179: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2180: RAISE OKC_API.G_EXCEPTION_ERROR;
2181: END IF;
2174: RAISE OKC_API.G_EXCEPTION_ERROR;
2175: END IF;
2176: l_return_status := Validate_Record(l_def_ctcv_rec);
2177: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2178: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2179: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2180: RAISE OKC_API.G_EXCEPTION_ERROR;
2181: END IF;
2182: --------------------------------------
2175: END IF;
2176: l_return_status := Validate_Record(l_def_ctcv_rec);
2177: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2178: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2179: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2180: RAISE OKC_API.G_EXCEPTION_ERROR;
2181: END IF;
2182: --------------------------------------
2183: -- Move VIEW record to "Child" records
2176: l_return_status := Validate_Record(l_def_ctcv_rec);
2177: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2178: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2179: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2180: RAISE OKC_API.G_EXCEPTION_ERROR;
2181: END IF;
2182: --------------------------------------
2183: -- Move VIEW record to "Child" records
2184: --------------------------------------
2193: x_msg_data,
2194: l_ctc_rec,
2195: lx_ctc_rec
2196: );
2197: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2198: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2199: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2200: RAISE OKC_API.G_EXCEPTION_ERROR;
2201: END IF;
2194: l_ctc_rec,
2195: lx_ctc_rec
2196: );
2197: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2198: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2199: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2200: RAISE OKC_API.G_EXCEPTION_ERROR;
2201: END IF;
2202: migrate(lx_ctc_rec, l_def_ctcv_rec);
2195: lx_ctc_rec
2196: );
2197: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2198: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2199: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2200: RAISE OKC_API.G_EXCEPTION_ERROR;
2201: END IF;
2202: migrate(lx_ctc_rec, l_def_ctcv_rec);
2203: -- Set OUT values
2196: );
2197: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2198: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2199: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2200: RAISE OKC_API.G_EXCEPTION_ERROR;
2201: END IF;
2202: migrate(lx_ctc_rec, l_def_ctcv_rec);
2203: -- Set OUT values
2204: x_ctcv_rec := l_def_ctcv_rec;
2201: END IF;
2202: migrate(lx_ctc_rec, l_def_ctcv_rec);
2203: -- Set OUT values
2204: x_ctcv_rec := l_def_ctcv_rec;
2205: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2206:
2207: IF (l_debug = 'Y') THEN
2208: okc_debug.log('6500: Leaving insert_row', 2);
2209: okc_debug.Reset_Indentation;
2209: okc_debug.Reset_Indentation;
2210: END IF;
2211:
2212: EXCEPTION
2213: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2214:
2215: IF (l_debug = 'Y') THEN
2216: okc_debug.log('6600: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2217: okc_debug.Reset_Indentation;
2212: EXCEPTION
2213: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2214:
2215: IF (l_debug = 'Y') THEN
2216: okc_debug.log('6600: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2217: okc_debug.Reset_Indentation;
2218: END IF;
2219:
2220: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2216: okc_debug.log('6600: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2217: okc_debug.Reset_Indentation;
2218: END IF;
2219:
2220: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2221: (
2222: l_api_name,
2223: G_PKG_NAME,
2224: 'OKC_API.G_RET_STS_ERROR',
2220: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2221: (
2222: l_api_name,
2223: G_PKG_NAME,
2224: 'OKC_API.G_RET_STS_ERROR',
2225: x_msg_count,
2226: x_msg_data,
2227: '_PVT'
2228: );
2225: x_msg_count,
2226: x_msg_data,
2227: '_PVT'
2228: );
2229: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2230:
2231: IF (l_debug = 'Y') THEN
2232: okc_debug.log('6700: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2233: okc_debug.Reset_Indentation;
2228: );
2229: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2230:
2231: IF (l_debug = 'Y') THEN
2232: okc_debug.log('6700: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2233: okc_debug.Reset_Indentation;
2234: END IF;
2235:
2236: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2232: okc_debug.log('6700: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2233: okc_debug.Reset_Indentation;
2234: END IF;
2235:
2236: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2237: (
2238: l_api_name,
2239: G_PKG_NAME,
2240: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2236: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2237: (
2238: l_api_name,
2239: G_PKG_NAME,
2240: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2241: x_msg_count,
2242: x_msg_data,
2243: '_PVT'
2244: );
2248: okc_debug.log('6800: Exiting insert_row:OTHERS 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: 'OTHERS',
2273: x_ctcv_tbl OUT NOCOPY ctcv_tbl_type) IS
2274:
2275: l_api_version CONSTANT NUMBER := 1;
2276: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_insert_row';
2277: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2278: i NUMBER := 0;
2279: BEGIN
2280:
2281: IF (l_debug = 'Y') THEN
2282: okc_debug.Set_Indentation('OKC_CTC_PVT');
2283: okc_debug.log('6900: Entered insert_row', 2);
2284: END IF;
2285:
2286: OKC_API.init_msg_list(p_init_msg_list);
2287: -- Make sure PL/SQL table has records in it before passing
2288: IF (p_ctcv_tbl.COUNT > 0) THEN
2289: i := p_ctcv_tbl.FIRST;
2290: LOOP
2289: i := p_ctcv_tbl.FIRST;
2290: LOOP
2291: insert_row (
2292: p_api_version => p_api_version,
2293: p_init_msg_list => OKC_API.G_FALSE,
2294: x_return_status => x_return_status,
2295: x_msg_count => x_msg_count,
2296: x_msg_data => x_msg_data,
2297: p_ctcv_rec => p_ctcv_tbl(i),
2306: okc_debug.Reset_Indentation;
2307: END IF;
2308:
2309: EXCEPTION
2310: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2311:
2312: IF (l_debug = 'Y') THEN
2313: okc_debug.log('7100: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2314: okc_debug.Reset_Indentation;
2309: EXCEPTION
2310: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2311:
2312: IF (l_debug = 'Y') THEN
2313: okc_debug.log('7100: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2314: okc_debug.Reset_Indentation;
2315: END IF;
2316:
2317: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2313: okc_debug.log('7100: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2314: okc_debug.Reset_Indentation;
2315: END IF;
2316:
2317: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2318: (
2319: l_api_name,
2320: G_PKG_NAME,
2321: 'OKC_API.G_RET_STS_ERROR',
2317: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2318: (
2319: l_api_name,
2320: G_PKG_NAME,
2321: 'OKC_API.G_RET_STS_ERROR',
2322: x_msg_count,
2323: x_msg_data,
2324: '_PVT'
2325: );
2322: x_msg_count,
2323: x_msg_data,
2324: '_PVT'
2325: );
2326: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2327:
2328: IF (l_debug = 'Y') THEN
2329: okc_debug.log('7200: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2330: okc_debug.Reset_Indentation;
2325: );
2326: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2327:
2328: IF (l_debug = 'Y') THEN
2329: okc_debug.log('7200: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2330: okc_debug.Reset_Indentation;
2331: END IF;
2332:
2333: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2329: okc_debug.log('7200: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2330: okc_debug.Reset_Indentation;
2331: END IF;
2332:
2333: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2334: (
2335: l_api_name,
2336: G_PKG_NAME,
2337: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2333: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2334: (
2335: l_api_name,
2336: G_PKG_NAME,
2337: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2338: x_msg_count,
2339: x_msg_data,
2340: '_PVT'
2341: );
2345: okc_debug.log('7300: Exiting insert_row:OTHERS Exception', 2);
2346: okc_debug.Reset_Indentation;
2347: END IF;
2348:
2349: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2350: (
2351: l_api_name,
2352: G_PKG_NAME,
2353: 'OTHERS',
2385: FROM OKC_CONTACTS
2386: WHERE ID = p_ctc_rec.id;
2387: l_api_version CONSTANT NUMBER := 1;
2388: l_api_name CONSTANT VARCHAR2(30) := 'CONTACTS_lock_row';
2389: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2390: l_object_version_number OKC_CONTACTS.OBJECT_VERSION_NUMBER%TYPE;
2391: lc_object_version_number OKC_CONTACTS.OBJECT_VERSION_NUMBER%TYPE;
2392: l_row_notfound BOOLEAN := FALSE;
2393: lc_row_notfound BOOLEAN := FALSE;
2397: okc_debug.Set_Indentation('OKC_CTC_PVT');
2398: okc_debug.log('7400: Entered lock_row', 2);
2399: END IF;
2400:
2401: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2402: p_init_msg_list,
2403: '_PVT',
2404: x_return_status);
2405: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2401: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2402: p_init_msg_list,
2403: '_PVT',
2404: x_return_status);
2405: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2406: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2407: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2408: RAISE OKC_API.G_EXCEPTION_ERROR;
2409: END IF;
2402: p_init_msg_list,
2403: '_PVT',
2404: x_return_status);
2405: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2406: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2407: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2408: RAISE OKC_API.G_EXCEPTION_ERROR;
2409: END IF;
2410: BEGIN
2403: '_PVT',
2404: x_return_status);
2405: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2406: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2407: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2408: RAISE OKC_API.G_EXCEPTION_ERROR;
2409: END IF;
2410: BEGIN
2411:
2404: x_return_status);
2405: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2406: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2407: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2408: RAISE OKC_API.G_EXCEPTION_ERROR;
2409: END IF;
2410: BEGIN
2411:
2412: IF (l_debug = 'Y') THEN
2434:
2435: IF (lock_csr%ISOPEN) THEN
2436: CLOSE lock_csr;
2437: END IF;
2438: OKC_API.set_message(G_FND_APP,G_FORM_UNABLE_TO_RESERVE_REC);
2439: RAISE APP_EXCEPTIONS.RECORD_LOCK_EXCEPTION;
2440: END;
2441:
2442: IF ( l_row_notfound ) THEN
2445: lc_row_notfound := lchk_csr%NOTFOUND;
2446: CLOSE lchk_csr;
2447: END IF;
2448: IF (lc_row_notfound) THEN
2449: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
2450: RAISE OKC_API.G_EXCEPTION_ERROR;
2451: ELSIF lc_object_version_number > p_ctc_rec.object_version_number THEN
2452: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2453: RAISE OKC_API.G_EXCEPTION_ERROR;
2446: CLOSE lchk_csr;
2447: END IF;
2448: IF (lc_row_notfound) THEN
2449: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
2450: RAISE OKC_API.G_EXCEPTION_ERROR;
2451: ELSIF lc_object_version_number > p_ctc_rec.object_version_number THEN
2452: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2453: RAISE OKC_API.G_EXCEPTION_ERROR;
2454: ELSIF lc_object_version_number <> p_ctc_rec.object_version_number THEN
2448: IF (lc_row_notfound) THEN
2449: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
2450: RAISE OKC_API.G_EXCEPTION_ERROR;
2451: ELSIF lc_object_version_number > p_ctc_rec.object_version_number THEN
2452: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2453: RAISE OKC_API.G_EXCEPTION_ERROR;
2454: ELSIF lc_object_version_number <> p_ctc_rec.object_version_number THEN
2455: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2456: RAISE OKC_API.G_EXCEPTION_ERROR;
2449: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
2450: RAISE OKC_API.G_EXCEPTION_ERROR;
2451: ELSIF lc_object_version_number > p_ctc_rec.object_version_number THEN
2452: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2453: RAISE OKC_API.G_EXCEPTION_ERROR;
2454: ELSIF lc_object_version_number <> p_ctc_rec.object_version_number THEN
2455: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2456: RAISE OKC_API.G_EXCEPTION_ERROR;
2457: ELSIF lc_object_version_number = -1 THEN
2451: ELSIF lc_object_version_number > p_ctc_rec.object_version_number THEN
2452: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2453: RAISE OKC_API.G_EXCEPTION_ERROR;
2454: ELSIF lc_object_version_number <> p_ctc_rec.object_version_number THEN
2455: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2456: RAISE OKC_API.G_EXCEPTION_ERROR;
2457: ELSIF lc_object_version_number = -1 THEN
2458: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
2459: RAISE OKC_API.G_EXCEPTION_ERROR;
2452: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2453: RAISE OKC_API.G_EXCEPTION_ERROR;
2454: ELSIF lc_object_version_number <> p_ctc_rec.object_version_number THEN
2455: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2456: RAISE OKC_API.G_EXCEPTION_ERROR;
2457: ELSIF lc_object_version_number = -1 THEN
2458: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
2459: RAISE OKC_API.G_EXCEPTION_ERROR;
2460: END IF;
2454: ELSIF lc_object_version_number <> p_ctc_rec.object_version_number THEN
2455: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2456: RAISE OKC_API.G_EXCEPTION_ERROR;
2457: ELSIF lc_object_version_number = -1 THEN
2458: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
2459: RAISE OKC_API.G_EXCEPTION_ERROR;
2460: END IF;
2461: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2462:
2455: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
2456: RAISE OKC_API.G_EXCEPTION_ERROR;
2457: ELSIF lc_object_version_number = -1 THEN
2458: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
2459: RAISE OKC_API.G_EXCEPTION_ERROR;
2460: END IF;
2461: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2462:
2463: IF (l_debug = 'Y') THEN
2457: ELSIF lc_object_version_number = -1 THEN
2458: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
2459: RAISE OKC_API.G_EXCEPTION_ERROR;
2460: END IF;
2461: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2462:
2463: IF (l_debug = 'Y') THEN
2464: okc_debug.log('7800: Leaving lock_row', 2);
2465: okc_debug.Reset_Indentation;
2465: okc_debug.Reset_Indentation;
2466: END IF;
2467:
2468: EXCEPTION
2469: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2470:
2471: IF (l_debug = 'Y') THEN
2472: okc_debug.log('7900: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2473: okc_debug.Reset_Indentation;
2468: EXCEPTION
2469: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2470:
2471: IF (l_debug = 'Y') THEN
2472: okc_debug.log('7900: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2473: okc_debug.Reset_Indentation;
2474: END IF;
2475:
2476: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2472: okc_debug.log('7900: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2473: okc_debug.Reset_Indentation;
2474: END IF;
2475:
2476: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2477: (
2478: l_api_name,
2479: G_PKG_NAME,
2480: 'OKC_API.G_RET_STS_ERROR',
2476: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2477: (
2478: l_api_name,
2479: G_PKG_NAME,
2480: 'OKC_API.G_RET_STS_ERROR',
2481: x_msg_count,
2482: x_msg_data,
2483: '_PVT'
2484: );
2481: x_msg_count,
2482: x_msg_data,
2483: '_PVT'
2484: );
2485: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2486:
2487: IF (l_debug = 'Y') THEN
2488: okc_debug.log('8000: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2489: okc_debug.Reset_Indentation;
2484: );
2485: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2486:
2487: IF (l_debug = 'Y') THEN
2488: okc_debug.log('8000: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2489: okc_debug.Reset_Indentation;
2490: END IF;
2491:
2492: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2488: okc_debug.log('8000: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2489: okc_debug.Reset_Indentation;
2490: END IF;
2491:
2492: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2493: (
2494: l_api_name,
2495: G_PKG_NAME,
2496: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2492: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2493: (
2494: l_api_name,
2495: G_PKG_NAME,
2496: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2497: x_msg_count,
2498: x_msg_data,
2499: '_PVT'
2500: );
2504: okc_debug.log('8100: Exiting lock_row:OTHERS Exception', 2);
2505: okc_debug.Reset_Indentation;
2506: END IF;
2507:
2508: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2509: (
2510: l_api_name,
2511: G_PKG_NAME,
2512: 'OTHERS',
2528: p_ctcv_rec IN ctcv_rec_type) IS
2529:
2530: l_api_version CONSTANT NUMBER := 1;
2531: l_api_name CONSTANT VARCHAR2(30) := 'V_lock_row';
2532: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2533: l_ctc_rec ctc_rec_type;
2534: BEGIN
2535:
2536: IF (l_debug = 'Y') THEN
2537: okc_debug.Set_Indentation('OKC_CTC_PVT');
2538: okc_debug.log('8200: Entered lock_row', 2);
2539: END IF;
2540:
2541: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2542: G_PKG_NAME,
2543: p_init_msg_list,
2544: l_api_version,
2545: p_api_version,
2544: l_api_version,
2545: p_api_version,
2546: '_PVT',
2547: x_return_status);
2548: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2549: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2550: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2551: RAISE OKC_API.G_EXCEPTION_ERROR;
2552: END IF;
2545: p_api_version,
2546: '_PVT',
2547: x_return_status);
2548: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2549: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2550: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2551: RAISE OKC_API.G_EXCEPTION_ERROR;
2552: END IF;
2553: --------------------------------------
2546: '_PVT',
2547: x_return_status);
2548: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2549: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2550: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2551: RAISE OKC_API.G_EXCEPTION_ERROR;
2552: END IF;
2553: --------------------------------------
2554: -- Move VIEW record to "Child" records
2547: x_return_status);
2548: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2549: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2550: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2551: RAISE OKC_API.G_EXCEPTION_ERROR;
2552: END IF;
2553: --------------------------------------
2554: -- Move VIEW record to "Child" records
2555: --------------------------------------
2563: x_msg_count,
2564: x_msg_data,
2565: l_ctc_rec
2566: );
2567: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2568: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2569: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2570: RAISE OKC_API.G_EXCEPTION_ERROR;
2571: END IF;
2564: x_msg_data,
2565: l_ctc_rec
2566: );
2567: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2568: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2569: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2570: RAISE OKC_API.G_EXCEPTION_ERROR;
2571: END IF;
2572: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2565: l_ctc_rec
2566: );
2567: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2568: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2569: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2570: RAISE OKC_API.G_EXCEPTION_ERROR;
2571: END IF;
2572: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2573:
2566: );
2567: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2568: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2569: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2570: RAISE OKC_API.G_EXCEPTION_ERROR;
2571: END IF;
2572: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2573:
2574: IF (l_debug = 'Y') THEN
2568: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2569: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2570: RAISE OKC_API.G_EXCEPTION_ERROR;
2571: END IF;
2572: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2573:
2574: IF (l_debug = 'Y') THEN
2575: okc_debug.log('8300: Leaving lock_row', 2);
2576: okc_debug.Reset_Indentation;
2576: okc_debug.Reset_Indentation;
2577: END IF;
2578:
2579: EXCEPTION
2580: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2581:
2582: IF (l_debug = 'Y') THEN
2583: okc_debug.log('8400: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2584: okc_debug.Reset_Indentation;
2579: EXCEPTION
2580: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2581:
2582: IF (l_debug = 'Y') THEN
2583: okc_debug.log('8400: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2584: okc_debug.Reset_Indentation;
2585: END IF;
2586:
2587: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2583: okc_debug.log('8400: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2584: okc_debug.Reset_Indentation;
2585: END IF;
2586:
2587: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2588: (
2589: l_api_name,
2590: G_PKG_NAME,
2591: 'OKC_API.G_RET_STS_ERROR',
2587: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2588: (
2589: l_api_name,
2590: G_PKG_NAME,
2591: 'OKC_API.G_RET_STS_ERROR',
2592: x_msg_count,
2593: x_msg_data,
2594: '_PVT'
2595: );
2592: x_msg_count,
2593: x_msg_data,
2594: '_PVT'
2595: );
2596: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2597:
2598: IF (l_debug = 'Y') THEN
2599: okc_debug.log('8500: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2600: okc_debug.Reset_Indentation;
2595: );
2596: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2597:
2598: IF (l_debug = 'Y') THEN
2599: okc_debug.log('8500: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2600: okc_debug.Reset_Indentation;
2601: END IF;
2602:
2603: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2599: okc_debug.log('8500: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2600: okc_debug.Reset_Indentation;
2601: END IF;
2602:
2603: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2604: (
2605: l_api_name,
2606: G_PKG_NAME,
2607: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2603: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2604: (
2605: l_api_name,
2606: G_PKG_NAME,
2607: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2608: x_msg_count,
2609: x_msg_data,
2610: '_PVT'
2611: );
2615: okc_debug.log('8600: Exiting lock_row:OTHERS Exception', 2);
2616: okc_debug.Reset_Indentation;
2617: END IF;
2618:
2619: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2620: (
2621: l_api_name,
2622: G_PKG_NAME,
2623: 'OTHERS',
2639: p_ctcv_tbl IN ctcv_tbl_type) IS
2640:
2641: l_api_version CONSTANT NUMBER := 1;
2642: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_lock_row';
2643: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2644: i NUMBER := 0;
2645: BEGIN
2646:
2647: IF (l_debug = 'Y') THEN
2648: okc_debug.Set_Indentation('OKC_CTC_PVT');
2649: okc_debug.log('8700: Entered lock_row', 2);
2650: END IF;
2651:
2652: OKC_API.init_msg_list(p_init_msg_list);
2653: -- Make sure PL/SQL table has records in it before passing
2654: IF (p_ctcv_tbl.COUNT > 0) THEN
2655: i := p_ctcv_tbl.FIRST;
2656: LOOP
2655: i := p_ctcv_tbl.FIRST;
2656: LOOP
2657: lock_row (
2658: p_api_version => p_api_version,
2659: p_init_msg_list => OKC_API.G_FALSE,
2660: x_return_status => x_return_status,
2661: x_msg_count => x_msg_count,
2662: x_msg_data => x_msg_data,
2663: p_ctcv_rec => p_ctcv_tbl(i));
2671: okc_debug.Reset_Indentation;
2672: END IF;
2673:
2674: EXCEPTION
2675: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2676:
2677: IF (l_debug = 'Y') THEN
2678: okc_debug.log('8900: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2679: okc_debug.Reset_Indentation;
2674: EXCEPTION
2675: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2676:
2677: IF (l_debug = 'Y') THEN
2678: okc_debug.log('8900: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2679: okc_debug.Reset_Indentation;
2680: END IF;
2681:
2682: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2678: okc_debug.log('8900: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2679: okc_debug.Reset_Indentation;
2680: END IF;
2681:
2682: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2683: (
2684: l_api_name,
2685: G_PKG_NAME,
2686: 'OKC_API.G_RET_STS_ERROR',
2682: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2683: (
2684: l_api_name,
2685: G_PKG_NAME,
2686: 'OKC_API.G_RET_STS_ERROR',
2687: x_msg_count,
2688: x_msg_data,
2689: '_PVT'
2690: );
2687: x_msg_count,
2688: x_msg_data,
2689: '_PVT'
2690: );
2691: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2692:
2693: IF (l_debug = 'Y') THEN
2694: okc_debug.log('9000: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2695: okc_debug.Reset_Indentation;
2690: );
2691: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2692:
2693: IF (l_debug = 'Y') THEN
2694: okc_debug.log('9000: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2695: okc_debug.Reset_Indentation;
2696: END IF;
2697:
2698: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2694: okc_debug.log('9000: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2695: okc_debug.Reset_Indentation;
2696: END IF;
2697:
2698: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2699: (
2700: l_api_name,
2701: G_PKG_NAME,
2702: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2698: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2699: (
2700: l_api_name,
2701: G_PKG_NAME,
2702: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2703: x_msg_count,
2704: x_msg_data,
2705: '_PVT'
2706: );
2710: okc_debug.log('9100: Exiting lock_row:OTHERS Exception', 2);
2711: okc_debug.Reset_Indentation;
2712: END IF;
2713:
2714: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2715: (
2716: l_api_name,
2717: G_PKG_NAME,
2718: 'OTHERS',
2738: x_ctc_rec OUT NOCOPY ctc_rec_type) IS
2739:
2740: l_api_version CONSTANT NUMBER := 1;
2741: l_api_name CONSTANT VARCHAR2(30) := 'CONTACTS_update_row';
2742: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2743: l_ctc_rec ctc_rec_type := p_ctc_rec;
2744: l_def_ctc_rec ctc_rec_type;
2745: l_row_notfound BOOLEAN := TRUE;
2746:
2763: x_ctc_rec OUT NOCOPY ctc_rec_type
2764: ) RETURN VARCHAR2 IS
2765: l_ctc_rec ctc_rec_type;
2766: l_row_notfound BOOLEAN := TRUE;
2767: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2768: BEGIN
2769:
2770: IF (l_debug = 'Y') THEN
2771: okc_debug.Set_Indentation('OKC_CTC_PVT');
2775: x_ctc_rec := p_ctc_rec;
2776: -- Get current database values
2777: l_ctc_rec := get_rec(p_ctc_rec, l_row_notfound);
2778: IF (l_row_notfound) THEN
2779: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2780: END IF;
2781: IF (x_ctc_rec.id = OKC_API.G_MISS_NUM)
2782: THEN
2783: x_ctc_rec.id := l_ctc_rec.id;
2777: l_ctc_rec := get_rec(p_ctc_rec, l_row_notfound);
2778: IF (l_row_notfound) THEN
2779: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2780: END IF;
2781: IF (x_ctc_rec.id = OKC_API.G_MISS_NUM)
2782: THEN
2783: x_ctc_rec.id := l_ctc_rec.id;
2784: END IF;
2785: IF (x_ctc_rec.cpl_id = OKC_API.G_MISS_NUM)
2781: IF (x_ctc_rec.id = OKC_API.G_MISS_NUM)
2782: THEN
2783: x_ctc_rec.id := l_ctc_rec.id;
2784: END IF;
2785: IF (x_ctc_rec.cpl_id = OKC_API.G_MISS_NUM)
2786: THEN
2787: x_ctc_rec.cpl_id := l_ctc_rec.cpl_id;
2788: END IF;
2789: IF (x_ctc_rec.cro_code = OKC_API.G_MISS_CHAR)
2785: IF (x_ctc_rec.cpl_id = OKC_API.G_MISS_NUM)
2786: THEN
2787: x_ctc_rec.cpl_id := l_ctc_rec.cpl_id;
2788: END IF;
2789: IF (x_ctc_rec.cro_code = OKC_API.G_MISS_CHAR)
2790: THEN
2791: x_ctc_rec.cro_code := l_ctc_rec.cro_code;
2792: END IF;
2793: IF (x_ctc_rec.dnz_chr_id = OKC_API.G_MISS_NUM)
2789: IF (x_ctc_rec.cro_code = OKC_API.G_MISS_CHAR)
2790: THEN
2791: x_ctc_rec.cro_code := l_ctc_rec.cro_code;
2792: END IF;
2793: IF (x_ctc_rec.dnz_chr_id = OKC_API.G_MISS_NUM)
2794: THEN
2795: x_ctc_rec.dnz_chr_id := l_ctc_rec.dnz_chr_id;
2796: END IF;
2797: IF (x_ctc_rec.object1_id1 = OKC_API.G_MISS_CHAR)
2793: IF (x_ctc_rec.dnz_chr_id = OKC_API.G_MISS_NUM)
2794: THEN
2795: x_ctc_rec.dnz_chr_id := l_ctc_rec.dnz_chr_id;
2796: END IF;
2797: IF (x_ctc_rec.object1_id1 = OKC_API.G_MISS_CHAR)
2798: THEN
2799: x_ctc_rec.object1_id1 := l_ctc_rec.object1_id1;
2800: END IF;
2801: IF (x_ctc_rec.object1_id2 = OKC_API.G_MISS_CHAR)
2797: IF (x_ctc_rec.object1_id1 = OKC_API.G_MISS_CHAR)
2798: THEN
2799: x_ctc_rec.object1_id1 := l_ctc_rec.object1_id1;
2800: END IF;
2801: IF (x_ctc_rec.object1_id2 = OKC_API.G_MISS_CHAR)
2802: THEN
2803: x_ctc_rec.object1_id2 := l_ctc_rec.object1_id2;
2804: END IF;
2805: IF (x_ctc_rec.jtot_object1_code = OKC_API.G_MISS_CHAR)
2801: IF (x_ctc_rec.object1_id2 = OKC_API.G_MISS_CHAR)
2802: THEN
2803: x_ctc_rec.object1_id2 := l_ctc_rec.object1_id2;
2804: END IF;
2805: IF (x_ctc_rec.jtot_object1_code = OKC_API.G_MISS_CHAR)
2806: THEN
2807: x_ctc_rec.JTOT_OBJECT1_CODE := l_ctc_rec.JTOT_OBJECT1_CODE;
2808: END IF;
2809: IF (x_ctc_rec.object_version_number = OKC_API.G_MISS_NUM)
2805: IF (x_ctc_rec.jtot_object1_code = OKC_API.G_MISS_CHAR)
2806: THEN
2807: x_ctc_rec.JTOT_OBJECT1_CODE := l_ctc_rec.JTOT_OBJECT1_CODE;
2808: END IF;
2809: IF (x_ctc_rec.object_version_number = OKC_API.G_MISS_NUM)
2810: THEN
2811: x_ctc_rec.object_version_number := l_ctc_rec.object_version_number;
2812: END IF;
2813: IF (x_ctc_rec.created_by = OKC_API.G_MISS_NUM)
2809: IF (x_ctc_rec.object_version_number = OKC_API.G_MISS_NUM)
2810: THEN
2811: x_ctc_rec.object_version_number := l_ctc_rec.object_version_number;
2812: END IF;
2813: IF (x_ctc_rec.created_by = OKC_API.G_MISS_NUM)
2814: THEN
2815: x_ctc_rec.created_by := l_ctc_rec.created_by;
2816: END IF;
2817: IF (x_ctc_rec.creation_date = OKC_API.G_MISS_DATE)
2813: IF (x_ctc_rec.created_by = OKC_API.G_MISS_NUM)
2814: THEN
2815: x_ctc_rec.created_by := l_ctc_rec.created_by;
2816: END IF;
2817: IF (x_ctc_rec.creation_date = OKC_API.G_MISS_DATE)
2818: THEN
2819: x_ctc_rec.creation_date := l_ctc_rec.creation_date;
2820: END IF;
2821: IF (x_ctc_rec.last_updated_by = OKC_API.G_MISS_NUM)
2817: IF (x_ctc_rec.creation_date = OKC_API.G_MISS_DATE)
2818: THEN
2819: x_ctc_rec.creation_date := l_ctc_rec.creation_date;
2820: END IF;
2821: IF (x_ctc_rec.last_updated_by = OKC_API.G_MISS_NUM)
2822: THEN
2823: x_ctc_rec.last_updated_by := l_ctc_rec.last_updated_by;
2824: END IF;
2825: IF (x_ctc_rec.last_update_date = OKC_API.G_MISS_DATE)
2821: IF (x_ctc_rec.last_updated_by = OKC_API.G_MISS_NUM)
2822: THEN
2823: x_ctc_rec.last_updated_by := l_ctc_rec.last_updated_by;
2824: END IF;
2825: IF (x_ctc_rec.last_update_date = OKC_API.G_MISS_DATE)
2826: THEN
2827: x_ctc_rec.last_update_date := l_ctc_rec.last_update_date;
2828: END IF;
2829: IF (x_ctc_rec.contact_sequence = OKC_API.G_MISS_NUM)
2825: IF (x_ctc_rec.last_update_date = OKC_API.G_MISS_DATE)
2826: THEN
2827: x_ctc_rec.last_update_date := l_ctc_rec.last_update_date;
2828: END IF;
2829: IF (x_ctc_rec.contact_sequence = OKC_API.G_MISS_NUM)
2830: THEN
2831: x_ctc_rec.contact_sequence := l_ctc_rec.contact_sequence;
2832: END IF;
2833: IF (x_ctc_rec.last_update_login = OKC_API.G_MISS_NUM)
2829: IF (x_ctc_rec.contact_sequence = OKC_API.G_MISS_NUM)
2830: THEN
2831: x_ctc_rec.contact_sequence := l_ctc_rec.contact_sequence;
2832: END IF;
2833: IF (x_ctc_rec.last_update_login = OKC_API.G_MISS_NUM)
2834: THEN
2835: x_ctc_rec.last_update_login := l_ctc_rec.last_update_login;
2836: END IF;
2837: IF (x_ctc_rec.primary_yn = OKC_API.G_MISS_CHAR)
2833: IF (x_ctc_rec.last_update_login = OKC_API.G_MISS_NUM)
2834: THEN
2835: x_ctc_rec.last_update_login := l_ctc_rec.last_update_login;
2836: END IF;
2837: IF (x_ctc_rec.primary_yn = OKC_API.G_MISS_CHAR)
2838: THEN
2839: x_ctc_rec.primary_yn := l_ctc_rec.primary_yn;
2840: END IF;
2841: --
2838: THEN
2839: x_ctc_rec.primary_yn := l_ctc_rec.primary_yn;
2840: END IF;
2841: --
2842: IF (x_ctc_rec.resource_class = OKC_API.G_MISS_CHAR)
2843: THEN
2844: x_ctc_rec.resource_class := l_ctc_rec.resource_class;
2845: END IF;
2846: --
2843: THEN
2844: x_ctc_rec.resource_class := l_ctc_rec.resource_class;
2845: END IF;
2846: --
2847: IF (x_ctc_rec.SALES_GROUP_ID = OKC_API.G_MISS_NUM)
2848: THEN
2849: x_ctc_rec.SALES_GROUP_ID :=l_ctc_rec.SALES_GROUP_ID;
2850: END IF;
2851: --
2848: THEN
2849: x_ctc_rec.SALES_GROUP_ID :=l_ctc_rec.SALES_GROUP_ID;
2850: END IF;
2851: --
2852: IF (x_ctc_rec.attribute_category = OKC_API.G_MISS_CHAR)
2853: THEN
2854: x_ctc_rec.attribute_category := l_ctc_rec.attribute_category;
2855: END IF;
2856: IF (x_ctc_rec.attribute1 = OKC_API.G_MISS_CHAR)
2852: IF (x_ctc_rec.attribute_category = OKC_API.G_MISS_CHAR)
2853: THEN
2854: x_ctc_rec.attribute_category := l_ctc_rec.attribute_category;
2855: END IF;
2856: IF (x_ctc_rec.attribute1 = OKC_API.G_MISS_CHAR)
2857: THEN
2858: x_ctc_rec.attribute1 := l_ctc_rec.attribute1;
2859: END IF;
2860: IF (x_ctc_rec.attribute2 = OKC_API.G_MISS_CHAR)
2856: IF (x_ctc_rec.attribute1 = OKC_API.G_MISS_CHAR)
2857: THEN
2858: x_ctc_rec.attribute1 := l_ctc_rec.attribute1;
2859: END IF;
2860: IF (x_ctc_rec.attribute2 = OKC_API.G_MISS_CHAR)
2861: THEN
2862: x_ctc_rec.attribute2 := l_ctc_rec.attribute2;
2863: END IF;
2864: IF (x_ctc_rec.attribute3 = OKC_API.G_MISS_CHAR)
2860: IF (x_ctc_rec.attribute2 = OKC_API.G_MISS_CHAR)
2861: THEN
2862: x_ctc_rec.attribute2 := l_ctc_rec.attribute2;
2863: END IF;
2864: IF (x_ctc_rec.attribute3 = OKC_API.G_MISS_CHAR)
2865: THEN
2866: x_ctc_rec.attribute3 := l_ctc_rec.attribute3;
2867: END IF;
2868: IF (x_ctc_rec.attribute4 = OKC_API.G_MISS_CHAR)
2864: IF (x_ctc_rec.attribute3 = OKC_API.G_MISS_CHAR)
2865: THEN
2866: x_ctc_rec.attribute3 := l_ctc_rec.attribute3;
2867: END IF;
2868: IF (x_ctc_rec.attribute4 = OKC_API.G_MISS_CHAR)
2869: THEN
2870: x_ctc_rec.attribute4 := l_ctc_rec.attribute4;
2871: END IF;
2872: IF (x_ctc_rec.attribute5 = OKC_API.G_MISS_CHAR)
2868: IF (x_ctc_rec.attribute4 = OKC_API.G_MISS_CHAR)
2869: THEN
2870: x_ctc_rec.attribute4 := l_ctc_rec.attribute4;
2871: END IF;
2872: IF (x_ctc_rec.attribute5 = OKC_API.G_MISS_CHAR)
2873: THEN
2874: x_ctc_rec.attribute5 := l_ctc_rec.attribute5;
2875: END IF;
2876: IF (x_ctc_rec.attribute6 = OKC_API.G_MISS_CHAR)
2872: IF (x_ctc_rec.attribute5 = OKC_API.G_MISS_CHAR)
2873: THEN
2874: x_ctc_rec.attribute5 := l_ctc_rec.attribute5;
2875: END IF;
2876: IF (x_ctc_rec.attribute6 = OKC_API.G_MISS_CHAR)
2877: THEN
2878: x_ctc_rec.attribute6 := l_ctc_rec.attribute6;
2879: END IF;
2880: IF (x_ctc_rec.attribute7 = OKC_API.G_MISS_CHAR)
2876: IF (x_ctc_rec.attribute6 = OKC_API.G_MISS_CHAR)
2877: THEN
2878: x_ctc_rec.attribute6 := l_ctc_rec.attribute6;
2879: END IF;
2880: IF (x_ctc_rec.attribute7 = OKC_API.G_MISS_CHAR)
2881: THEN
2882: x_ctc_rec.attribute7 := l_ctc_rec.attribute7;
2883: END IF;
2884: IF (x_ctc_rec.attribute8 = OKC_API.G_MISS_CHAR)
2880: IF (x_ctc_rec.attribute7 = OKC_API.G_MISS_CHAR)
2881: THEN
2882: x_ctc_rec.attribute7 := l_ctc_rec.attribute7;
2883: END IF;
2884: IF (x_ctc_rec.attribute8 = OKC_API.G_MISS_CHAR)
2885: THEN
2886: x_ctc_rec.attribute8 := l_ctc_rec.attribute8;
2887: END IF;
2888: IF (x_ctc_rec.attribute9 = OKC_API.G_MISS_CHAR)
2884: IF (x_ctc_rec.attribute8 = OKC_API.G_MISS_CHAR)
2885: THEN
2886: x_ctc_rec.attribute8 := l_ctc_rec.attribute8;
2887: END IF;
2888: IF (x_ctc_rec.attribute9 = OKC_API.G_MISS_CHAR)
2889: THEN
2890: x_ctc_rec.attribute9 := l_ctc_rec.attribute9;
2891: END IF;
2892: IF (x_ctc_rec.attribute10 = OKC_API.G_MISS_CHAR)
2888: IF (x_ctc_rec.attribute9 = OKC_API.G_MISS_CHAR)
2889: THEN
2890: x_ctc_rec.attribute9 := l_ctc_rec.attribute9;
2891: END IF;
2892: IF (x_ctc_rec.attribute10 = OKC_API.G_MISS_CHAR)
2893: THEN
2894: x_ctc_rec.attribute10 := l_ctc_rec.attribute10;
2895: END IF;
2896: IF (x_ctc_rec.attribute11 = OKC_API.G_MISS_CHAR)
2892: IF (x_ctc_rec.attribute10 = OKC_API.G_MISS_CHAR)
2893: THEN
2894: x_ctc_rec.attribute10 := l_ctc_rec.attribute10;
2895: END IF;
2896: IF (x_ctc_rec.attribute11 = OKC_API.G_MISS_CHAR)
2897: THEN
2898: x_ctc_rec.attribute11 := l_ctc_rec.attribute11;
2899: END IF;
2900: IF (x_ctc_rec.attribute12 = OKC_API.G_MISS_CHAR)
2896: IF (x_ctc_rec.attribute11 = OKC_API.G_MISS_CHAR)
2897: THEN
2898: x_ctc_rec.attribute11 := l_ctc_rec.attribute11;
2899: END IF;
2900: IF (x_ctc_rec.attribute12 = OKC_API.G_MISS_CHAR)
2901: THEN
2902: x_ctc_rec.attribute12 := l_ctc_rec.attribute12;
2903: END IF;
2904: IF (x_ctc_rec.attribute13 = OKC_API.G_MISS_CHAR)
2900: IF (x_ctc_rec.attribute12 = OKC_API.G_MISS_CHAR)
2901: THEN
2902: x_ctc_rec.attribute12 := l_ctc_rec.attribute12;
2903: END IF;
2904: IF (x_ctc_rec.attribute13 = OKC_API.G_MISS_CHAR)
2905: THEN
2906: x_ctc_rec.attribute13 := l_ctc_rec.attribute13;
2907: END IF;
2908: IF (x_ctc_rec.attribute14 = OKC_API.G_MISS_CHAR)
2904: IF (x_ctc_rec.attribute13 = OKC_API.G_MISS_CHAR)
2905: THEN
2906: x_ctc_rec.attribute13 := l_ctc_rec.attribute13;
2907: END IF;
2908: IF (x_ctc_rec.attribute14 = OKC_API.G_MISS_CHAR)
2909: THEN
2910: x_ctc_rec.attribute14 := l_ctc_rec.attribute14;
2911: END IF;
2912: IF (x_ctc_rec.attribute15 = OKC_API.G_MISS_CHAR)
2908: IF (x_ctc_rec.attribute14 = OKC_API.G_MISS_CHAR)
2909: THEN
2910: x_ctc_rec.attribute14 := l_ctc_rec.attribute14;
2911: END IF;
2912: IF (x_ctc_rec.attribute15 = OKC_API.G_MISS_CHAR)
2913: THEN
2914: x_ctc_rec.attribute15 := l_ctc_rec.attribute15;
2915: END IF;
2916:
2913: THEN
2914: x_ctc_rec.attribute15 := l_ctc_rec.attribute15;
2915: END IF;
2916:
2917: IF (x_ctc_rec.start_date = OKC_API.G_MISS_DATE)
2918: THEN
2919: x_ctc_rec.start_date := l_ctc_rec.start_date;
2920: END IF;
2921:
2918: THEN
2919: x_ctc_rec.start_date := l_ctc_rec.start_date;
2920: END IF;
2921:
2922: IF (x_ctc_rec.end_date = OKC_API.G_MISS_DATE)
2923: THEN
2924: x_ctc_rec.end_date := l_ctc_rec.end_date;
2925: END IF;
2926:
2938: FUNCTION Set_Attributes (
2939: p_ctc_rec IN ctc_rec_type,
2940: x_ctc_rec OUT NOCOPY ctc_rec_type
2941: ) RETURN VARCHAR2 IS
2942: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2943: BEGIN
2944:
2945: x_ctc_rec := p_ctc_rec;
2946:
2953: okc_debug.Set_Indentation('OKC_CTC_PVT');
2954: okc_debug.log('9400: Entered update_row', 2);
2955: END IF;
2956:
2957: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2958: p_init_msg_list,
2959: '_PVT',
2960: x_return_status);
2961: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2957: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2958: p_init_msg_list,
2959: '_PVT',
2960: x_return_status);
2961: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2962: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2963: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2964: RAISE OKC_API.G_EXCEPTION_ERROR;
2965: END IF;
2958: p_init_msg_list,
2959: '_PVT',
2960: x_return_status);
2961: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2962: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2963: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2964: RAISE OKC_API.G_EXCEPTION_ERROR;
2965: END IF;
2966: --- Setting item attributes
2959: '_PVT',
2960: x_return_status);
2961: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2962: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2963: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2964: RAISE OKC_API.G_EXCEPTION_ERROR;
2965: END IF;
2966: --- Setting item attributes
2967: l_return_status := Set_Attributes(
2960: x_return_status);
2961: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2962: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2963: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2964: RAISE OKC_API.G_EXCEPTION_ERROR;
2965: END IF;
2966: --- Setting item attributes
2967: l_return_status := Set_Attributes(
2968: p_ctc_rec, -- IN
2967: l_return_status := Set_Attributes(
2968: p_ctc_rec, -- IN
2969: l_ctc_rec); -- OUT
2970: --- If any errors happen abort API
2971: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2972: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2973: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2974: RAISE OKC_API.G_EXCEPTION_ERROR;
2975: END IF;
2968: p_ctc_rec, -- IN
2969: l_ctc_rec); -- OUT
2970: --- If any errors happen abort API
2971: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2972: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2973: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2974: RAISE OKC_API.G_EXCEPTION_ERROR;
2975: END IF;
2976: l_return_status := populate_new_record(l_ctc_rec, l_def_ctc_rec);
2969: l_ctc_rec); -- OUT
2970: --- If any errors happen abort API
2971: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2972: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2973: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2974: RAISE OKC_API.G_EXCEPTION_ERROR;
2975: END IF;
2976: l_return_status := populate_new_record(l_ctc_rec, l_def_ctc_rec);
2977: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2970: --- If any errors happen abort API
2971: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2972: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2973: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2974: RAISE OKC_API.G_EXCEPTION_ERROR;
2975: END IF;
2976: l_return_status := populate_new_record(l_ctc_rec, l_def_ctc_rec);
2977: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2978: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2973: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2974: RAISE OKC_API.G_EXCEPTION_ERROR;
2975: END IF;
2976: l_return_status := populate_new_record(l_ctc_rec, l_def_ctc_rec);
2977: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2978: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2979: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2980: RAISE OKC_API.G_EXCEPTION_ERROR;
2981: END IF;
2974: RAISE OKC_API.G_EXCEPTION_ERROR;
2975: END IF;
2976: l_return_status := populate_new_record(l_ctc_rec, l_def_ctc_rec);
2977: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2978: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2979: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2980: RAISE OKC_API.G_EXCEPTION_ERROR;
2981: END IF;
2982: /*bugfix for 6882512*/
2975: END IF;
2976: l_return_status := populate_new_record(l_ctc_rec, l_def_ctc_rec);
2977: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2978: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2979: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2980: RAISE OKC_API.G_EXCEPTION_ERROR;
2981: END IF;
2982: /*bugfix for 6882512*/
2983: OPEN get_k_status(l_def_ctc_rec.dnz_chr_id);
2976: l_return_status := populate_new_record(l_ctc_rec, l_def_ctc_rec);
2977: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2978: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2979: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2980: RAISE OKC_API.G_EXCEPTION_ERROR;
2981: END IF;
2982: /*bugfix for 6882512*/
2983: OPEN get_k_status(l_def_ctc_rec.dnz_chr_id);
2984: FETCH get_k_status INTO l_ste_code;
3022: DNZ_STE_CODE = l_ste_code
3023: WHERE ID = l_def_ctc_rec.id;
3024:
3025: x_ctc_rec := l_def_ctc_rec;
3026: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3027:
3028: IF (l_debug = 'Y') THEN
3029: okc_debug.log('9500: Leaving update_row', 2);
3030: okc_debug.Reset_Indentation;
3030: okc_debug.Reset_Indentation;
3031: END IF;
3032:
3033: EXCEPTION
3034: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3035:
3036: IF (l_debug = 'Y') THEN
3037: okc_debug.log('9600: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3038: okc_debug.Reset_Indentation;
3033: EXCEPTION
3034: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3035:
3036: IF (l_debug = 'Y') THEN
3037: okc_debug.log('9600: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3038: okc_debug.Reset_Indentation;
3039: END IF;
3040:
3041: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3037: okc_debug.log('9600: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3038: okc_debug.Reset_Indentation;
3039: END IF;
3040:
3041: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3042: (
3043: l_api_name,
3044: G_PKG_NAME,
3045: 'OKC_API.G_RET_STS_ERROR',
3041: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3042: (
3043: l_api_name,
3044: G_PKG_NAME,
3045: 'OKC_API.G_RET_STS_ERROR',
3046: x_msg_count,
3047: x_msg_data,
3048: '_PVT'
3049: );
3046: x_msg_count,
3047: x_msg_data,
3048: '_PVT'
3049: );
3050: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3051:
3052: IF (l_debug = 'Y') THEN
3053: okc_debug.log('9700: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3054: okc_debug.Reset_Indentation;
3049: );
3050: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3051:
3052: IF (l_debug = 'Y') THEN
3053: okc_debug.log('9700: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3054: okc_debug.Reset_Indentation;
3055: END IF;
3056:
3057: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3053: okc_debug.log('9700: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3054: okc_debug.Reset_Indentation;
3055: END IF;
3056:
3057: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3058: (
3059: l_api_name,
3060: G_PKG_NAME,
3061: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3057: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3058: (
3059: l_api_name,
3060: G_PKG_NAME,
3061: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3062: x_msg_count,
3063: x_msg_data,
3064: '_PVT'
3065: );
3069: okc_debug.log('9800: Exiting update_row:OTHERS Exception', 2);
3070: okc_debug.Reset_Indentation;
3071: END IF;
3072:
3073: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3074: (
3075: l_api_name,
3076: G_PKG_NAME,
3077: 'OTHERS',
3094: x_ctcv_rec OUT NOCOPY ctcv_rec_type) IS
3095:
3096: l_api_version CONSTANT NUMBER := 1;
3097: l_api_name CONSTANT VARCHAR2(30) := 'V_update_row';
3098: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3099: l_ctcv_rec ctcv_rec_type := p_ctcv_rec;
3100: l_def_ctcv_rec ctcv_rec_type;
3101: l_ctc_rec ctc_rec_type;
3102: lx_ctc_rec ctc_rec_type;
3124: x_ctcv_rec OUT NOCOPY ctcv_rec_type
3125: ) RETURN VARCHAR2 IS
3126: l_ctcv_rec ctcv_rec_type;
3127: l_row_notfound BOOLEAN := TRUE;
3128: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3129: BEGIN
3130:
3131: IF (l_debug = 'Y') THEN
3132: okc_debug.Set_Indentation('OKC_CTC_PVT');
3136: x_ctcv_rec := p_ctcv_rec;
3137: -- Get current database values
3138: l_ctcv_rec := get_rec(p_ctcv_rec, l_row_notfound);
3139: IF (l_row_notfound) THEN
3140: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
3141: END IF;
3142: IF (x_ctcv_rec.id = OKC_API.G_MISS_NUM)
3143: THEN
3144: x_ctcv_rec.id := l_ctcv_rec.id;
3138: l_ctcv_rec := get_rec(p_ctcv_rec, l_row_notfound);
3139: IF (l_row_notfound) THEN
3140: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
3141: END IF;
3142: IF (x_ctcv_rec.id = OKC_API.G_MISS_NUM)
3143: THEN
3144: x_ctcv_rec.id := l_ctcv_rec.id;
3145: END IF;
3146: IF (x_ctcv_rec.object_version_number = OKC_API.G_MISS_NUM)
3142: IF (x_ctcv_rec.id = OKC_API.G_MISS_NUM)
3143: THEN
3144: x_ctcv_rec.id := l_ctcv_rec.id;
3145: END IF;
3146: IF (x_ctcv_rec.object_version_number = OKC_API.G_MISS_NUM)
3147: THEN
3148: x_ctcv_rec.object_version_number := l_ctcv_rec.object_version_number;
3149: END IF;
3150: IF (x_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM)
3146: IF (x_ctcv_rec.object_version_number = OKC_API.G_MISS_NUM)
3147: THEN
3148: x_ctcv_rec.object_version_number := l_ctcv_rec.object_version_number;
3149: END IF;
3150: IF (x_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM)
3151: THEN
3152: x_ctcv_rec.cpl_id := l_ctcv_rec.cpl_id;
3153: END IF;
3154: IF (x_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR)
3150: IF (x_ctcv_rec.cpl_id = OKC_API.G_MISS_NUM)
3151: THEN
3152: x_ctcv_rec.cpl_id := l_ctcv_rec.cpl_id;
3153: END IF;
3154: IF (x_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR)
3155: THEN
3156: x_ctcv_rec.cro_code := l_ctcv_rec.cro_code;
3157: END IF;
3158: IF (x_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM)
3154: IF (x_ctcv_rec.cro_code = OKC_API.G_MISS_CHAR)
3155: THEN
3156: x_ctcv_rec.cro_code := l_ctcv_rec.cro_code;
3157: END IF;
3158: IF (x_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM)
3159: THEN
3160: x_ctcv_rec.dnz_chr_id := l_ctcv_rec.dnz_chr_id;
3161: END IF;
3162: IF (x_ctcv_rec.contact_sequence = OKC_API.G_MISS_NUM)
3158: IF (x_ctcv_rec.dnz_chr_id = OKC_API.G_MISS_NUM)
3159: THEN
3160: x_ctcv_rec.dnz_chr_id := l_ctcv_rec.dnz_chr_id;
3161: END IF;
3162: IF (x_ctcv_rec.contact_sequence = OKC_API.G_MISS_NUM)
3163: THEN
3164: x_ctcv_rec.contact_sequence := l_ctcv_rec.contact_sequence;
3165: END IF;
3166: IF (x_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR)
3162: IF (x_ctcv_rec.contact_sequence = OKC_API.G_MISS_NUM)
3163: THEN
3164: x_ctcv_rec.contact_sequence := l_ctcv_rec.contact_sequence;
3165: END IF;
3166: IF (x_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR)
3167: THEN
3168: x_ctcv_rec.object1_id1 := l_ctcv_rec.object1_id1;
3169: END IF;
3170: IF (x_ctcv_rec.object1_id2 = OKC_API.G_MISS_CHAR)
3166: IF (x_ctcv_rec.object1_id1 = OKC_API.G_MISS_CHAR)
3167: THEN
3168: x_ctcv_rec.object1_id1 := l_ctcv_rec.object1_id1;
3169: END IF;
3170: IF (x_ctcv_rec.object1_id2 = OKC_API.G_MISS_CHAR)
3171: THEN
3172: x_ctcv_rec.object1_id2 := l_ctcv_rec.object1_id2;
3173: END IF;
3174: IF (x_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR)
3170: IF (x_ctcv_rec.object1_id2 = OKC_API.G_MISS_CHAR)
3171: THEN
3172: x_ctcv_rec.object1_id2 := l_ctcv_rec.object1_id2;
3173: END IF;
3174: IF (x_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR)
3175: THEN
3176: x_ctcv_rec.JTOT_OBJECT1_CODE := l_ctcv_rec.JTOT_OBJECT1_CODE;
3177: END IF;
3178: IF (x_ctcv_rec.primary_yn = OKC_API.G_MISS_CHAR)
3174: IF (x_ctcv_rec.jtot_object1_code = OKC_API.G_MISS_CHAR)
3175: THEN
3176: x_ctcv_rec.JTOT_OBJECT1_CODE := l_ctcv_rec.JTOT_OBJECT1_CODE;
3177: END IF;
3178: IF (x_ctcv_rec.primary_yn = OKC_API.G_MISS_CHAR)
3179: THEN
3180: x_ctcv_rec.PRIMARY_YN := l_ctcv_rec.PRIMARY_YN;
3181: END IF;
3182: IF (x_ctcv_rec.RESOURCE_CLASS= OKC_API.G_MISS_CHAR)
3178: IF (x_ctcv_rec.primary_yn = OKC_API.G_MISS_CHAR)
3179: THEN
3180: x_ctcv_rec.PRIMARY_YN := l_ctcv_rec.PRIMARY_YN;
3181: END IF;
3182: IF (x_ctcv_rec.RESOURCE_CLASS= OKC_API.G_MISS_CHAR)
3183: THEN
3184: x_ctcv_rec.RESOURCE_CLASS := l_ctcv_rec.RESOURCE_CLASS;
3185: END IF;
3186: --
3183: THEN
3184: x_ctcv_rec.RESOURCE_CLASS := l_ctcv_rec.RESOURCE_CLASS;
3185: END IF;
3186: --
3187: IF (x_ctcv_rec.SALES_GROUP_ID = OKC_API.G_MISS_NUM) THEN
3188: x_ctcv_rec.SALES_GROUP_ID := l_ctcv_rec.SALES_GROUP_ID;
3189: END IF;
3190: --
3191: IF (x_ctcv_rec.attribute_category = OKC_API.G_MISS_CHAR)
3187: IF (x_ctcv_rec.SALES_GROUP_ID = OKC_API.G_MISS_NUM) THEN
3188: x_ctcv_rec.SALES_GROUP_ID := l_ctcv_rec.SALES_GROUP_ID;
3189: END IF;
3190: --
3191: IF (x_ctcv_rec.attribute_category = OKC_API.G_MISS_CHAR)
3192: THEN
3193: x_ctcv_rec.attribute_category := l_ctcv_rec.attribute_category;
3194: END IF;
3195: IF (x_ctcv_rec.attribute1 = OKC_API.G_MISS_CHAR)
3191: IF (x_ctcv_rec.attribute_category = OKC_API.G_MISS_CHAR)
3192: THEN
3193: x_ctcv_rec.attribute_category := l_ctcv_rec.attribute_category;
3194: END IF;
3195: IF (x_ctcv_rec.attribute1 = OKC_API.G_MISS_CHAR)
3196: THEN
3197: x_ctcv_rec.attribute1 := l_ctcv_rec.attribute1;
3198: END IF;
3199: IF (x_ctcv_rec.attribute2 = OKC_API.G_MISS_CHAR)
3195: IF (x_ctcv_rec.attribute1 = OKC_API.G_MISS_CHAR)
3196: THEN
3197: x_ctcv_rec.attribute1 := l_ctcv_rec.attribute1;
3198: END IF;
3199: IF (x_ctcv_rec.attribute2 = OKC_API.G_MISS_CHAR)
3200: THEN
3201: x_ctcv_rec.attribute2 := l_ctcv_rec.attribute2;
3202: END IF;
3203: IF (x_ctcv_rec.attribute3 = OKC_API.G_MISS_CHAR)
3199: IF (x_ctcv_rec.attribute2 = OKC_API.G_MISS_CHAR)
3200: THEN
3201: x_ctcv_rec.attribute2 := l_ctcv_rec.attribute2;
3202: END IF;
3203: IF (x_ctcv_rec.attribute3 = OKC_API.G_MISS_CHAR)
3204: THEN
3205: x_ctcv_rec.attribute3 := l_ctcv_rec.attribute3;
3206: END IF;
3207: IF (x_ctcv_rec.attribute4 = OKC_API.G_MISS_CHAR)
3203: IF (x_ctcv_rec.attribute3 = OKC_API.G_MISS_CHAR)
3204: THEN
3205: x_ctcv_rec.attribute3 := l_ctcv_rec.attribute3;
3206: END IF;
3207: IF (x_ctcv_rec.attribute4 = OKC_API.G_MISS_CHAR)
3208: THEN
3209: x_ctcv_rec.attribute4 := l_ctcv_rec.attribute4;
3210: END IF;
3211: IF (x_ctcv_rec.attribute5 = OKC_API.G_MISS_CHAR)
3207: IF (x_ctcv_rec.attribute4 = OKC_API.G_MISS_CHAR)
3208: THEN
3209: x_ctcv_rec.attribute4 := l_ctcv_rec.attribute4;
3210: END IF;
3211: IF (x_ctcv_rec.attribute5 = OKC_API.G_MISS_CHAR)
3212: THEN
3213: x_ctcv_rec.attribute5 := l_ctcv_rec.attribute5;
3214: END IF;
3215: IF (x_ctcv_rec.attribute6 = OKC_API.G_MISS_CHAR)
3211: IF (x_ctcv_rec.attribute5 = OKC_API.G_MISS_CHAR)
3212: THEN
3213: x_ctcv_rec.attribute5 := l_ctcv_rec.attribute5;
3214: END IF;
3215: IF (x_ctcv_rec.attribute6 = OKC_API.G_MISS_CHAR)
3216: THEN
3217: x_ctcv_rec.attribute6 := l_ctcv_rec.attribute6;
3218: END IF;
3219: IF (x_ctcv_rec.attribute7 = OKC_API.G_MISS_CHAR)
3215: IF (x_ctcv_rec.attribute6 = OKC_API.G_MISS_CHAR)
3216: THEN
3217: x_ctcv_rec.attribute6 := l_ctcv_rec.attribute6;
3218: END IF;
3219: IF (x_ctcv_rec.attribute7 = OKC_API.G_MISS_CHAR)
3220: THEN
3221: x_ctcv_rec.attribute7 := l_ctcv_rec.attribute7;
3222: END IF;
3223: IF (x_ctcv_rec.attribute8 = OKC_API.G_MISS_CHAR)
3219: IF (x_ctcv_rec.attribute7 = OKC_API.G_MISS_CHAR)
3220: THEN
3221: x_ctcv_rec.attribute7 := l_ctcv_rec.attribute7;
3222: END IF;
3223: IF (x_ctcv_rec.attribute8 = OKC_API.G_MISS_CHAR)
3224: THEN
3225: x_ctcv_rec.attribute8 := l_ctcv_rec.attribute8;
3226: END IF;
3227: IF (x_ctcv_rec.attribute9 = OKC_API.G_MISS_CHAR)
3223: IF (x_ctcv_rec.attribute8 = OKC_API.G_MISS_CHAR)
3224: THEN
3225: x_ctcv_rec.attribute8 := l_ctcv_rec.attribute8;
3226: END IF;
3227: IF (x_ctcv_rec.attribute9 = OKC_API.G_MISS_CHAR)
3228: THEN
3229: x_ctcv_rec.attribute9 := l_ctcv_rec.attribute9;
3230: END IF;
3231: IF (x_ctcv_rec.attribute10 = OKC_API.G_MISS_CHAR)
3227: IF (x_ctcv_rec.attribute9 = OKC_API.G_MISS_CHAR)
3228: THEN
3229: x_ctcv_rec.attribute9 := l_ctcv_rec.attribute9;
3230: END IF;
3231: IF (x_ctcv_rec.attribute10 = OKC_API.G_MISS_CHAR)
3232: THEN
3233: x_ctcv_rec.attribute10 := l_ctcv_rec.attribute10;
3234: END IF;
3235: IF (x_ctcv_rec.attribute11 = OKC_API.G_MISS_CHAR)
3231: IF (x_ctcv_rec.attribute10 = OKC_API.G_MISS_CHAR)
3232: THEN
3233: x_ctcv_rec.attribute10 := l_ctcv_rec.attribute10;
3234: END IF;
3235: IF (x_ctcv_rec.attribute11 = OKC_API.G_MISS_CHAR)
3236: THEN
3237: x_ctcv_rec.attribute11 := l_ctcv_rec.attribute11;
3238: END IF;
3239: IF (x_ctcv_rec.attribute12 = OKC_API.G_MISS_CHAR)
3235: IF (x_ctcv_rec.attribute11 = OKC_API.G_MISS_CHAR)
3236: THEN
3237: x_ctcv_rec.attribute11 := l_ctcv_rec.attribute11;
3238: END IF;
3239: IF (x_ctcv_rec.attribute12 = OKC_API.G_MISS_CHAR)
3240: THEN
3241: x_ctcv_rec.attribute12 := l_ctcv_rec.attribute12;
3242: END IF;
3243: IF (x_ctcv_rec.attribute13 = OKC_API.G_MISS_CHAR)
3239: IF (x_ctcv_rec.attribute12 = OKC_API.G_MISS_CHAR)
3240: THEN
3241: x_ctcv_rec.attribute12 := l_ctcv_rec.attribute12;
3242: END IF;
3243: IF (x_ctcv_rec.attribute13 = OKC_API.G_MISS_CHAR)
3244: THEN
3245: x_ctcv_rec.attribute13 := l_ctcv_rec.attribute13;
3246: END IF;
3247: IF (x_ctcv_rec.attribute14 = OKC_API.G_MISS_CHAR)
3243: IF (x_ctcv_rec.attribute13 = OKC_API.G_MISS_CHAR)
3244: THEN
3245: x_ctcv_rec.attribute13 := l_ctcv_rec.attribute13;
3246: END IF;
3247: IF (x_ctcv_rec.attribute14 = OKC_API.G_MISS_CHAR)
3248: THEN
3249: x_ctcv_rec.attribute14 := l_ctcv_rec.attribute14;
3250: END IF;
3251: IF (x_ctcv_rec.attribute15 = OKC_API.G_MISS_CHAR)
3247: IF (x_ctcv_rec.attribute14 = OKC_API.G_MISS_CHAR)
3248: THEN
3249: x_ctcv_rec.attribute14 := l_ctcv_rec.attribute14;
3250: END IF;
3251: IF (x_ctcv_rec.attribute15 = OKC_API.G_MISS_CHAR)
3252: THEN
3253: x_ctcv_rec.attribute15 := l_ctcv_rec.attribute15;
3254: END IF;
3255: IF (x_ctcv_rec.created_by = OKC_API.G_MISS_NUM)
3251: IF (x_ctcv_rec.attribute15 = OKC_API.G_MISS_CHAR)
3252: THEN
3253: x_ctcv_rec.attribute15 := l_ctcv_rec.attribute15;
3254: END IF;
3255: IF (x_ctcv_rec.created_by = OKC_API.G_MISS_NUM)
3256: THEN
3257: x_ctcv_rec.created_by := l_ctcv_rec.created_by;
3258: END IF;
3259: IF (x_ctcv_rec.creation_date = OKC_API.G_MISS_DATE)
3255: IF (x_ctcv_rec.created_by = OKC_API.G_MISS_NUM)
3256: THEN
3257: x_ctcv_rec.created_by := l_ctcv_rec.created_by;
3258: END IF;
3259: IF (x_ctcv_rec.creation_date = OKC_API.G_MISS_DATE)
3260: THEN
3261: x_ctcv_rec.creation_date := l_ctcv_rec.creation_date;
3262: END IF;
3263: IF (x_ctcv_rec.last_updated_by = OKC_API.G_MISS_NUM)
3259: IF (x_ctcv_rec.creation_date = OKC_API.G_MISS_DATE)
3260: THEN
3261: x_ctcv_rec.creation_date := l_ctcv_rec.creation_date;
3262: END IF;
3263: IF (x_ctcv_rec.last_updated_by = OKC_API.G_MISS_NUM)
3264: THEN
3265: x_ctcv_rec.last_updated_by := l_ctcv_rec.last_updated_by;
3266: END IF;
3267: IF (x_ctcv_rec.last_update_date = OKC_API.G_MISS_DATE)
3263: IF (x_ctcv_rec.last_updated_by = OKC_API.G_MISS_NUM)
3264: THEN
3265: x_ctcv_rec.last_updated_by := l_ctcv_rec.last_updated_by;
3266: END IF;
3267: IF (x_ctcv_rec.last_update_date = OKC_API.G_MISS_DATE)
3268: THEN
3269: x_ctcv_rec.last_update_date := l_ctcv_rec.last_update_date;
3270: END IF;
3271: IF (x_ctcv_rec.last_update_login = OKC_API.G_MISS_NUM)
3267: IF (x_ctcv_rec.last_update_date = OKC_API.G_MISS_DATE)
3268: THEN
3269: x_ctcv_rec.last_update_date := l_ctcv_rec.last_update_date;
3270: END IF;
3271: IF (x_ctcv_rec.last_update_login = OKC_API.G_MISS_NUM)
3272: THEN
3273: x_ctcv_rec.last_update_login := l_ctcv_rec.last_update_login;
3274: END IF;
3275: IF (x_ctcv_rec.start_date = OKC_API.G_MISS_DATE)
3271: IF (x_ctcv_rec.last_update_login = OKC_API.G_MISS_NUM)
3272: THEN
3273: x_ctcv_rec.last_update_login := l_ctcv_rec.last_update_login;
3274: END IF;
3275: IF (x_ctcv_rec.start_date = OKC_API.G_MISS_DATE)
3276: THEN
3277: x_ctcv_rec.start_date := l_ctcv_rec.start_date;
3278: END IF;
3279: IF (x_ctcv_rec.end_date = OKC_API.G_MISS_DATE)
3275: IF (x_ctcv_rec.start_date = OKC_API.G_MISS_DATE)
3276: THEN
3277: x_ctcv_rec.start_date := l_ctcv_rec.start_date;
3278: END IF;
3279: IF (x_ctcv_rec.end_date = OKC_API.G_MISS_DATE)
3280: THEN
3281: x_ctcv_rec.end_date := l_ctcv_rec.end_date;
3282: END IF;
3283:
3295: FUNCTION Set_Attributes (
3296: p_ctcv_rec IN ctcv_rec_type,
3297: x_ctcv_rec OUT NOCOPY ctcv_rec_type
3298: ) RETURN VARCHAR2 IS
3299: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3300: BEGIN
3301:
3302: x_ctcv_rec := p_ctcv_rec;
3303: x_ctcv_rec.OBJECT_VERSION_NUMBER := NVL(x_ctcv_rec.OBJECT_VERSION_NUMBER, 0) + 1;
3311: okc_debug.Set_Indentation('OKC_CTC_PVT');
3312: okc_debug.log('10200: Entered update_row', 2);
3313: END IF;
3314:
3315: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
3316: G_PKG_NAME,
3317: p_init_msg_list,
3318: l_api_version,
3319: p_api_version,
3318: l_api_version,
3319: p_api_version,
3320: '_PVT',
3321: x_return_status);
3322: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3323: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3324: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3325: RAISE OKC_API.G_EXCEPTION_ERROR;
3326: END IF;
3319: p_api_version,
3320: '_PVT',
3321: x_return_status);
3322: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3323: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3324: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3325: RAISE OKC_API.G_EXCEPTION_ERROR;
3326: END IF;
3327: --- Setting item attributes
3320: '_PVT',
3321: x_return_status);
3322: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3323: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3324: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3325: RAISE OKC_API.G_EXCEPTION_ERROR;
3326: END IF;
3327: --- Setting item attributes
3328: l_return_status := Set_Attributes(
3321: x_return_status);
3322: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3323: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3324: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3325: RAISE OKC_API.G_EXCEPTION_ERROR;
3326: END IF;
3327: --- Setting item attributes
3328: l_return_status := Set_Attributes(
3329: p_ctcv_rec, -- IN
3328: l_return_status := Set_Attributes(
3329: p_ctcv_rec, -- IN
3330: l_ctcv_rec); -- OUT
3331: --- If any errors happen abort API
3332: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3333: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3334: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3335: RAISE OKC_API.G_EXCEPTION_ERROR;
3336: END IF;
3329: p_ctcv_rec, -- IN
3330: l_ctcv_rec); -- OUT
3331: --- If any errors happen abort API
3332: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3333: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3334: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3335: RAISE OKC_API.G_EXCEPTION_ERROR;
3336: END IF;
3337: l_return_status := populate_new_record(l_ctcv_rec, l_def_ctcv_rec);
3330: l_ctcv_rec); -- OUT
3331: --- If any errors happen abort API
3332: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3333: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3334: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3335: RAISE OKC_API.G_EXCEPTION_ERROR;
3336: END IF;
3337: l_return_status := populate_new_record(l_ctcv_rec, l_def_ctcv_rec);
3338: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3331: --- If any errors happen abort API
3332: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3333: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3334: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3335: RAISE OKC_API.G_EXCEPTION_ERROR;
3336: END IF;
3337: l_return_status := populate_new_record(l_ctcv_rec, l_def_ctcv_rec);
3338: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3339: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3334: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3335: RAISE OKC_API.G_EXCEPTION_ERROR;
3336: END IF;
3337: l_return_status := populate_new_record(l_ctcv_rec, l_def_ctcv_rec);
3338: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3339: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3340: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3341: RAISE OKC_API.G_EXCEPTION_ERROR;
3342: END IF;
3335: RAISE OKC_API.G_EXCEPTION_ERROR;
3336: END IF;
3337: l_return_status := populate_new_record(l_ctcv_rec, l_def_ctcv_rec);
3338: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3339: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3340: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3341: RAISE OKC_API.G_EXCEPTION_ERROR;
3342: END IF;
3343: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
3336: END IF;
3337: l_return_status := populate_new_record(l_ctcv_rec, l_def_ctcv_rec);
3338: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3339: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3340: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3341: RAISE OKC_API.G_EXCEPTION_ERROR;
3342: END IF;
3343: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
3344: --- Validate all non-missing attributes (Item Level Validation)
3337: l_return_status := populate_new_record(l_ctcv_rec, l_def_ctcv_rec);
3338: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3339: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3340: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3341: RAISE OKC_API.G_EXCEPTION_ERROR;
3342: END IF;
3343: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
3344: --- Validate all non-missing attributes (Item Level Validation)
3345: l_return_status := Validate_Attributes(l_def_ctcv_rec);
3343: l_def_ctcv_rec := fill_who_columns(l_def_ctcv_rec);
3344: --- Validate all non-missing attributes (Item Level Validation)
3345: l_return_status := Validate_Attributes(l_def_ctcv_rec);
3346: --- If any errors happen abort API
3347: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3348: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3349: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3350: RAISE OKC_API.G_EXCEPTION_ERROR;
3351: END IF;
3344: --- Validate all non-missing attributes (Item Level Validation)
3345: l_return_status := Validate_Attributes(l_def_ctcv_rec);
3346: --- If any errors happen abort API
3347: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3348: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3349: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3350: RAISE OKC_API.G_EXCEPTION_ERROR;
3351: END IF;
3352: l_return_status := Validate_Record(l_def_ctcv_rec);
3345: l_return_status := Validate_Attributes(l_def_ctcv_rec);
3346: --- If any errors happen abort API
3347: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3348: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3349: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3350: RAISE OKC_API.G_EXCEPTION_ERROR;
3351: END IF;
3352: l_return_status := Validate_Record(l_def_ctcv_rec);
3353: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3346: --- If any errors happen abort API
3347: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3348: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3349: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3350: RAISE OKC_API.G_EXCEPTION_ERROR;
3351: END IF;
3352: l_return_status := Validate_Record(l_def_ctcv_rec);
3353: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3354: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3349: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3350: RAISE OKC_API.G_EXCEPTION_ERROR;
3351: END IF;
3352: l_return_status := Validate_Record(l_def_ctcv_rec);
3353: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3354: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3355: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3356: RAISE OKC_API.G_EXCEPTION_ERROR;
3357: END IF;
3350: RAISE OKC_API.G_EXCEPTION_ERROR;
3351: END IF;
3352: l_return_status := Validate_Record(l_def_ctcv_rec);
3353: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3354: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3355: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3356: RAISE OKC_API.G_EXCEPTION_ERROR;
3357: END IF;
3358:
3351: END IF;
3352: l_return_status := Validate_Record(l_def_ctcv_rec);
3353: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3354: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3355: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3356: RAISE OKC_API.G_EXCEPTION_ERROR;
3357: END IF;
3358:
3359: --------------------------------------
3352: l_return_status := Validate_Record(l_def_ctcv_rec);
3353: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3354: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3355: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3356: RAISE OKC_API.G_EXCEPTION_ERROR;
3357: END IF;
3358:
3359: --------------------------------------
3360: -- Move VIEW record to "Child" records
3370: x_msg_data,
3371: l_ctc_rec,
3372: lx_ctc_rec
3373: );
3374: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3375: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3376: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3377: RAISE OKC_API.G_EXCEPTION_ERROR;
3378: END IF;
3371: l_ctc_rec,
3372: lx_ctc_rec
3373: );
3374: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3375: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3376: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3377: RAISE OKC_API.G_EXCEPTION_ERROR;
3378: END IF;
3379: migrate(lx_ctc_rec, l_def_ctcv_rec);
3372: lx_ctc_rec
3373: );
3374: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3375: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3376: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3377: RAISE OKC_API.G_EXCEPTION_ERROR;
3378: END IF;
3379: migrate(lx_ctc_rec, l_def_ctcv_rec);
3380: x_ctcv_rec := l_def_ctcv_rec;
3373: );
3374: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3375: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3376: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3377: RAISE OKC_API.G_EXCEPTION_ERROR;
3378: END IF;
3379: migrate(lx_ctc_rec, l_def_ctcv_rec);
3380: x_ctcv_rec := l_def_ctcv_rec;
3381: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3377: RAISE OKC_API.G_EXCEPTION_ERROR;
3378: END IF;
3379: migrate(lx_ctc_rec, l_def_ctcv_rec);
3380: x_ctcv_rec := l_def_ctcv_rec;
3381: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3382:
3383: IF (l_debug = 'Y') THEN
3384: okc_debug.log('10300: Leaving update_row', 2);
3385: okc_debug.Reset_Indentation;
3385: okc_debug.Reset_Indentation;
3386: END IF;
3387:
3388: EXCEPTION
3389: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3390:
3391: IF (l_debug = 'Y') THEN
3392: okc_debug.log('10400: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3393: okc_debug.Reset_Indentation;
3388: EXCEPTION
3389: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3390:
3391: IF (l_debug = 'Y') THEN
3392: okc_debug.log('10400: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3393: okc_debug.Reset_Indentation;
3394: END IF;
3395:
3396: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3392: okc_debug.log('10400: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3393: okc_debug.Reset_Indentation;
3394: END IF;
3395:
3396: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3397: (
3398: l_api_name,
3399: G_PKG_NAME,
3400: 'OKC_API.G_RET_STS_ERROR',
3396: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3397: (
3398: l_api_name,
3399: G_PKG_NAME,
3400: 'OKC_API.G_RET_STS_ERROR',
3401: x_msg_count,
3402: x_msg_data,
3403: '_PVT'
3404: );
3401: x_msg_count,
3402: x_msg_data,
3403: '_PVT'
3404: );
3405: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3406:
3407: IF (l_debug = 'Y') THEN
3408: okc_debug.log('10500: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3409: okc_debug.Reset_Indentation;
3404: );
3405: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3406:
3407: IF (l_debug = 'Y') THEN
3408: okc_debug.log('10500: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3409: okc_debug.Reset_Indentation;
3410: END IF;
3411:
3412: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3408: okc_debug.log('10500: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3409: okc_debug.Reset_Indentation;
3410: END IF;
3411:
3412: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3413: (
3414: l_api_name,
3415: G_PKG_NAME,
3416: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3412: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3413: (
3414: l_api_name,
3415: G_PKG_NAME,
3416: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3417: x_msg_count,
3418: x_msg_data,
3419: '_PVT'
3420: );
3424: okc_debug.log('10600: Exiting update_row:OTHERS Exception', 2);
3425: okc_debug.Reset_Indentation;
3426: END IF;
3427:
3428: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3429: (
3430: l_api_name,
3431: G_PKG_NAME,
3432: 'OTHERS',
3449: x_ctcv_tbl OUT NOCOPY ctcv_tbl_type) IS
3450:
3451: l_api_version CONSTANT NUMBER := 1;
3452: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_update_row';
3453: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3454: i NUMBER := 0;
3455: BEGIN
3456:
3457: IF (l_debug = 'Y') THEN
3458: okc_debug.Set_Indentation('OKC_CTC_PVT');
3459: okc_debug.log('10700: Entered update_row', 2);
3460: END IF;
3461:
3462: OKC_API.init_msg_list(p_init_msg_list);
3463: -- Make sure PL/SQL table has records in it before passing
3464: IF (p_ctcv_tbl.COUNT > 0) THEN
3465: i := p_ctcv_tbl.FIRST;
3466: LOOP
3465: i := p_ctcv_tbl.FIRST;
3466: LOOP
3467: update_row (
3468: p_api_version => p_api_version,
3469: p_init_msg_list => OKC_API.G_FALSE,
3470: x_return_status => x_return_status,
3471: x_msg_count => x_msg_count,
3472: x_msg_data => x_msg_data,
3473: p_ctcv_rec => p_ctcv_tbl(i),
3482: okc_debug.Reset_Indentation;
3483: END IF;
3484:
3485: EXCEPTION
3486: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3487:
3488: IF (l_debug = 'Y') THEN
3489: okc_debug.log('10900: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3490: okc_debug.Reset_Indentation;
3485: EXCEPTION
3486: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3487:
3488: IF (l_debug = 'Y') THEN
3489: okc_debug.log('10900: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3490: okc_debug.Reset_Indentation;
3491: END IF;
3492:
3493: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3489: okc_debug.log('10900: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3490: okc_debug.Reset_Indentation;
3491: END IF;
3492:
3493: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3494: (
3495: l_api_name,
3496: G_PKG_NAME,
3497: 'OKC_API.G_RET_STS_ERROR',
3493: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3494: (
3495: l_api_name,
3496: G_PKG_NAME,
3497: 'OKC_API.G_RET_STS_ERROR',
3498: x_msg_count,
3499: x_msg_data,
3500: '_PVT'
3501: );
3498: x_msg_count,
3499: x_msg_data,
3500: '_PVT'
3501: );
3502: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3503:
3504: IF (l_debug = 'Y') THEN
3505: okc_debug.log('11000: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3506: okc_debug.Reset_Indentation;
3501: );
3502: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3503:
3504: IF (l_debug = 'Y') THEN
3505: okc_debug.log('11000: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3506: okc_debug.Reset_Indentation;
3507: END IF;
3508:
3509: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3505: okc_debug.log('11000: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3506: okc_debug.Reset_Indentation;
3507: END IF;
3508:
3509: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3510: (
3511: l_api_name,
3512: G_PKG_NAME,
3513: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3509: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3510: (
3511: l_api_name,
3512: G_PKG_NAME,
3513: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3514: x_msg_count,
3515: x_msg_data,
3516: '_PVT'
3517: );
3521: okc_debug.log('11100: Exiting update_row:OTHERS Exception', 2);
3522: okc_debug.Reset_Indentation;
3523: END IF;
3524:
3525: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3526: (
3527: l_api_name,
3528: G_PKG_NAME,
3529: 'OTHERS',
3548: p_ctc_rec IN ctc_rec_type) IS
3549:
3550: l_api_version CONSTANT NUMBER := 1;
3551: l_api_name CONSTANT VARCHAR2(30) := 'CONTACTS_delete_row';
3552: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3553: l_ctc_rec ctc_rec_type:= p_ctc_rec;
3554: l_row_notfound BOOLEAN := TRUE;
3555: BEGIN
3556:
3558: okc_debug.Set_Indentation('OKC_CTC_PVT');
3559: okc_debug.log('11200: Entered delete_row', 2);
3560: END IF;
3561:
3562: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
3563: p_init_msg_list,
3564: '_PVT',
3565: x_return_status);
3566: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3562: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
3563: p_init_msg_list,
3564: '_PVT',
3565: x_return_status);
3566: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3567: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3568: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3569: RAISE OKC_API.G_EXCEPTION_ERROR;
3570: END IF;
3563: p_init_msg_list,
3564: '_PVT',
3565: x_return_status);
3566: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3567: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3568: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3569: RAISE OKC_API.G_EXCEPTION_ERROR;
3570: END IF;
3571: DELETE FROM OKC_CONTACTS
3564: '_PVT',
3565: x_return_status);
3566: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3567: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3568: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3569: RAISE OKC_API.G_EXCEPTION_ERROR;
3570: END IF;
3571: DELETE FROM OKC_CONTACTS
3572: WHERE ID = l_ctc_rec.id;
3565: x_return_status);
3566: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3567: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3568: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3569: RAISE OKC_API.G_EXCEPTION_ERROR;
3570: END IF;
3571: DELETE FROM OKC_CONTACTS
3572: WHERE ID = l_ctc_rec.id;
3573:
3570: END IF;
3571: DELETE FROM OKC_CONTACTS
3572: WHERE ID = l_ctc_rec.id;
3573:
3574: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3575:
3576: IF (l_debug = 'Y') THEN
3577: okc_debug.log('11300: Leaving delete_row', 2);
3578: okc_debug.Reset_Indentation;
3578: okc_debug.Reset_Indentation;
3579: END IF;
3580:
3581: EXCEPTION
3582: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3583:
3584: IF (l_debug = 'Y') THEN
3585: okc_debug.log('11400: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3586: okc_debug.Reset_Indentation;
3581: EXCEPTION
3582: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3583:
3584: IF (l_debug = 'Y') THEN
3585: okc_debug.log('11400: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3586: okc_debug.Reset_Indentation;
3587: END IF;
3588:
3589: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3585: okc_debug.log('11400: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3586: okc_debug.Reset_Indentation;
3587: END IF;
3588:
3589: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3590: (
3591: l_api_name,
3592: G_PKG_NAME,
3593: 'OKC_API.G_RET_STS_ERROR',
3589: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3590: (
3591: l_api_name,
3592: G_PKG_NAME,
3593: 'OKC_API.G_RET_STS_ERROR',
3594: x_msg_count,
3595: x_msg_data,
3596: '_PVT'
3597: );
3594: x_msg_count,
3595: x_msg_data,
3596: '_PVT'
3597: );
3598: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3599:
3600: IF (l_debug = 'Y') THEN
3601: okc_debug.log('11500: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3602: okc_debug.Reset_Indentation;
3597: );
3598: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3599:
3600: IF (l_debug = 'Y') THEN
3601: okc_debug.log('11500: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3602: okc_debug.Reset_Indentation;
3603: END IF;
3604:
3605: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3601: okc_debug.log('11500: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3602: okc_debug.Reset_Indentation;
3603: END IF;
3604:
3605: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3606: (
3607: l_api_name,
3608: G_PKG_NAME,
3609: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3605: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3606: (
3607: l_api_name,
3608: G_PKG_NAME,
3609: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3610: x_msg_count,
3611: x_msg_data,
3612: '_PVT'
3613: );
3617: okc_debug.log('11600: Exiting delete_row:OTHERS Exception', 2);
3618: okc_debug.Reset_Indentation;
3619: END IF;
3620:
3621: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3622: (
3623: l_api_name,
3624: G_PKG_NAME,
3625: 'OTHERS',
3641: p_ctcv_rec IN ctcv_rec_type) IS
3642:
3643: l_api_version CONSTANT NUMBER := 1;
3644: l_api_name CONSTANT VARCHAR2(30) := 'V_delete_row';
3645: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3646: l_ctcv_rec ctcv_rec_type := p_ctcv_rec;
3647: l_ctc_rec ctc_rec_type;
3648: BEGIN
3649:
3651: okc_debug.Set_Indentation('OKC_CTC_PVT');
3652: okc_debug.log('11700: Entered delete_row', 2);
3653: END IF;
3654:
3655: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
3656: G_PKG_NAME,
3657: p_init_msg_list,
3658: l_api_version,
3659: p_api_version,
3658: l_api_version,
3659: p_api_version,
3660: '_PVT',
3661: x_return_status);
3662: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3663: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3664: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3665: RAISE OKC_API.G_EXCEPTION_ERROR;
3666: END IF;
3659: p_api_version,
3660: '_PVT',
3661: x_return_status);
3662: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3663: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3664: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3665: RAISE OKC_API.G_EXCEPTION_ERROR;
3666: END IF;
3667: --------------------------------------
3660: '_PVT',
3661: x_return_status);
3662: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3663: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3664: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3665: RAISE OKC_API.G_EXCEPTION_ERROR;
3666: END IF;
3667: --------------------------------------
3668: -- Move VIEW record to "Child" records
3661: x_return_status);
3662: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3663: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3664: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3665: RAISE OKC_API.G_EXCEPTION_ERROR;
3666: END IF;
3667: --------------------------------------
3668: -- Move VIEW record to "Child" records
3669: --------------------------------------
3677: x_msg_count,
3678: x_msg_data,
3679: l_ctc_rec
3680: );
3681: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3682: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3683: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3684: RAISE OKC_API.G_EXCEPTION_ERROR;
3685: END IF;
3678: x_msg_data,
3679: l_ctc_rec
3680: );
3681: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3682: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3683: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3684: RAISE OKC_API.G_EXCEPTION_ERROR;
3685: END IF;
3686: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3679: l_ctc_rec
3680: );
3681: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3682: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3683: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3684: RAISE OKC_API.G_EXCEPTION_ERROR;
3685: END IF;
3686: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3687:
3680: );
3681: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3682: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3683: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3684: RAISE OKC_API.G_EXCEPTION_ERROR;
3685: END IF;
3686: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3687:
3688: IF (l_debug = 'Y') THEN
3682: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
3683: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
3684: RAISE OKC_API.G_EXCEPTION_ERROR;
3685: END IF;
3686: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
3687:
3688: IF (l_debug = 'Y') THEN
3689: okc_debug.log('11800: Leaving delete_row', 2);
3690: okc_debug.Reset_Indentation;
3690: okc_debug.Reset_Indentation;
3691: END IF;
3692:
3693: EXCEPTION
3694: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3695:
3696: IF (l_debug = 'Y') THEN
3697: okc_debug.log('11900: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3698: okc_debug.Reset_Indentation;
3693: EXCEPTION
3694: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3695:
3696: IF (l_debug = 'Y') THEN
3697: okc_debug.log('11900: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3698: okc_debug.Reset_Indentation;
3699: END IF;
3700:
3701: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3697: okc_debug.log('11900: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3698: okc_debug.Reset_Indentation;
3699: END IF;
3700:
3701: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3702: (
3703: l_api_name,
3704: G_PKG_NAME,
3705: 'OKC_API.G_RET_STS_ERROR',
3701: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3702: (
3703: l_api_name,
3704: G_PKG_NAME,
3705: 'OKC_API.G_RET_STS_ERROR',
3706: x_msg_count,
3707: x_msg_data,
3708: '_PVT'
3709: );
3706: x_msg_count,
3707: x_msg_data,
3708: '_PVT'
3709: );
3710: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3711:
3712: IF (l_debug = 'Y') THEN
3713: okc_debug.log('12000: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3714: okc_debug.Reset_Indentation;
3709: );
3710: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3711:
3712: IF (l_debug = 'Y') THEN
3713: okc_debug.log('12000: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3714: okc_debug.Reset_Indentation;
3715: END IF;
3716:
3717: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3713: okc_debug.log('12000: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3714: okc_debug.Reset_Indentation;
3715: END IF;
3716:
3717: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3718: (
3719: l_api_name,
3720: G_PKG_NAME,
3721: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3717: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3718: (
3719: l_api_name,
3720: G_PKG_NAME,
3721: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3722: x_msg_count,
3723: x_msg_data,
3724: '_PVT'
3725: );
3729: okc_debug.log('12100: Exiting delete_row:OTHERS Exception', 2);
3730: okc_debug.Reset_Indentation;
3731: END IF;
3732:
3733: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3734: (
3735: l_api_name,
3736: G_PKG_NAME,
3737: 'OTHERS',
3753: p_ctcv_tbl IN ctcv_tbl_type) IS
3754:
3755: l_api_version CONSTANT NUMBER := 1;
3756: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_delete_row';
3757: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3758: i NUMBER := 0;
3759: BEGIN
3760:
3761: IF (l_debug = 'Y') THEN
3762: okc_debug.Set_Indentation('OKC_CTC_PVT');
3763: okc_debug.log('12200: Entered delete_row', 2);
3764: END IF;
3765:
3766: OKC_API.init_msg_list(p_init_msg_list);
3767: -- Make sure PL/SQL table has records in it before passing
3768: IF (p_ctcv_tbl.COUNT > 0) THEN
3769: i := p_ctcv_tbl.FIRST;
3770: LOOP
3769: i := p_ctcv_tbl.FIRST;
3770: LOOP
3771: delete_row (
3772: p_api_version => p_api_version,
3773: p_init_msg_list => OKC_API.G_FALSE,
3774: x_return_status => x_return_status,
3775: x_msg_count => x_msg_count,
3776: x_msg_data => x_msg_data,
3777: p_ctcv_rec => p_ctcv_tbl(i));
3785: okc_debug.Reset_Indentation;
3786: END IF;
3787:
3788: EXCEPTION
3789: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3790:
3791: IF (l_debug = 'Y') THEN
3792: okc_debug.log('12400: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3793: okc_debug.Reset_Indentation;
3788: EXCEPTION
3789: WHEN OKC_API.G_EXCEPTION_ERROR THEN
3790:
3791: IF (l_debug = 'Y') THEN
3792: okc_debug.log('12400: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3793: okc_debug.Reset_Indentation;
3794: END IF;
3795:
3796: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3792: okc_debug.log('12400: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
3793: okc_debug.Reset_Indentation;
3794: END IF;
3795:
3796: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3797: (
3798: l_api_name,
3799: G_PKG_NAME,
3800: 'OKC_API.G_RET_STS_ERROR',
3796: x_return_status := OKC_API.HANDLE_EXCEPTIONS
3797: (
3798: l_api_name,
3799: G_PKG_NAME,
3800: 'OKC_API.G_RET_STS_ERROR',
3801: x_msg_count,
3802: x_msg_data,
3803: '_PVT'
3804: );
3801: x_msg_count,
3802: x_msg_data,
3803: '_PVT'
3804: );
3805: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3806:
3807: IF (l_debug = 'Y') THEN
3808: okc_debug.log('12500: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3809: okc_debug.Reset_Indentation;
3804: );
3805: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
3806:
3807: IF (l_debug = 'Y') THEN
3808: okc_debug.log('12500: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3809: okc_debug.Reset_Indentation;
3810: END IF;
3811:
3812: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3808: okc_debug.log('12500: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
3809: okc_debug.Reset_Indentation;
3810: END IF;
3811:
3812: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3813: (
3814: l_api_name,
3815: G_PKG_NAME,
3816: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3812: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3813: (
3814: l_api_name,
3815: G_PKG_NAME,
3816: 'OKC_API.G_RET_STS_UNEXP_ERROR',
3817: x_msg_count,
3818: x_msg_data,
3819: '_PVT'
3820: );
3824: okc_debug.log('12600: Exiting delete_row:OTHERS Exception', 2);
3825: okc_debug.Reset_Indentation;
3826: END IF;
3827:
3828: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
3829: (
3830: l_api_name,
3831: G_PKG_NAME,
3832: 'OTHERS',
3891: /*added for bug 6882512*/
3892:
3893: BEGIN
3894: -- initialize return status
3895: x_return_status := OKC_API.G_RET_STS_SUCCESS;
3896:
3897: IF (l_debug = 'Y') THEN
3898: okc_debug.Set_Indentation('OKC_CTC_PVT');
3899: okc_debug.log('12700: Entered INSERT_ROW_UPG', 2);
4039:
4040: EXCEPTION
4041: WHEN OTHERS THEN
4042: -- store SQL error message on message stack
4043: OKC_API.SET_MESSAGE(
4044: p_app_name => G_APP_NAME,
4045: p_msg_name => G_UNEXPECTED_ERROR,
4046: p_token1 => G_SQLCODE_TOKEN,
4047: p_token1_value => SQLCODE,
4047: p_token1_value => SQLCODE,
4048: p_token2 => G_SQLERRM_TOKEN,
4049: p_token2_value => SQLERRM);
4050: -- notify caller of an error as UNEXPECTED error
4051: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
4052:
4053:
4054: /*okc_debug.log('12900: Exiting INSERT_ROW_UPG:OTHERS Exception', 2);
4055: IF (l_debug = 'Y') THEN
4069: p_chr_id IN NUMBER,
4070: p_major_version IN NUMBER
4071: ) RETURN VARCHAR2 IS
4072:
4073: l_return_status VARCHAR2(1):= OKC_API.G_RET_STS_SUCCESS;
4074:
4075: BEGIN
4076:
4077: IF (l_debug = 'Y') THEN
4174: okc_debug.Reset_Indentation;
4175: END IF;
4176:
4177: -- store SQL error message on message stack
4178: OKC_API.SET_MESSAGE(p_app_name => okc_version_pvt.G_APP_NAME,
4179: p_msg_name => okc_version_pvt.G_UNEXPECTED_ERROR,
4180: p_token1 => okc_version_pvt.G_SQLCODE_TOKEN,
4181: p_token1_value => sqlcode,
4182: p_token2 => okc_version_pvt.G_SQLERRM_TOKEN,
4182: p_token2 => okc_version_pvt.G_SQLERRM_TOKEN,
4183: p_token2_value => sqlerrm);
4184:
4185: -- notify UNEXPECTED error
4186: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
4187: return l_return_status;
4188:
4189: END create_version;
4190:
4196: p_chr_id IN NUMBER,
4197: p_major_version IN NUMBER
4198: ) RETURN VARCHAR2 IS
4199:
4200: l_return_status VARCHAR2(1):= OKC_API.G_RET_STS_SUCCESS;
4201:
4202: BEGIN
4203:
4204: IF (l_debug = 'Y') THEN
4287: /* Bug fix for 6882512*/
4288: OKC_CTC_PVT.update_contact_stecode(p_chr_id => p_chr_id,
4289: x_return_status=>l_return_status);
4290:
4291: IF l_return_status <> OKC_API.G_RET_STS_SUCCESS THEN
4292: RAISE OKC_API.G_EXCEPTION_ERROR;
4293: END IF;
4294: /* Bug fix for 6882512*/
4295:
4288: OKC_CTC_PVT.update_contact_stecode(p_chr_id => p_chr_id,
4289: x_return_status=>l_return_status);
4290:
4291: IF l_return_status <> OKC_API.G_RET_STS_SUCCESS THEN
4292: RAISE OKC_API.G_EXCEPTION_ERROR;
4293: END IF;
4294: /* Bug fix for 6882512*/
4295:
4296: IF (l_debug = 'Y') THEN
4309: okc_debug.Reset_Indentation;
4310: END IF;
4311:
4312: -- store SQL error message on message stack
4313: OKC_API.SET_MESSAGE(p_app_name => okc_version_pvt.G_APP_NAME,
4314: p_msg_name => okc_version_pvt.G_UNEXPECTED_ERROR,
4315: p_token1 => okc_version_pvt.G_SQLCODE_TOKEN,
4316: p_token1_value => sqlcode,
4317: p_token2 => okc_version_pvt.G_SQLERRM_TOKEN,
4317: p_token2 => okc_version_pvt.G_SQLERRM_TOKEN,
4318: p_token2_value => sqlerrm);
4319:
4320: -- notify UNEXPECTED error
4321: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
4322: return l_return_status;
4323:
4324: END restore_version;
4325: