11: G_SQLERRM_TOKEN CONSTANT VARCHAR2(200) := 'SQLerrm';
12: G_SQLCODE_TOKEN CONSTANT VARCHAR2(200) := 'SQLcode';
13: G_VIEW CONSTANT VARCHAR2(200) := 'OKC_K_ACCESSES_V';
14: G_EXCEPTION_HALT_VALIDATION exception;
15: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
16:
17: -- Start of comments
18: --
19: -- Procedure Name : validate_group_id
36: okc_debug.log('100: Entered validate_group_id', 2);
37: END IF;
38:
39: -- initialize return status
40: x_return_status := OKC_API.G_RET_STS_SUCCESS;
41:
42: -- Check JTF_RS_GROUPS_B for valid group id
43: If (p_cacv_rec.group_id <> OKC_API.G_MISS_NUM and
44: p_cacv_rec.group_id IS NOT NULL)
39: -- initialize return status
40: x_return_status := OKC_API.G_RET_STS_SUCCESS;
41:
42: -- Check JTF_RS_GROUPS_B for valid group id
43: If (p_cacv_rec.group_id <> OKC_API.G_MISS_NUM and
44: p_cacv_rec.group_id IS NOT NULL)
45: Then
46: -- enforce foreign key
47: Open l_jtfv_csr;
49: Close l_jtfv_csr;
50:
51: -- if l_dummy_var still set to default, data was not found
52: If (l_dummy_var = '?') Then
53: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
54: p_msg_name => g_no_parent_record,
55: p_token1 => g_col_name_token,
56: p_token1_value => 'Group Id',
57: p_token2 => g_child_table_token,
59: p_token3 => g_parent_table_token,
60: p_token3_value => 'JTF_RS_GROUPS_B');
61:
62: -- notify caller of an error
63: x_return_status := OKC_API.G_RET_STS_ERROR;
64: End If;
65: End If;
66:
67: IF (l_debug = 'Y') THEN
77: okc_debug.Reset_Indentation;
78: END IF;
79:
80: -- store SQL error message on message stack
81: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
82: p_msg_name => g_unexpected_error,
83: p_token1 => g_sqlcode_token,
84: p_token1_value => sqlcode,
85: p_token2 => g_sqlerrm_token,
84: p_token1_value => sqlcode,
85: p_token2 => g_sqlerrm_token,
86: p_token2_value => sqlerrm);
87: -- set error flag as UNEXPETED error
88: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
89:
90: End validate_group_id;
91:
92: -- Start of comments
112: okc_debug.log('400: Entered validate_chr_id', 2);
113: END IF;
114:
115: -- initialize return status
116: x_return_status := OKC_API.G_RET_STS_SUCCESS;
117:
118: -- check that data exists
119: If (p_cacv_rec.chr_id = OKC_API.G_MISS_NUM or
120: p_cacv_rec.chr_id IS NULL)
115: -- initialize return status
116: x_return_status := OKC_API.G_RET_STS_SUCCESS;
117:
118: -- check that data exists
119: If (p_cacv_rec.chr_id = OKC_API.G_MISS_NUM or
120: p_cacv_rec.chr_id IS NULL)
121: Then
122: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
123: p_msg_name => g_required_value,
118: -- check that data exists
119: If (p_cacv_rec.chr_id = OKC_API.G_MISS_NUM or
120: p_cacv_rec.chr_id IS NULL)
121: Then
122: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
123: p_msg_name => g_required_value,
124: p_token1 => g_col_name_token,
125: p_token1_value => 'chr_id');
126: -- set error flag
123: p_msg_name => g_required_value,
124: p_token1 => g_col_name_token,
125: p_token1_value => 'chr_id');
126: -- set error flag
127: x_return_status := OKC_API.G_RET_STS_ERROR;
128:
129: -- halt validation
130: raise G_EXCEPTION_HALT_VALIDATION;
131: End If;
136: Close l_chrv_csr;
137:
138: -- if l_dummy_var still set to default, data was not found
139: If (l_dummy_var = '?') Then
140: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
141: p_msg_name => g_no_parent_record,
142: p_token1 => g_col_name_token,
143: p_token1_value => 'chr_id',
144: p_token2 => g_child_table_token,
146: p_token3 => g_parent_table_token,
147: p_token3_value => 'OKC_K_HEADERS_V');
148:
149: -- notify caller of an error
150: x_return_status := OKC_API.G_RET_STS_ERROR;
151: End If;
152:
153: IF (l_debug = 'Y') THEN
154: okc_debug.log('500: Leaving validate_chr_id', 2);
173: okc_debug.Reset_Indentation;
174: END IF;
175:
176: -- store SQL error message on message stack
177: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
178: p_msg_name => g_unexpected_error,
179: p_token1 => g_sqlcode_token,
180: p_token1_value => sqlcode,
181: p_token2 => g_sqlerrm_token,
180: p_token1_value => sqlcode,
181: p_token2 => g_sqlerrm_token,
182: p_token2_value => sqlerrm);
183: -- set error flag as UNEXPETED error
184: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
185:
186: -- verify that cursor was closed
187: if l_chrv_csr%ISOPEN then
188: close l_chrv_csr;
205: okc_debug.log('800: Entered validate_resource_id', 2);
206: END IF;
207:
208: -- initialize return status
209: x_return_status := OKC_API.G_RET_STS_SUCCESS;
210:
211: -- verify foreign key, if data exists
212: If (p_cacv_rec.resource_id <> OKC_API.G_MISS_NUM and
213: p_cacv_rec.resource_id IS NOT NULL)
208: -- initialize return status
209: x_return_status := OKC_API.G_RET_STS_SUCCESS;
210:
211: -- verify foreign key, if data exists
212: If (p_cacv_rec.resource_id <> OKC_API.G_MISS_NUM and
213: p_cacv_rec.resource_id IS NOT NULL)
214: Then
215: Open l_jtfv_csr;
216: Fetch l_jtfv_csr Into l_dummy_var;
216: Fetch l_jtfv_csr Into l_dummy_var;
217: Close l_jtfv_csr;
218: -- if l_dummy_var still set to default, data was not found
219: If (l_dummy_var = '?') Then
220: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
221: p_msg_name => g_no_parent_record,
222: p_token1 => g_col_name_token,
223: p_token1_value => 'Resource Id',
224: p_token2 => g_child_table_token,
225: p_token2_value => G_VIEW,
226: p_token3 => g_parent_table_token,
227: p_token3_value => 'JTF_RS_RESOURCE_EXTNS');
228: -- set error flag
229: x_return_status := OKC_API.G_RET_STS_ERROR;
230: End If;
231: End If;
232:
233: IF (l_debug = 'Y') THEN
243: okc_debug.Reset_Indentation;
244: END IF;
245:
246: -- store SQL error message on message stack
247: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
248: p_msg_name => g_unexpected_error,
249: p_token1 => g_sqlcode_token,
250: p_token1_value => sqlcode,
251: p_token2 => g_sqlerrm_token,
250: p_token1_value => sqlcode,
251: p_token2 => g_sqlerrm_token,
252: p_token2_value => sqlerrm);
253: -- set error flag as UNEXPETED error
254: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
255:
256: -- verify that cursor was closed
257: if l_jtfv_csr%ISOPEN then
258: close l_jtfv_csr;
277: okc_debug.log('1000: Entered validate_access_level', 2);
278: END IF;
279:
280: -- initialize return status
281: x_return_status := OKC_API.G_RET_STS_SUCCESS;
282:
283: -- check that data exists
284: If (p_cacv_rec.access_level = OKC_API.G_MISS_CHAR or
285: p_cacv_rec.access_level IS NULL)
280: -- initialize return status
281: x_return_status := OKC_API.G_RET_STS_SUCCESS;
282:
283: -- check that data exists
284: If (p_cacv_rec.access_level = OKC_API.G_MISS_CHAR or
285: p_cacv_rec.access_level IS NULL)
286: Then
287: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
288: p_msg_name => g_required_value,
283: -- check that data exists
284: If (p_cacv_rec.access_level = OKC_API.G_MISS_CHAR or
285: p_cacv_rec.access_level IS NULL)
286: Then
287: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
288: p_msg_name => g_required_value,
289: p_token1 => g_col_name_token,
290: p_token1_value => 'access_level');
291: -- set error flag
288: p_msg_name => g_required_value,
289: p_token1 => g_col_name_token,
290: p_token1_value => 'access_level');
291: -- set error flag
292: x_return_status := OKC_API.G_RET_STS_ERROR;
293:
294: -- halt validation
295: raise G_EXCEPTION_HALT_VALIDATION;
296: End If;
296: End If;
297:
298: -- check allowed values
299: If (upper(p_cacv_rec.access_level) NOT IN ('U','R')) Then
300: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
301: p_msg_name => g_invalid_value,
302: p_token1 => g_col_name_token,
303: p_token1_value => 'access_level');
304: -- set error flag
301: p_msg_name => g_invalid_value,
302: p_token1 => g_col_name_token,
303: p_token1_value => 'access_level');
304: -- set error flag
305: x_return_status := OKC_API.G_RET_STS_ERROR;
306: End If;
307:
308: IF (l_debug = 'Y') THEN
309: okc_debug.log('1100: Leaving validate_access_level', 2);
328: okc_debug.Reset_Indentation;
329: END IF;
330:
331: -- store SQL error message on message stack
332: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
333: p_msg_name => g_unexpected_error,
334: p_token1 => g_sqlcode_token,
335: p_token1_value => sqlcode,
336: p_token2 => g_sqlerrm_token,
335: p_token1_value => sqlcode,
336: p_token2 => g_sqlerrm_token,
337: p_token2_value => sqlerrm);
338: -- set error flag as UNEXPETED error
339: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
340:
341: End validate_access_level;
342:
343: /*********************** END HAND-CODED ********************************/
529: okc_debug.Set_Indentation('OKC_CAC_PVT');
530: okc_debug.log('1900: Entered null_out_defaults', 2);
531: END IF;
532:
533: IF (l_cacv_rec.object_version_number = OKC_API.G_MISS_NUM) THEN
534: l_cacv_rec.object_version_number := NULL;
535: END IF;
536: IF (l_cacv_rec.group_id = OKC_API.G_MISS_NUM) THEN
537: l_cacv_rec.group_id := NULL;
532:
533: IF (l_cacv_rec.object_version_number = OKC_API.G_MISS_NUM) THEN
534: l_cacv_rec.object_version_number := NULL;
535: END IF;
536: IF (l_cacv_rec.group_id = OKC_API.G_MISS_NUM) THEN
537: l_cacv_rec.group_id := NULL;
538: END IF;
539: IF (l_cacv_rec.chr_id = OKC_API.G_MISS_NUM) THEN
540: l_cacv_rec.chr_id := NULL;
535: END IF;
536: IF (l_cacv_rec.group_id = OKC_API.G_MISS_NUM) THEN
537: l_cacv_rec.group_id := NULL;
538: END IF;
539: IF (l_cacv_rec.chr_id = OKC_API.G_MISS_NUM) THEN
540: l_cacv_rec.chr_id := NULL;
541: END IF;
542: IF (l_cacv_rec.resource_id = OKC_API.G_MISS_NUM) THEN
543: l_cacv_rec.resource_id := NULL;
538: END IF;
539: IF (l_cacv_rec.chr_id = OKC_API.G_MISS_NUM) THEN
540: l_cacv_rec.chr_id := NULL;
541: END IF;
542: IF (l_cacv_rec.resource_id = OKC_API.G_MISS_NUM) THEN
543: l_cacv_rec.resource_id := NULL;
544: END IF;
545: IF (l_cacv_rec.access_level = OKC_API.G_MISS_CHAR) THEN
546: l_cacv_rec.access_level := NULL;
541: END IF;
542: IF (l_cacv_rec.resource_id = OKC_API.G_MISS_NUM) THEN
543: l_cacv_rec.resource_id := NULL;
544: END IF;
545: IF (l_cacv_rec.access_level = OKC_API.G_MISS_CHAR) THEN
546: l_cacv_rec.access_level := NULL;
547: END IF;
548: IF (l_cacv_rec.created_by = OKC_API.G_MISS_NUM) THEN
549: l_cacv_rec.created_by := NULL;
544: END IF;
545: IF (l_cacv_rec.access_level = OKC_API.G_MISS_CHAR) THEN
546: l_cacv_rec.access_level := NULL;
547: END IF;
548: IF (l_cacv_rec.created_by = OKC_API.G_MISS_NUM) THEN
549: l_cacv_rec.created_by := NULL;
550: END IF;
551: IF (l_cacv_rec.creation_date = OKC_API.G_MISS_DATE) THEN
552: l_cacv_rec.creation_date := NULL;
547: END IF;
548: IF (l_cacv_rec.created_by = OKC_API.G_MISS_NUM) THEN
549: l_cacv_rec.created_by := NULL;
550: END IF;
551: IF (l_cacv_rec.creation_date = OKC_API.G_MISS_DATE) THEN
552: l_cacv_rec.creation_date := NULL;
553: END IF;
554: IF (l_cacv_rec.last_updated_by = OKC_API.G_MISS_NUM) THEN
555: l_cacv_rec.last_updated_by := NULL;
550: END IF;
551: IF (l_cacv_rec.creation_date = OKC_API.G_MISS_DATE) THEN
552: l_cacv_rec.creation_date := NULL;
553: END IF;
554: IF (l_cacv_rec.last_updated_by = OKC_API.G_MISS_NUM) THEN
555: l_cacv_rec.last_updated_by := NULL;
556: END IF;
557: IF (l_cacv_rec.last_update_date = OKC_API.G_MISS_DATE) THEN
558: l_cacv_rec.last_update_date := NULL;
553: END IF;
554: IF (l_cacv_rec.last_updated_by = OKC_API.G_MISS_NUM) THEN
555: l_cacv_rec.last_updated_by := NULL;
556: END IF;
557: IF (l_cacv_rec.last_update_date = OKC_API.G_MISS_DATE) THEN
558: l_cacv_rec.last_update_date := NULL;
559: END IF;
560: IF (l_cacv_rec.last_update_login = OKC_API.G_MISS_NUM) THEN
561: l_cacv_rec.last_update_login := NULL;
556: END IF;
557: IF (l_cacv_rec.last_update_date = OKC_API.G_MISS_DATE) THEN
558: l_cacv_rec.last_update_date := NULL;
559: END IF;
560: IF (l_cacv_rec.last_update_login = OKC_API.G_MISS_NUM) THEN
561: l_cacv_rec.last_update_login := NULL;
562: END IF;
563:
564: IF (l_debug = 'Y') THEN
577: ----------------------------------------------
578: FUNCTION Validate_Attributes (
579: p_cacv_rec IN cacv_rec_type
580: ) RETURN VARCHAR2 IS
581: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
582: x_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
583: BEGIN
584:
585: IF (l_debug = 'Y') THEN
578: FUNCTION Validate_Attributes (
579: p_cacv_rec IN cacv_rec_type
580: ) RETURN VARCHAR2 IS
581: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
582: x_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
583: BEGIN
584:
585: IF (l_debug = 'Y') THEN
586: okc_debug.Set_Indentation('OKC_CAC_PVT');
592: (x_return_status => l_return_status,
593: p_cacv_rec => p_cacv_rec);
594:
595: -- store the highest degree of error
596: If l_return_status <> OKC_API.G_RET_STS_SUCCESS Then
597: If x_return_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
598: x_return_status := l_return_status;
599: End If;
600: End If;
593: p_cacv_rec => p_cacv_rec);
594:
595: -- store the highest degree of error
596: If l_return_status <> OKC_API.G_RET_STS_SUCCESS Then
597: If x_return_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
598: x_return_status := l_return_status;
599: End If;
600: End If;
601:
604: (x_return_status => l_return_status,
605: p_cacv_rec => p_cacv_rec);
606:
607: -- store the highest degree of error
608: If l_return_status <> OKC_API.G_RET_STS_SUCCESS Then
609: If x_return_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
610: x_return_status := l_return_status;
611: End If;
612: End If;
605: p_cacv_rec => p_cacv_rec);
606:
607: -- store the highest degree of error
608: If l_return_status <> OKC_API.G_RET_STS_SUCCESS Then
609: If x_return_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
610: x_return_status := l_return_status;
611: End If;
612: End If;
613:
616: (x_return_status => l_return_status,
617: p_cacv_rec => p_cacv_rec);
618:
619: -- store the highest degree of error
620: If l_return_status <> OKC_API.G_RET_STS_SUCCESS Then
621: If x_return_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
622: x_return_status := l_return_status;
623: End If;
624: End If;
617: p_cacv_rec => p_cacv_rec);
618:
619: -- store the highest degree of error
620: If l_return_status <> OKC_API.G_RET_STS_SUCCESS Then
621: If x_return_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
622: x_return_status := l_return_status;
623: End If;
624: End If;
625:
628: (x_return_status => l_return_status,
629: p_cacv_rec => p_cacv_rec);
630:
631: -- store the highest degree of error
632: If l_return_status <> OKC_API.G_RET_STS_SUCCESS Then
633: If x_return_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
634: x_return_status := l_return_status;
635: End If;
636: End If;
629: p_cacv_rec => p_cacv_rec);
630:
631: -- store the highest degree of error
632: If l_return_status <> OKC_API.G_RET_STS_SUCCESS Then
633: If x_return_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
634: x_return_status := l_return_status;
635: End If;
636: End If;
637:
651: okc_debug.Reset_Indentation;
652: END IF;
653:
654: -- store SQL error message on message stack
655: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
656: p_msg_name => g_unexpected_error,
657: p_token1 => g_sqlcode_token,
658: p_token1_value => sqlcode,
659: p_token2 => g_sqlerrm_token,
659: p_token2 => g_sqlerrm_token,
660: p_token2_value => sqlerrm);
661:
662: -- notify caller of an UNEXPETED error
663: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
664:
665: -- return status to caller
666: RETURN(x_return_status);
667: /*********************** END HAND-CODED ********************************/
699: AND resource_id IS NULL
700: AND group_id = p_cacv_rec.GROUP_ID
701: AND id <> NVL(p_cacv_rec.ID,-9999);
702:
703: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
704: l_row_found BOOLEAN := FALSE;
705: l_dummy VARCHAR2(1);
706:
707: ----Bug-2314758
736: OR
737: ( p_cacv_rec.RESOURCE_ID IS NOT NULL
738: AND p_cacv_rec.GROUP_ID IS NOT NULL)
739: THEN
740: l_return_status := OKC_API.G_RET_STS_ERROR;
741: OKC_API.SET_MESSAGE(
742: p_app_name => g_app_name,
743: p_msg_name => g_invalid_value,
744: p_token1 => g_col_name_token,
737: ( p_cacv_rec.RESOURCE_ID IS NOT NULL
738: AND p_cacv_rec.GROUP_ID IS NOT NULL)
739: THEN
740: l_return_status := OKC_API.G_RET_STS_ERROR;
741: OKC_API.SET_MESSAGE(
742: p_app_name => g_app_name,
743: p_msg_name => g_invalid_value,
744: p_token1 => g_col_name_token,
745: p_token1_value => 'RESOURCE_ID',
757: -- check uniqueness for composite key CHR_ID + RESOURCE_ID + GROUP_ID.
758: -- RESOURCE_ID and GROUP_ID are mutually exclusive
759: -- ---------------------------------------------------------------------
760: IF ( p_cacv_rec.RESOURCE_ID IS NOT NULL
761: AND p_cacv_rec.RESOURCE_ID <> OKC_API.G_MISS_NUM )
762: THEN
763: OPEN cur_cac_1;
764: FETCH cur_cac_1 INTO l_dummy;
765: l_row_found := cur_cac_1%FOUND;
764: FETCH cur_cac_1 INTO l_dummy;
765: l_row_found := cur_cac_1%FOUND;
766: CLOSE cur_cac_1;
767: ELSIF ( p_cacv_rec.GROUP_ID IS NOT NULL
768: AND p_cacv_rec.GROUP_ID <> OKC_API.G_MISS_NUM )
769: THEN
770: OPEN cur_cac_2;
771: FETCH cur_cac_2 INTO l_dummy;
772: l_row_found := cur_cac_2%FOUND;
783: FETCH user_name INTO l_user_group_name;
784: CLOSE user_name;
785: END IF;
786:
787: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
788: p_msg_name => 'OKC_DUP_K_ACCESS_COMP_KEY',
789: p_token1 => 'TOKEN1',
790: p_token1_value => l_user_group_name );
791:
788: p_msg_name => 'OKC_DUP_K_ACCESS_COMP_KEY',
789: p_token1 => 'TOKEN1',
790: p_token1_value => l_user_group_name );
791:
792: l_return_status := OKC_API.G_RET_STS_ERROR;
793: RAISE G_EXCEPTION_HALT_VALIDATION;
794: END IF;
795:
796: /*********************** END HAND-CODED *************************/
872: p_cacv_rec IN cacv_rec_type) IS
873:
874: l_api_version CONSTANT NUMBER := 1;
875: l_api_name CONSTANT VARCHAR2(30) := 'V_validate_row';
876: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
877: l_cacv_rec cacv_rec_type := p_cacv_rec;
878: l_cac_rec cac_rec_type;
879: BEGIN
880:
882: okc_debug.Set_Indentation('OKC_CAC_PVT');
883: okc_debug.log('2700: Entered validate_row', 2);
884: END IF;
885:
886: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
887: G_PKG_NAME,
888: p_init_msg_list,
889: l_api_version,
890: p_api_version,
889: l_api_version,
890: p_api_version,
891: '_PVT',
892: x_return_status);
893: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
894: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
895: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
896: RAISE OKC_API.G_EXCEPTION_ERROR;
897: END IF;
890: p_api_version,
891: '_PVT',
892: x_return_status);
893: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
894: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
895: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
896: RAISE OKC_API.G_EXCEPTION_ERROR;
897: END IF;
898: --- Validate all non-missing attributes (Item Level Validation)
891: '_PVT',
892: x_return_status);
893: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
894: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
895: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
896: RAISE OKC_API.G_EXCEPTION_ERROR;
897: END IF;
898: --- Validate all non-missing attributes (Item Level Validation)
899: l_return_status := Validate_Attributes(l_cacv_rec);
892: x_return_status);
893: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
894: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
895: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
896: RAISE OKC_API.G_EXCEPTION_ERROR;
897: END IF;
898: --- Validate all non-missing attributes (Item Level Validation)
899: l_return_status := Validate_Attributes(l_cacv_rec);
900: --- If any errors happen abort API
897: END IF;
898: --- Validate all non-missing attributes (Item Level Validation)
899: l_return_status := Validate_Attributes(l_cacv_rec);
900: --- If any errors happen abort API
901: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
902: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
903: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
904: RAISE OKC_API.G_EXCEPTION_ERROR;
905: END IF;
898: --- Validate all non-missing attributes (Item Level Validation)
899: l_return_status := Validate_Attributes(l_cacv_rec);
900: --- If any errors happen abort API
901: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
902: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
903: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
904: RAISE OKC_API.G_EXCEPTION_ERROR;
905: END IF;
906: l_return_status := Validate_Record(l_cacv_rec);
899: l_return_status := Validate_Attributes(l_cacv_rec);
900: --- If any errors happen abort API
901: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
902: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
903: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
904: RAISE OKC_API.G_EXCEPTION_ERROR;
905: END IF;
906: l_return_status := Validate_Record(l_cacv_rec);
907: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
900: --- If any errors happen abort API
901: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
902: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
903: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
904: RAISE OKC_API.G_EXCEPTION_ERROR;
905: END IF;
906: l_return_status := Validate_Record(l_cacv_rec);
907: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
908: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
903: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
904: RAISE OKC_API.G_EXCEPTION_ERROR;
905: END IF;
906: l_return_status := Validate_Record(l_cacv_rec);
907: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
908: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
909: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
910: RAISE OKC_API.G_EXCEPTION_ERROR;
911: END IF;
904: RAISE OKC_API.G_EXCEPTION_ERROR;
905: END IF;
906: l_return_status := Validate_Record(l_cacv_rec);
907: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
908: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
909: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
910: RAISE OKC_API.G_EXCEPTION_ERROR;
911: END IF;
912: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
905: END IF;
906: l_return_status := Validate_Record(l_cacv_rec);
907: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
908: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
909: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
910: RAISE OKC_API.G_EXCEPTION_ERROR;
911: END IF;
912: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
913:
906: l_return_status := Validate_Record(l_cacv_rec);
907: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
908: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
909: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
910: RAISE OKC_API.G_EXCEPTION_ERROR;
911: END IF;
912: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
913:
914: IF (l_debug = 'Y') THEN
908: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
909: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
910: RAISE OKC_API.G_EXCEPTION_ERROR;
911: END IF;
912: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
913:
914: IF (l_debug = 'Y') THEN
915: okc_debug.log('2750: Leaving validate_row', 2);
916: okc_debug.Reset_Indentation;
916: okc_debug.Reset_Indentation;
917: END IF;
918:
919: EXCEPTION
920: WHEN OKC_API.G_EXCEPTION_ERROR THEN
921:
922: IF (l_debug = 'Y') THEN
923: okc_debug.log('2800: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
924: okc_debug.Reset_Indentation;
919: EXCEPTION
920: WHEN OKC_API.G_EXCEPTION_ERROR THEN
921:
922: IF (l_debug = 'Y') THEN
923: okc_debug.log('2800: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
924: okc_debug.Reset_Indentation;
925: END IF;
926:
927: x_return_status := OKC_API.HANDLE_EXCEPTIONS
923: okc_debug.log('2800: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
924: okc_debug.Reset_Indentation;
925: END IF;
926:
927: x_return_status := OKC_API.HANDLE_EXCEPTIONS
928: (
929: l_api_name,
930: G_PKG_NAME,
931: 'OKC_API.G_RET_STS_ERROR',
927: x_return_status := OKC_API.HANDLE_EXCEPTIONS
928: (
929: l_api_name,
930: G_PKG_NAME,
931: 'OKC_API.G_RET_STS_ERROR',
932: x_msg_count,
933: x_msg_data,
934: '_PVT'
935: );
932: x_msg_count,
933: x_msg_data,
934: '_PVT'
935: );
936: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
937:
938: IF (l_debug = 'Y') THEN
939: okc_debug.log('2900: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
940: okc_debug.Reset_Indentation;
935: );
936: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
937:
938: IF (l_debug = 'Y') THEN
939: okc_debug.log('2900: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
940: okc_debug.Reset_Indentation;
941: END IF;
942:
943: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
939: okc_debug.log('2900: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
940: okc_debug.Reset_Indentation;
941: END IF;
942:
943: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
944: (
945: l_api_name,
946: G_PKG_NAME,
947: 'OKC_API.G_RET_STS_UNEXP_ERROR',
943: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
944: (
945: l_api_name,
946: G_PKG_NAME,
947: 'OKC_API.G_RET_STS_UNEXP_ERROR',
948: x_msg_count,
949: x_msg_data,
950: '_PVT'
951: );
955: okc_debug.log('3000: Exiting validate_row:OTHERS Exception', 2);
956: okc_debug.Reset_Indentation;
957: END IF;
958:
959: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
960: (
961: l_api_name,
962: G_PKG_NAME,
963: 'OTHERS',
979: p_cacv_tbl IN cacv_tbl_type) IS
980:
981: l_api_version CONSTANT NUMBER := 1;
982: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_validate_row';
983: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
984: l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
985: i NUMBER := 0;
986: BEGIN
987:
980:
981: l_api_version CONSTANT NUMBER := 1;
982: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_validate_row';
983: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
984: l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
985: i NUMBER := 0;
986: BEGIN
987:
988: IF (l_debug = 'Y') THEN
989: okc_debug.Set_Indentation('OKC_CAC_PVT');
990: okc_debug.log('3200: Entered validate_row', 2);
991: END IF;
992:
993: OKC_API.init_msg_list(p_init_msg_list);
994: -- Make sure PL/SQL table has records in it before passing
995: IF (p_cacv_tbl.COUNT > 0) THEN
996: i := p_cacv_tbl.FIRST;
997: LOOP
996: i := p_cacv_tbl.FIRST;
997: LOOP
998: validate_row (
999: p_api_version => p_api_version,
1000: p_init_msg_list => OKC_API.G_FALSE,
1001: x_return_status => x_return_status,
1002: x_msg_count => x_msg_count,
1003: x_msg_data => x_msg_data,
1004: p_cacv_rec => p_cacv_tbl(i));
1003: x_msg_data => x_msg_data,
1004: p_cacv_rec => p_cacv_tbl(i));
1005:
1006: -- store the highest degree of error
1007: If x_return_status <> OKC_API.G_RET_STS_SUCCESS Then
1008: If l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
1009: l_overall_status := x_return_status;
1010: End If;
1011: End If;
1004: p_cacv_rec => p_cacv_tbl(i));
1005:
1006: -- store the highest degree of error
1007: If x_return_status <> OKC_API.G_RET_STS_SUCCESS Then
1008: If l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
1009: l_overall_status := x_return_status;
1010: End If;
1011: End If;
1012:
1022: okc_debug.Reset_Indentation;
1023: END IF;
1024:
1025: EXCEPTION
1026: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1027:
1028: IF (l_debug = 'Y') THEN
1029: okc_debug.log('3300: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1030: okc_debug.Reset_Indentation;
1025: EXCEPTION
1026: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1027:
1028: IF (l_debug = 'Y') THEN
1029: okc_debug.log('3300: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1030: okc_debug.Reset_Indentation;
1031: END IF;
1032:
1033: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1029: okc_debug.log('3300: Exiting validate_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1030: okc_debug.Reset_Indentation;
1031: END IF;
1032:
1033: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1034: (
1035: l_api_name,
1036: G_PKG_NAME,
1037: 'OKC_API.G_RET_STS_ERROR',
1033: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1034: (
1035: l_api_name,
1036: G_PKG_NAME,
1037: 'OKC_API.G_RET_STS_ERROR',
1038: x_msg_count,
1039: x_msg_data,
1040: '_PVT'
1041: );
1038: x_msg_count,
1039: x_msg_data,
1040: '_PVT'
1041: );
1042: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1043:
1044: IF (l_debug = 'Y') THEN
1045: okc_debug.log('3400: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1046: okc_debug.Reset_Indentation;
1041: );
1042: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1043:
1044: IF (l_debug = 'Y') THEN
1045: okc_debug.log('3400: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1046: okc_debug.Reset_Indentation;
1047: END IF;
1048:
1049: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1045: okc_debug.log('3400: Exiting validate_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1046: okc_debug.Reset_Indentation;
1047: END IF;
1048:
1049: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1050: (
1051: l_api_name,
1052: G_PKG_NAME,
1053: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1049: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1050: (
1051: l_api_name,
1052: G_PKG_NAME,
1053: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1054: x_msg_count,
1055: x_msg_data,
1056: '_PVT'
1057: );
1061: okc_debug.log('3500: Exiting validate_row:OTHERS Exception', 2);
1062: okc_debug.Reset_Indentation;
1063: END IF;
1064:
1065: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1066: (
1067: l_api_name,
1068: G_PKG_NAME,
1069: 'OTHERS',
1089: x_cac_rec OUT NOCOPY cac_rec_type) IS
1090:
1091: l_api_version CONSTANT NUMBER := 1;
1092: l_api_name CONSTANT VARCHAR2(30) := 'ACCESSES_insert_row';
1093: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1094: l_cac_rec cac_rec_type := p_cac_rec;
1095: l_def_cac_rec cac_rec_type;
1096: ---------------------------------------
1097: -- Set_Attributes for:OKC_K_ACCESSES --
1099: FUNCTION Set_Attributes (
1100: p_cac_rec IN cac_rec_type,
1101: x_cac_rec OUT NOCOPY cac_rec_type
1102: ) RETURN VARCHAR2 IS
1103: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1104: BEGIN
1105:
1106: x_cac_rec := p_cac_rec;
1107: RETURN(l_return_status);
1113: okc_debug.Set_Indentation('OKC_CAC_PVT');
1114: okc_debug.log('3800: Entered insert_row', 2);
1115: END IF;
1116:
1117: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
1118: p_init_msg_list,
1119: '_PVT',
1120: x_return_status);
1121: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1117: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
1118: p_init_msg_list,
1119: '_PVT',
1120: x_return_status);
1121: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1122: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1123: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1124: RAISE OKC_API.G_EXCEPTION_ERROR;
1125: END IF;
1118: p_init_msg_list,
1119: '_PVT',
1120: x_return_status);
1121: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1122: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1123: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1124: RAISE OKC_API.G_EXCEPTION_ERROR;
1125: END IF;
1126: --- Setting item attributes
1119: '_PVT',
1120: x_return_status);
1121: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1122: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1123: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1124: RAISE OKC_API.G_EXCEPTION_ERROR;
1125: END IF;
1126: --- Setting item attributes
1127: l_return_status := Set_Attributes(
1120: x_return_status);
1121: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1122: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1123: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1124: RAISE OKC_API.G_EXCEPTION_ERROR;
1125: END IF;
1126: --- Setting item attributes
1127: l_return_status := Set_Attributes(
1128: p_cac_rec, -- IN
1127: l_return_status := Set_Attributes(
1128: p_cac_rec, -- IN
1129: l_cac_rec); -- OUT
1130: --- If any errors happen abort API
1131: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1132: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1133: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1134: RAISE OKC_API.G_EXCEPTION_ERROR;
1135: END IF;
1128: p_cac_rec, -- IN
1129: l_cac_rec); -- OUT
1130: --- If any errors happen abort API
1131: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1132: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1133: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1134: RAISE OKC_API.G_EXCEPTION_ERROR;
1135: END IF;
1136: INSERT INTO OKC_K_ACCESSES(
1129: l_cac_rec); -- OUT
1130: --- If any errors happen abort API
1131: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1132: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1133: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1134: RAISE OKC_API.G_EXCEPTION_ERROR;
1135: END IF;
1136: INSERT INTO OKC_K_ACCESSES(
1137: id,
1130: --- If any errors happen abort API
1131: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1132: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1133: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1134: RAISE OKC_API.G_EXCEPTION_ERROR;
1135: END IF;
1136: INSERT INTO OKC_K_ACCESSES(
1137: id,
1138: chr_id,
1158: l_cac_rec.last_update_date,
1159: l_cac_rec.last_update_login);
1160: -- Set OUT values
1161: x_cac_rec := l_cac_rec;
1162: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1163:
1164: IF (l_debug = 'Y') THEN
1165: okc_debug.log('3900: Exiting insert_row', 2);
1166: okc_debug.Reset_Indentation;
1166: okc_debug.Reset_Indentation;
1167: END IF;
1168:
1169: EXCEPTION
1170: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1171:
1172: IF (l_debug = 'Y') THEN
1173: okc_debug.log('4000: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1174: okc_debug.Reset_Indentation;
1169: EXCEPTION
1170: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1171:
1172: IF (l_debug = 'Y') THEN
1173: okc_debug.log('4000: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1174: okc_debug.Reset_Indentation;
1175: END IF;
1176:
1177: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1173: okc_debug.log('4000: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1174: okc_debug.Reset_Indentation;
1175: END IF;
1176:
1177: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1178: (
1179: l_api_name,
1180: G_PKG_NAME,
1181: 'OKC_API.G_RET_STS_ERROR',
1177: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1178: (
1179: l_api_name,
1180: G_PKG_NAME,
1181: 'OKC_API.G_RET_STS_ERROR',
1182: x_msg_count,
1183: x_msg_data,
1184: '_PVT'
1185: );
1182: x_msg_count,
1183: x_msg_data,
1184: '_PVT'
1185: );
1186: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1187:
1188: IF (l_debug = 'Y') THEN
1189: okc_debug.log('4100: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1190: okc_debug.Reset_Indentation;
1185: );
1186: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1187:
1188: IF (l_debug = 'Y') THEN
1189: okc_debug.log('4100: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1190: okc_debug.Reset_Indentation;
1191: END IF;
1192:
1193: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1189: okc_debug.log('4100: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1190: okc_debug.Reset_Indentation;
1191: END IF;
1192:
1193: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1194: (
1195: l_api_name,
1196: G_PKG_NAME,
1197: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1193: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1194: (
1195: l_api_name,
1196: G_PKG_NAME,
1197: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1198: x_msg_count,
1199: x_msg_data,
1200: '_PVT'
1201: );
1205: okc_debug.log('4200: Exiting insert_row:OTHERS Exception', 2);
1206: okc_debug.Reset_Indentation;
1207: END IF;
1208:
1209: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1210: (
1211: l_api_name,
1212: G_PKG_NAME,
1213: 'OTHERS',
1230: x_cacv_rec OUT NOCOPY cacv_rec_type) IS
1231:
1232: l_api_version CONSTANT NUMBER := 1;
1233: l_api_name CONSTANT VARCHAR2(30) := 'V_insert_row';
1234: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1235: l_cacv_rec cacv_rec_type;
1236: l_def_cacv_rec cacv_rec_type;
1237: l_cac_rec cac_rec_type;
1238: lx_cac_rec cac_rec_type;
1270: FUNCTION Set_Attributes (
1271: p_cacv_rec IN cacv_rec_type,
1272: x_cacv_rec OUT NOCOPY cacv_rec_type
1273: ) RETURN VARCHAR2 IS
1274: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1275: BEGIN
1276:
1277: IF (l_debug = 'Y') THEN
1278: okc_debug.Set_Indentation('OKC_CAC_PVT');
1299: okc_debug.Set_Indentation('OKC_CAC_PVT');
1300: okc_debug.log('4800: Entered insert_row', 2);
1301: END IF;
1302:
1303: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
1304: G_PKG_NAME,
1305: p_init_msg_list,
1306: l_api_version,
1307: p_api_version,
1306: l_api_version,
1307: p_api_version,
1308: '_PVT',
1309: x_return_status);
1310: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1311: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1312: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1313: RAISE OKC_API.G_EXCEPTION_ERROR;
1314: END IF;
1307: p_api_version,
1308: '_PVT',
1309: x_return_status);
1310: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1311: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1312: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1313: RAISE OKC_API.G_EXCEPTION_ERROR;
1314: END IF;
1315: l_cacv_rec := null_out_defaults(p_cacv_rec);
1308: '_PVT',
1309: x_return_status);
1310: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1311: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1312: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1313: RAISE OKC_API.G_EXCEPTION_ERROR;
1314: END IF;
1315: l_cacv_rec := null_out_defaults(p_cacv_rec);
1316: -- Set primary key value
1309: x_return_status);
1310: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1311: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1312: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1313: RAISE OKC_API.G_EXCEPTION_ERROR;
1314: END IF;
1315: l_cacv_rec := null_out_defaults(p_cacv_rec);
1316: -- Set primary key value
1317: l_cacv_rec.ID := get_seq_id;
1319: l_return_status := Set_Attributes(
1320: l_cacv_rec, -- IN
1321: l_def_cacv_rec); -- OUT
1322: --- If any errors happen abort API
1323: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1324: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1325: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1326: RAISE OKC_API.G_EXCEPTION_ERROR;
1327: END IF;
1320: l_cacv_rec, -- IN
1321: l_def_cacv_rec); -- OUT
1322: --- If any errors happen abort API
1323: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1324: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1325: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1326: RAISE OKC_API.G_EXCEPTION_ERROR;
1327: END IF;
1328: l_def_cacv_rec := fill_who_columns(l_def_cacv_rec);
1321: l_def_cacv_rec); -- OUT
1322: --- If any errors happen abort API
1323: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1324: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1325: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1326: RAISE OKC_API.G_EXCEPTION_ERROR;
1327: END IF;
1328: l_def_cacv_rec := fill_who_columns(l_def_cacv_rec);
1329: --- Validate all non-missing attributes (Item Level Validation)
1322: --- If any errors happen abort API
1323: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1324: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1325: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1326: RAISE OKC_API.G_EXCEPTION_ERROR;
1327: END IF;
1328: l_def_cacv_rec := fill_who_columns(l_def_cacv_rec);
1329: --- Validate all non-missing attributes (Item Level Validation)
1330: l_return_status := Validate_Attributes(l_def_cacv_rec);
1328: l_def_cacv_rec := fill_who_columns(l_def_cacv_rec);
1329: --- Validate all non-missing attributes (Item Level Validation)
1330: l_return_status := Validate_Attributes(l_def_cacv_rec);
1331: --- If any errors happen abort API
1332: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1333: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1334: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1335: RAISE OKC_API.G_EXCEPTION_ERROR;
1336: END IF;
1329: --- Validate all non-missing attributes (Item Level Validation)
1330: l_return_status := Validate_Attributes(l_def_cacv_rec);
1331: --- If any errors happen abort API
1332: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1333: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1334: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1335: RAISE OKC_API.G_EXCEPTION_ERROR;
1336: END IF;
1337: l_return_status := Validate_Record(l_def_cacv_rec);
1330: l_return_status := Validate_Attributes(l_def_cacv_rec);
1331: --- If any errors happen abort API
1332: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1333: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1334: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1335: RAISE OKC_API.G_EXCEPTION_ERROR;
1336: END IF;
1337: l_return_status := Validate_Record(l_def_cacv_rec);
1338: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1331: --- If any errors happen abort API
1332: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1333: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1334: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1335: RAISE OKC_API.G_EXCEPTION_ERROR;
1336: END IF;
1337: l_return_status := Validate_Record(l_def_cacv_rec);
1338: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1339: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1334: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1335: RAISE OKC_API.G_EXCEPTION_ERROR;
1336: END IF;
1337: l_return_status := Validate_Record(l_def_cacv_rec);
1338: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1339: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1340: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1341: RAISE OKC_API.G_EXCEPTION_ERROR;
1342: END IF;
1335: RAISE OKC_API.G_EXCEPTION_ERROR;
1336: END IF;
1337: l_return_status := Validate_Record(l_def_cacv_rec);
1338: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1339: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1340: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1341: RAISE OKC_API.G_EXCEPTION_ERROR;
1342: END IF;
1343: --------------------------------------
1336: END IF;
1337: l_return_status := Validate_Record(l_def_cacv_rec);
1338: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1339: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1340: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1341: RAISE OKC_API.G_EXCEPTION_ERROR;
1342: END IF;
1343: --------------------------------------
1344: -- Move VIEW record to "Child" records
1337: l_return_status := Validate_Record(l_def_cacv_rec);
1338: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1339: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1340: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1341: RAISE OKC_API.G_EXCEPTION_ERROR;
1342: END IF;
1343: --------------------------------------
1344: -- Move VIEW record to "Child" records
1345: --------------------------------------
1354: x_msg_data,
1355: l_cac_rec,
1356: lx_cac_rec
1357: );
1358: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1359: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1360: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1361: RAISE OKC_API.G_EXCEPTION_ERROR;
1362: END IF;
1355: l_cac_rec,
1356: lx_cac_rec
1357: );
1358: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1359: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1360: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1361: RAISE OKC_API.G_EXCEPTION_ERROR;
1362: END IF;
1363: migrate(lx_cac_rec, l_def_cacv_rec);
1356: lx_cac_rec
1357: );
1358: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1359: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1360: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1361: RAISE OKC_API.G_EXCEPTION_ERROR;
1362: END IF;
1363: migrate(lx_cac_rec, l_def_cacv_rec);
1364: -- Set OUT values
1357: );
1358: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1359: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1360: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1361: RAISE OKC_API.G_EXCEPTION_ERROR;
1362: END IF;
1363: migrate(lx_cac_rec, l_def_cacv_rec);
1364: -- Set OUT values
1365: x_cacv_rec := l_def_cacv_rec;
1362: END IF;
1363: migrate(lx_cac_rec, l_def_cacv_rec);
1364: -- Set OUT values
1365: x_cacv_rec := l_def_cacv_rec;
1366: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1367:
1368: IF (l_debug = 'Y') THEN
1369: okc_debug.log('4850: Leaving insert_row', 2);
1370: okc_debug.Reset_Indentation;
1370: okc_debug.Reset_Indentation;
1371: END IF;
1372:
1373: EXCEPTION
1374: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1375:
1376: IF (l_debug = 'Y') THEN
1377: okc_debug.log('4900: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1378: okc_debug.Reset_Indentation;
1373: EXCEPTION
1374: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1375:
1376: IF (l_debug = 'Y') THEN
1377: okc_debug.log('4900: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1378: okc_debug.Reset_Indentation;
1379: END IF;
1380:
1381: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1377: okc_debug.log('4900: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1378: okc_debug.Reset_Indentation;
1379: END IF;
1380:
1381: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1382: (
1383: l_api_name,
1384: G_PKG_NAME,
1385: 'OKC_API.G_RET_STS_ERROR',
1381: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1382: (
1383: l_api_name,
1384: G_PKG_NAME,
1385: 'OKC_API.G_RET_STS_ERROR',
1386: x_msg_count,
1387: x_msg_data,
1388: '_PVT'
1389: );
1386: x_msg_count,
1387: x_msg_data,
1388: '_PVT'
1389: );
1390: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1391:
1392: IF (l_debug = 'Y') THEN
1393: okc_debug.log('5000: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1394: okc_debug.Reset_Indentation;
1389: );
1390: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1391:
1392: IF (l_debug = 'Y') THEN
1393: okc_debug.log('5000: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1394: okc_debug.Reset_Indentation;
1395: END IF;
1396:
1397: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1393: okc_debug.log('5000: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1394: okc_debug.Reset_Indentation;
1395: END IF;
1396:
1397: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1398: (
1399: l_api_name,
1400: G_PKG_NAME,
1401: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1397: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1398: (
1399: l_api_name,
1400: G_PKG_NAME,
1401: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1402: x_msg_count,
1403: x_msg_data,
1404: '_PVT'
1405: );
1409: okc_debug.log('5100: Exiting insert_row:OTHERS Exception', 2);
1410: okc_debug.Reset_Indentation;
1411: END IF;
1412:
1413: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1414: (
1415: l_api_name,
1416: G_PKG_NAME,
1417: 'OTHERS',
1434: x_cacv_tbl OUT NOCOPY cacv_tbl_type) IS
1435:
1436: l_api_version CONSTANT NUMBER := 1;
1437: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_insert_row';
1438: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1439: l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1440: i NUMBER := 0;
1441: BEGIN
1442:
1435:
1436: l_api_version CONSTANT NUMBER := 1;
1437: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_insert_row';
1438: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1439: l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1440: i NUMBER := 0;
1441: BEGIN
1442:
1443: IF (l_debug = 'Y') THEN
1444: okc_debug.Set_Indentation('OKC_CAC_PVT');
1445: okc_debug.log('5300: Entered insert_row', 2);
1446: END IF;
1447:
1448: OKC_API.init_msg_list(p_init_msg_list);
1449: -- Make sure PL/SQL table has records in it before passing
1450: IF (p_cacv_tbl.COUNT > 0) THEN
1451: i := p_cacv_tbl.FIRST;
1452: LOOP
1451: i := p_cacv_tbl.FIRST;
1452: LOOP
1453: insert_row (
1454: p_api_version => p_api_version,
1455: p_init_msg_list => OKC_API.G_FALSE,
1456: x_return_status => x_return_status,
1457: x_msg_count => x_msg_count,
1458: x_msg_data => x_msg_data,
1459: p_cacv_rec => p_cacv_tbl(i),
1459: p_cacv_rec => p_cacv_tbl(i),
1460: x_cacv_rec => x_cacv_tbl(i));
1461:
1462: -- store the highest degree of error
1463: If x_return_status <> OKC_API.G_RET_STS_SUCCESS Then
1464: If l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
1465: l_overall_status := x_return_status;
1466: End If;
1467: End If;
1460: x_cacv_rec => x_cacv_tbl(i));
1461:
1462: -- store the highest degree of error
1463: If x_return_status <> OKC_API.G_RET_STS_SUCCESS Then
1464: If l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
1465: l_overall_status := x_return_status;
1466: End If;
1467: End If;
1468:
1478: okc_debug.Reset_Indentation;
1479: END IF;
1480:
1481: EXCEPTION
1482: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1483:
1484: IF (l_debug = 'Y') THEN
1485: okc_debug.log('5400: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1486: okc_debug.Reset_Indentation;
1481: EXCEPTION
1482: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1483:
1484: IF (l_debug = 'Y') THEN
1485: okc_debug.log('5400: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1486: okc_debug.Reset_Indentation;
1487: END IF;
1488:
1489: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1485: okc_debug.log('5400: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1486: okc_debug.Reset_Indentation;
1487: END IF;
1488:
1489: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1490: (
1491: l_api_name,
1492: G_PKG_NAME,
1493: 'OKC_API.G_RET_STS_ERROR',
1489: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1490: (
1491: l_api_name,
1492: G_PKG_NAME,
1493: 'OKC_API.G_RET_STS_ERROR',
1494: x_msg_count,
1495: x_msg_data,
1496: '_PVT'
1497: );
1494: x_msg_count,
1495: x_msg_data,
1496: '_PVT'
1497: );
1498: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1499:
1500: IF (l_debug = 'Y') THEN
1501: okc_debug.log('5500: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1502: okc_debug.Reset_Indentation;
1497: );
1498: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1499:
1500: IF (l_debug = 'Y') THEN
1501: okc_debug.log('5500: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1502: okc_debug.Reset_Indentation;
1503: END IF;
1504:
1505: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1501: okc_debug.log('5500: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1502: okc_debug.Reset_Indentation;
1503: END IF;
1504:
1505: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1506: (
1507: l_api_name,
1508: G_PKG_NAME,
1509: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1505: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1506: (
1507: l_api_name,
1508: G_PKG_NAME,
1509: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1510: x_msg_count,
1511: x_msg_data,
1512: '_PVT'
1513: );
1517: okc_debug.log('5600: Exiting insert_row:OTHERS Exception', 2);
1518: okc_debug.Reset_Indentation;
1519: END IF;
1520:
1521: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1522: (
1523: l_api_name,
1524: G_PKG_NAME,
1525: 'OTHERS',
1557: FROM OKC_K_ACCESSES
1558: WHERE ID = p_cac_rec.id;
1559: l_api_version CONSTANT NUMBER := 1;
1560: l_api_name CONSTANT VARCHAR2(30) := 'ACCESSES_lock_row';
1561: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1562: l_object_version_number OKC_K_ACCESSES.OBJECT_VERSION_NUMBER%TYPE;
1563: lc_object_version_number OKC_K_ACCESSES.OBJECT_VERSION_NUMBER%TYPE;
1564: l_row_notfound BOOLEAN := FALSE;
1565: lc_row_notfound BOOLEAN := FALSE;
1569: okc_debug.Set_Indentation('OKC_CAC_PVT');
1570: okc_debug.log('5800: Entered lock_row', 2);
1571: END IF;
1572:
1573: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
1574: p_init_msg_list,
1575: '_PVT',
1576: x_return_status);
1577: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1573: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
1574: p_init_msg_list,
1575: '_PVT',
1576: x_return_status);
1577: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1578: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1579: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1580: RAISE OKC_API.G_EXCEPTION_ERROR;
1581: END IF;
1574: p_init_msg_list,
1575: '_PVT',
1576: x_return_status);
1577: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1578: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1579: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1580: RAISE OKC_API.G_EXCEPTION_ERROR;
1581: END IF;
1582: BEGIN
1575: '_PVT',
1576: x_return_status);
1577: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1578: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1579: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1580: RAISE OKC_API.G_EXCEPTION_ERROR;
1581: END IF;
1582: BEGIN
1583:
1576: x_return_status);
1577: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1578: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1579: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1580: RAISE OKC_API.G_EXCEPTION_ERROR;
1581: END IF;
1582: BEGIN
1583:
1584: IF (l_debug = 'Y') THEN
1606:
1607: IF (lock_csr%ISOPEN) THEN
1608: CLOSE lock_csr;
1609: END IF;
1610: OKC_API.set_message(G_FND_APP,G_FORM_UNABLE_TO_RESERVE_REC);
1611: RAISE APP_EXCEPTIONS.RECORD_LOCK_EXCEPTION;
1612: END;
1613:
1614: IF ( l_row_notfound ) THEN
1617: lc_row_notfound := lchk_csr%NOTFOUND;
1618: CLOSE lchk_csr;
1619: END IF;
1620: IF (lc_row_notfound) THEN
1621: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
1622: RAISE OKC_API.G_EXCEPTION_ERROR;
1623: ELSIF lc_object_version_number > p_cac_rec.object_version_number THEN
1624: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1625: RAISE OKC_API.G_EXCEPTION_ERROR;
1618: CLOSE lchk_csr;
1619: END IF;
1620: IF (lc_row_notfound) THEN
1621: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
1622: RAISE OKC_API.G_EXCEPTION_ERROR;
1623: ELSIF lc_object_version_number > p_cac_rec.object_version_number THEN
1624: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1625: RAISE OKC_API.G_EXCEPTION_ERROR;
1626: ELSIF lc_object_version_number <> p_cac_rec.object_version_number THEN
1620: IF (lc_row_notfound) THEN
1621: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
1622: RAISE OKC_API.G_EXCEPTION_ERROR;
1623: ELSIF lc_object_version_number > p_cac_rec.object_version_number THEN
1624: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1625: RAISE OKC_API.G_EXCEPTION_ERROR;
1626: ELSIF lc_object_version_number <> p_cac_rec.object_version_number THEN
1627: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1628: RAISE OKC_API.G_EXCEPTION_ERROR;
1621: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
1622: RAISE OKC_API.G_EXCEPTION_ERROR;
1623: ELSIF lc_object_version_number > p_cac_rec.object_version_number THEN
1624: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1625: RAISE OKC_API.G_EXCEPTION_ERROR;
1626: ELSIF lc_object_version_number <> p_cac_rec.object_version_number THEN
1627: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1628: RAISE OKC_API.G_EXCEPTION_ERROR;
1629: ELSIF lc_object_version_number = -1 THEN
1623: ELSIF lc_object_version_number > p_cac_rec.object_version_number THEN
1624: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1625: RAISE OKC_API.G_EXCEPTION_ERROR;
1626: ELSIF lc_object_version_number <> p_cac_rec.object_version_number THEN
1627: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1628: RAISE OKC_API.G_EXCEPTION_ERROR;
1629: ELSIF lc_object_version_number = -1 THEN
1630: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
1631: RAISE OKC_API.G_EXCEPTION_ERROR;
1624: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1625: RAISE OKC_API.G_EXCEPTION_ERROR;
1626: ELSIF lc_object_version_number <> p_cac_rec.object_version_number THEN
1627: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1628: RAISE OKC_API.G_EXCEPTION_ERROR;
1629: ELSIF lc_object_version_number = -1 THEN
1630: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
1631: RAISE OKC_API.G_EXCEPTION_ERROR;
1632: END IF;
1626: ELSIF lc_object_version_number <> p_cac_rec.object_version_number THEN
1627: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1628: RAISE OKC_API.G_EXCEPTION_ERROR;
1629: ELSIF lc_object_version_number = -1 THEN
1630: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
1631: RAISE OKC_API.G_EXCEPTION_ERROR;
1632: END IF;
1633: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1634:
1627: OKC_API.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1628: RAISE OKC_API.G_EXCEPTION_ERROR;
1629: ELSIF lc_object_version_number = -1 THEN
1630: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
1631: RAISE OKC_API.G_EXCEPTION_ERROR;
1632: END IF;
1633: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1634:
1635: IF (l_debug = 'Y') THEN
1629: ELSIF lc_object_version_number = -1 THEN
1630: OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
1631: RAISE OKC_API.G_EXCEPTION_ERROR;
1632: END IF;
1633: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1634:
1635: IF (l_debug = 'Y') THEN
1636: okc_debug.log('6000: Exiting lock_row', 2);
1637: okc_debug.Reset_Indentation;
1637: okc_debug.Reset_Indentation;
1638: END IF;
1639:
1640: EXCEPTION
1641: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1642:
1643: IF (l_debug = 'Y') THEN
1644: okc_debug.log('6100: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1645: okc_debug.Reset_Indentation;
1640: EXCEPTION
1641: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1642:
1643: IF (l_debug = 'Y') THEN
1644: okc_debug.log('6100: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1645: okc_debug.Reset_Indentation;
1646: END IF;
1647:
1648: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1644: okc_debug.log('6100: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1645: okc_debug.Reset_Indentation;
1646: END IF;
1647:
1648: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1649: (
1650: l_api_name,
1651: G_PKG_NAME,
1652: 'OKC_API.G_RET_STS_ERROR',
1648: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1649: (
1650: l_api_name,
1651: G_PKG_NAME,
1652: 'OKC_API.G_RET_STS_ERROR',
1653: x_msg_count,
1654: x_msg_data,
1655: '_PVT'
1656: );
1653: x_msg_count,
1654: x_msg_data,
1655: '_PVT'
1656: );
1657: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1658:
1659: IF (l_debug = 'Y') THEN
1660: okc_debug.log('6200: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1661: okc_debug.Reset_Indentation;
1656: );
1657: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1658:
1659: IF (l_debug = 'Y') THEN
1660: okc_debug.log('6200: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1661: okc_debug.Reset_Indentation;
1662: END IF;
1663:
1664: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1660: okc_debug.log('6200: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1661: okc_debug.Reset_Indentation;
1662: END IF;
1663:
1664: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1665: (
1666: l_api_name,
1667: G_PKG_NAME,
1668: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1664: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1665: (
1666: l_api_name,
1667: G_PKG_NAME,
1668: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1669: x_msg_count,
1670: x_msg_data,
1671: '_PVT'
1672: );
1676: okc_debug.log('6300: Exiting lock_row:OTHERS Exception', 2);
1677: okc_debug.Reset_Indentation;
1678: END IF;
1679:
1680: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1681: (
1682: l_api_name,
1683: G_PKG_NAME,
1684: 'OTHERS',
1700: p_cacv_rec IN cacv_rec_type) IS
1701:
1702: l_api_version CONSTANT NUMBER := 1;
1703: l_api_name CONSTANT VARCHAR2(30) := 'V_lock_row';
1704: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1705: l_cac_rec cac_rec_type;
1706: BEGIN
1707:
1708: IF (l_debug = 'Y') THEN
1709: okc_debug.Set_Indentation('OKC_CAC_PVT');
1710: okc_debug.log('6500: Entered lock_row', 2);
1711: END IF;
1712:
1713: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
1714: G_PKG_NAME,
1715: p_init_msg_list,
1716: l_api_version,
1717: p_api_version,
1716: l_api_version,
1717: p_api_version,
1718: '_PVT',
1719: x_return_status);
1720: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1721: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1722: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1723: RAISE OKC_API.G_EXCEPTION_ERROR;
1724: END IF;
1717: p_api_version,
1718: '_PVT',
1719: x_return_status);
1720: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1721: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1722: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1723: RAISE OKC_API.G_EXCEPTION_ERROR;
1724: END IF;
1725: --------------------------------------
1718: '_PVT',
1719: x_return_status);
1720: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1721: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1722: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1723: RAISE OKC_API.G_EXCEPTION_ERROR;
1724: END IF;
1725: --------------------------------------
1726: -- Move VIEW record to "Child" records
1719: x_return_status);
1720: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1721: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1722: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
1723: RAISE OKC_API.G_EXCEPTION_ERROR;
1724: END IF;
1725: --------------------------------------
1726: -- Move VIEW record to "Child" records
1727: --------------------------------------
1735: x_msg_count,
1736: x_msg_data,
1737: l_cac_rec
1738: );
1739: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1740: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1741: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1742: RAISE OKC_API.G_EXCEPTION_ERROR;
1743: END IF;
1736: x_msg_data,
1737: l_cac_rec
1738: );
1739: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1740: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1741: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1742: RAISE OKC_API.G_EXCEPTION_ERROR;
1743: END IF;
1744: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1737: l_cac_rec
1738: );
1739: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1740: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1741: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1742: RAISE OKC_API.G_EXCEPTION_ERROR;
1743: END IF;
1744: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1745:
1738: );
1739: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1740: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1741: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1742: RAISE OKC_API.G_EXCEPTION_ERROR;
1743: END IF;
1744: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1745:
1746: IF (l_debug = 'Y') THEN
1740: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
1741: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
1742: RAISE OKC_API.G_EXCEPTION_ERROR;
1743: END IF;
1744: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
1745:
1746: IF (l_debug = 'Y') THEN
1747: okc_debug.log('6550: Leaving lock_row ', 2);
1748: okc_debug.Reset_Indentation;
1748: okc_debug.Reset_Indentation;
1749: END IF;
1750:
1751: EXCEPTION
1752: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1753:
1754: IF (l_debug = 'Y') THEN
1755: okc_debug.log('6600: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1756: okc_debug.Reset_Indentation;
1751: EXCEPTION
1752: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1753:
1754: IF (l_debug = 'Y') THEN
1755: okc_debug.log('6600: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1756: okc_debug.Reset_Indentation;
1757: END IF;
1758:
1759: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1755: okc_debug.log('6600: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1756: okc_debug.Reset_Indentation;
1757: END IF;
1758:
1759: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1760: (
1761: l_api_name,
1762: G_PKG_NAME,
1763: 'OKC_API.G_RET_STS_ERROR',
1759: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1760: (
1761: l_api_name,
1762: G_PKG_NAME,
1763: 'OKC_API.G_RET_STS_ERROR',
1764: x_msg_count,
1765: x_msg_data,
1766: '_PVT'
1767: );
1764: x_msg_count,
1765: x_msg_data,
1766: '_PVT'
1767: );
1768: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1769:
1770: IF (l_debug = 'Y') THEN
1771: okc_debug.log('6700: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1772: okc_debug.Reset_Indentation;
1767: );
1768: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1769:
1770: IF (l_debug = 'Y') THEN
1771: okc_debug.log('6700: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1772: okc_debug.Reset_Indentation;
1773: END IF;
1774:
1775: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1771: okc_debug.log('6700: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1772: okc_debug.Reset_Indentation;
1773: END IF;
1774:
1775: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1776: (
1777: l_api_name,
1778: G_PKG_NAME,
1779: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1775: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1776: (
1777: l_api_name,
1778: G_PKG_NAME,
1779: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1780: x_msg_count,
1781: x_msg_data,
1782: '_PVT'
1783: );
1787: okc_debug.log('6800: Exiting lock_row:OTHERS Exception', 2);
1788: okc_debug.Reset_Indentation;
1789: END IF;
1790:
1791: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1792: (
1793: l_api_name,
1794: G_PKG_NAME,
1795: 'OTHERS',
1811: p_cacv_tbl IN cacv_tbl_type) IS
1812:
1813: l_api_version CONSTANT NUMBER := 1;
1814: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_lock_row';
1815: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1816: l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1817: i NUMBER := 0;
1818: BEGIN
1819:
1812:
1813: l_api_version CONSTANT NUMBER := 1;
1814: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_lock_row';
1815: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1816: l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1817: i NUMBER := 0;
1818: BEGIN
1819:
1820: IF (l_debug = 'Y') THEN
1821: okc_debug.Set_Indentation('OKC_CAC_PVT');
1822: okc_debug.log('7000: Entered lock_row', 2);
1823: END IF;
1824:
1825: OKC_API.init_msg_list(p_init_msg_list);
1826: -- Make sure PL/SQL table has records in it before passing
1827: IF (p_cacv_tbl.COUNT > 0) THEN
1828: i := p_cacv_tbl.FIRST;
1829: LOOP
1828: i := p_cacv_tbl.FIRST;
1829: LOOP
1830: lock_row (
1831: p_api_version => p_api_version,
1832: p_init_msg_list => OKC_API.G_FALSE,
1833: x_return_status => x_return_status,
1834: x_msg_count => x_msg_count,
1835: x_msg_data => x_msg_data,
1836: p_cacv_rec => p_cacv_tbl(i));
1835: x_msg_data => x_msg_data,
1836: p_cacv_rec => p_cacv_tbl(i));
1837:
1838: -- store the highest degree of error
1839: If x_return_status <> OKC_API.G_RET_STS_SUCCESS Then
1840: If l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
1841: l_overall_status := x_return_status;
1842: End If;
1843: End If;
1836: p_cacv_rec => p_cacv_tbl(i));
1837:
1838: -- store the highest degree of error
1839: If x_return_status <> OKC_API.G_RET_STS_SUCCESS Then
1840: If l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
1841: l_overall_status := x_return_status;
1842: End If;
1843: End If;
1844:
1854: okc_debug.Reset_Indentation;
1855: END IF;
1856:
1857: EXCEPTION
1858: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1859:
1860: IF (l_debug = 'Y') THEN
1861: okc_debug.log('7100: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1862: okc_debug.Reset_Indentation;
1857: EXCEPTION
1858: WHEN OKC_API.G_EXCEPTION_ERROR THEN
1859:
1860: IF (l_debug = 'Y') THEN
1861: okc_debug.log('7100: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1862: okc_debug.Reset_Indentation;
1863: END IF;
1864:
1865: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1861: okc_debug.log('7100: Exiting lock_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
1862: okc_debug.Reset_Indentation;
1863: END IF;
1864:
1865: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1866: (
1867: l_api_name,
1868: G_PKG_NAME,
1869: 'OKC_API.G_RET_STS_ERROR',
1865: x_return_status := OKC_API.HANDLE_EXCEPTIONS
1866: (
1867: l_api_name,
1868: G_PKG_NAME,
1869: 'OKC_API.G_RET_STS_ERROR',
1870: x_msg_count,
1871: x_msg_data,
1872: '_PVT'
1873: );
1870: x_msg_count,
1871: x_msg_data,
1872: '_PVT'
1873: );
1874: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1875:
1876: IF (l_debug = 'Y') THEN
1877: okc_debug.log('7200: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1878: okc_debug.Reset_Indentation;
1873: );
1874: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
1875:
1876: IF (l_debug = 'Y') THEN
1877: okc_debug.log('7200: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1878: okc_debug.Reset_Indentation;
1879: END IF;
1880:
1881: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1877: okc_debug.log('7200: Exiting lock_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
1878: okc_debug.Reset_Indentation;
1879: END IF;
1880:
1881: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1882: (
1883: l_api_name,
1884: G_PKG_NAME,
1885: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1881: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1882: (
1883: l_api_name,
1884: G_PKG_NAME,
1885: 'OKC_API.G_RET_STS_UNEXP_ERROR',
1886: x_msg_count,
1887: x_msg_data,
1888: '_PVT'
1889: );
1893: okc_debug.log('7300: Exiting lock_row:OTHERS Exception', 2);
1894: okc_debug.Reset_Indentation;
1895: END IF;
1896:
1897: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
1898: (
1899: l_api_name,
1900: G_PKG_NAME,
1901: 'OTHERS',
1921: x_cac_rec OUT NOCOPY cac_rec_type) IS
1922:
1923: l_api_version CONSTANT NUMBER := 1;
1924: l_api_name CONSTANT VARCHAR2(30) := 'ACCESSES_update_row';
1925: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1926: l_cac_rec cac_rec_type := p_cac_rec;
1927: l_def_cac_rec cac_rec_type;
1928: l_row_notfound BOOLEAN := TRUE;
1929: ----------------------------------
1934: x_cac_rec OUT NOCOPY cac_rec_type
1935: ) RETURN VARCHAR2 IS
1936: l_cac_rec cac_rec_type;
1937: l_row_notfound BOOLEAN := TRUE;
1938: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1939: BEGIN
1940:
1941: IF (l_debug = 'Y') THEN
1942: okc_debug.Set_Indentation('OKC_CAC_PVT');
1946: x_cac_rec := p_cac_rec;
1947: -- Get current database values
1948: l_cac_rec := get_rec(p_cac_rec, l_row_notfound);
1949: IF (l_row_notfound) THEN
1950: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1951: END IF;
1952: IF (x_cac_rec.id = OKC_API.G_MISS_NUM)
1953: THEN
1954: x_cac_rec.id := l_cac_rec.id;
1948: l_cac_rec := get_rec(p_cac_rec, l_row_notfound);
1949: IF (l_row_notfound) THEN
1950: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1951: END IF;
1952: IF (x_cac_rec.id = OKC_API.G_MISS_NUM)
1953: THEN
1954: x_cac_rec.id := l_cac_rec.id;
1955: END IF;
1956: IF (x_cac_rec.chr_id = OKC_API.G_MISS_NUM)
1952: IF (x_cac_rec.id = OKC_API.G_MISS_NUM)
1953: THEN
1954: x_cac_rec.id := l_cac_rec.id;
1955: END IF;
1956: IF (x_cac_rec.chr_id = OKC_API.G_MISS_NUM)
1957: THEN
1958: x_cac_rec.chr_id := l_cac_rec.chr_id;
1959: END IF;
1960: IF (x_cac_rec.group_id = OKC_API.G_MISS_NUM)
1956: IF (x_cac_rec.chr_id = OKC_API.G_MISS_NUM)
1957: THEN
1958: x_cac_rec.chr_id := l_cac_rec.chr_id;
1959: END IF;
1960: IF (x_cac_rec.group_id = OKC_API.G_MISS_NUM)
1961: THEN
1962: x_cac_rec.group_id := l_cac_rec.group_id;
1963: END IF;
1964: IF (x_cac_rec.resource_id = OKC_API.G_MISS_NUM)
1960: IF (x_cac_rec.group_id = OKC_API.G_MISS_NUM)
1961: THEN
1962: x_cac_rec.group_id := l_cac_rec.group_id;
1963: END IF;
1964: IF (x_cac_rec.resource_id = OKC_API.G_MISS_NUM)
1965: THEN
1966: x_cac_rec.resource_id := l_cac_rec.resource_id;
1967: END IF;
1968: IF (x_cac_rec.access_level = OKC_API.G_MISS_CHAR)
1964: IF (x_cac_rec.resource_id = OKC_API.G_MISS_NUM)
1965: THEN
1966: x_cac_rec.resource_id := l_cac_rec.resource_id;
1967: END IF;
1968: IF (x_cac_rec.access_level = OKC_API.G_MISS_CHAR)
1969: THEN
1970: x_cac_rec.access_level := l_cac_rec.access_level;
1971: END IF;
1972: IF (x_cac_rec.object_version_number = OKC_API.G_MISS_NUM)
1968: IF (x_cac_rec.access_level = OKC_API.G_MISS_CHAR)
1969: THEN
1970: x_cac_rec.access_level := l_cac_rec.access_level;
1971: END IF;
1972: IF (x_cac_rec.object_version_number = OKC_API.G_MISS_NUM)
1973: THEN
1974: x_cac_rec.object_version_number := l_cac_rec.object_version_number;
1975: END IF;
1976: IF (x_cac_rec.created_by = OKC_API.G_MISS_NUM)
1972: IF (x_cac_rec.object_version_number = OKC_API.G_MISS_NUM)
1973: THEN
1974: x_cac_rec.object_version_number := l_cac_rec.object_version_number;
1975: END IF;
1976: IF (x_cac_rec.created_by = OKC_API.G_MISS_NUM)
1977: THEN
1978: x_cac_rec.created_by := l_cac_rec.created_by;
1979: END IF;
1980: IF (x_cac_rec.creation_date = OKC_API.G_MISS_DATE)
1976: IF (x_cac_rec.created_by = OKC_API.G_MISS_NUM)
1977: THEN
1978: x_cac_rec.created_by := l_cac_rec.created_by;
1979: END IF;
1980: IF (x_cac_rec.creation_date = OKC_API.G_MISS_DATE)
1981: THEN
1982: x_cac_rec.creation_date := l_cac_rec.creation_date;
1983: END IF;
1984: IF (x_cac_rec.last_updated_by = OKC_API.G_MISS_NUM)
1980: IF (x_cac_rec.creation_date = OKC_API.G_MISS_DATE)
1981: THEN
1982: x_cac_rec.creation_date := l_cac_rec.creation_date;
1983: END IF;
1984: IF (x_cac_rec.last_updated_by = OKC_API.G_MISS_NUM)
1985: THEN
1986: x_cac_rec.last_updated_by := l_cac_rec.last_updated_by;
1987: END IF;
1988: IF (x_cac_rec.last_update_date = OKC_API.G_MISS_DATE)
1984: IF (x_cac_rec.last_updated_by = OKC_API.G_MISS_NUM)
1985: THEN
1986: x_cac_rec.last_updated_by := l_cac_rec.last_updated_by;
1987: END IF;
1988: IF (x_cac_rec.last_update_date = OKC_API.G_MISS_DATE)
1989: THEN
1990: x_cac_rec.last_update_date := l_cac_rec.last_update_date;
1991: END IF;
1992: IF (x_cac_rec.last_update_login = OKC_API.G_MISS_NUM)
1988: IF (x_cac_rec.last_update_date = OKC_API.G_MISS_DATE)
1989: THEN
1990: x_cac_rec.last_update_date := l_cac_rec.last_update_date;
1991: END IF;
1992: IF (x_cac_rec.last_update_login = OKC_API.G_MISS_NUM)
1993: THEN
1994: x_cac_rec.last_update_login := l_cac_rec.last_update_login;
1995: END IF;
1996:
2008: FUNCTION Set_Attributes (
2009: p_cac_rec IN cac_rec_type,
2010: x_cac_rec OUT NOCOPY cac_rec_type
2011: ) RETURN VARCHAR2 IS
2012: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2013: BEGIN
2014: x_cac_rec := p_cac_rec;
2015: RETURN(l_return_status);
2016:
2021: okc_debug.Set_Indentation('OKC_CAC_PVT');
2022: okc_debug.log('7700: Entered update_row', 2);
2023: END IF;
2024:
2025: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2026: p_init_msg_list,
2027: '_PVT',
2028: x_return_status);
2029: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2025: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2026: p_init_msg_list,
2027: '_PVT',
2028: x_return_status);
2029: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2030: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2031: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2032: RAISE OKC_API.G_EXCEPTION_ERROR;
2033: END IF;
2026: p_init_msg_list,
2027: '_PVT',
2028: x_return_status);
2029: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2030: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2031: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2032: RAISE OKC_API.G_EXCEPTION_ERROR;
2033: END IF;
2034: --- Setting item attributes
2027: '_PVT',
2028: x_return_status);
2029: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2030: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2031: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2032: RAISE OKC_API.G_EXCEPTION_ERROR;
2033: END IF;
2034: --- Setting item attributes
2035: l_return_status := Set_Attributes(
2028: x_return_status);
2029: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2030: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2031: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2032: RAISE OKC_API.G_EXCEPTION_ERROR;
2033: END IF;
2034: --- Setting item attributes
2035: l_return_status := Set_Attributes(
2036: p_cac_rec, -- IN
2035: l_return_status := Set_Attributes(
2036: p_cac_rec, -- IN
2037: l_cac_rec); -- OUT
2038: --- If any errors happen abort API
2039: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2040: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2041: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2042: RAISE OKC_API.G_EXCEPTION_ERROR;
2043: END IF;
2036: p_cac_rec, -- IN
2037: l_cac_rec); -- OUT
2038: --- If any errors happen abort API
2039: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2040: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2041: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2042: RAISE OKC_API.G_EXCEPTION_ERROR;
2043: END IF;
2044: l_return_status := populate_new_record(l_cac_rec, l_def_cac_rec);
2037: l_cac_rec); -- OUT
2038: --- If any errors happen abort API
2039: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2040: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2041: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2042: RAISE OKC_API.G_EXCEPTION_ERROR;
2043: END IF;
2044: l_return_status := populate_new_record(l_cac_rec, l_def_cac_rec);
2045: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2038: --- If any errors happen abort API
2039: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2040: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2041: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2042: RAISE OKC_API.G_EXCEPTION_ERROR;
2043: END IF;
2044: l_return_status := populate_new_record(l_cac_rec, l_def_cac_rec);
2045: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2046: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2041: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2042: RAISE OKC_API.G_EXCEPTION_ERROR;
2043: END IF;
2044: l_return_status := populate_new_record(l_cac_rec, l_def_cac_rec);
2045: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2046: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2047: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2048: RAISE OKC_API.G_EXCEPTION_ERROR;
2049: END IF;
2042: RAISE OKC_API.G_EXCEPTION_ERROR;
2043: END IF;
2044: l_return_status := populate_new_record(l_cac_rec, l_def_cac_rec);
2045: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2046: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2047: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2048: RAISE OKC_API.G_EXCEPTION_ERROR;
2049: END IF;
2050: UPDATE OKC_K_ACCESSES
2043: END IF;
2044: l_return_status := populate_new_record(l_cac_rec, l_def_cac_rec);
2045: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2046: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2047: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2048: RAISE OKC_API.G_EXCEPTION_ERROR;
2049: END IF;
2050: UPDATE OKC_K_ACCESSES
2051: SET CHR_ID = l_def_cac_rec.chr_id,
2044: l_return_status := populate_new_record(l_cac_rec, l_def_cac_rec);
2045: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2046: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2047: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2048: RAISE OKC_API.G_EXCEPTION_ERROR;
2049: END IF;
2050: UPDATE OKC_K_ACCESSES
2051: SET CHR_ID = l_def_cac_rec.chr_id,
2052: GROUP_ID = l_def_cac_rec.group_id,
2060: LAST_UPDATE_LOGIN = l_def_cac_rec.last_update_login
2061: WHERE ID = l_def_cac_rec.id;
2062:
2063: x_cac_rec := l_def_cac_rec;
2064: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2065:
2066: IF (l_debug = 'Y') THEN
2067: okc_debug.log('7750: Leaving update_row', 2);
2068: okc_debug.Reset_Indentation;
2068: okc_debug.Reset_Indentation;
2069: END IF;
2070:
2071: EXCEPTION
2072: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2073:
2074: IF (l_debug = 'Y') THEN
2075: okc_debug.log('7800: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2076: okc_debug.Reset_Indentation;
2071: EXCEPTION
2072: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2073:
2074: IF (l_debug = 'Y') THEN
2075: okc_debug.log('7800: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2076: okc_debug.Reset_Indentation;
2077: END IF;
2078:
2079: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2075: okc_debug.log('7800: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2076: okc_debug.Reset_Indentation;
2077: END IF;
2078:
2079: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2080: (
2081: l_api_name,
2082: G_PKG_NAME,
2083: 'OKC_API.G_RET_STS_ERROR',
2079: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2080: (
2081: l_api_name,
2082: G_PKG_NAME,
2083: 'OKC_API.G_RET_STS_ERROR',
2084: x_msg_count,
2085: x_msg_data,
2086: '_PVT'
2087: );
2084: x_msg_count,
2085: x_msg_data,
2086: '_PVT'
2087: );
2088: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2089:
2090: IF (l_debug = 'Y') THEN
2091: okc_debug.log('7900: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2092: okc_debug.Reset_Indentation;
2087: );
2088: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2089:
2090: IF (l_debug = 'Y') THEN
2091: okc_debug.log('7900: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2092: okc_debug.Reset_Indentation;
2093: END IF;
2094:
2095: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2091: okc_debug.log('7900: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2092: okc_debug.Reset_Indentation;
2093: END IF;
2094:
2095: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2096: (
2097: l_api_name,
2098: G_PKG_NAME,
2099: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2095: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2096: (
2097: l_api_name,
2098: G_PKG_NAME,
2099: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2100: x_msg_count,
2101: x_msg_data,
2102: '_PVT'
2103: );
2107: okc_debug.log('8000: Exiting update_row:OTHERS Exception', 2);
2108: okc_debug.Reset_Indentation;
2109: END IF;
2110:
2111: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2112: (
2113: l_api_name,
2114: G_PKG_NAME,
2115: 'OTHERS',
2132: x_cacv_rec OUT NOCOPY cacv_rec_type) IS
2133:
2134: l_api_version CONSTANT NUMBER := 1;
2135: l_api_name CONSTANT VARCHAR2(30) := 'V_update_row';
2136: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2137: l_cacv_rec cacv_rec_type := p_cacv_rec;
2138: l_def_cacv_rec cacv_rec_type;
2139: l_cac_rec cac_rec_type;
2140: lx_cac_rec cac_rec_type;
2161: x_cacv_rec OUT NOCOPY cacv_rec_type
2162: ) RETURN VARCHAR2 IS
2163: l_cacv_rec cacv_rec_type;
2164: l_row_notfound BOOLEAN := TRUE;
2165: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2166: BEGIN
2167:
2168: IF (l_debug = 'Y') THEN
2169: okc_debug.Set_Indentation('OKC_CAC_PVT');
2173: x_cacv_rec := p_cacv_rec;
2174: -- Get current database values
2175: l_cacv_rec := get_rec(p_cacv_rec, l_row_notfound);
2176: IF (l_row_notfound) THEN
2177: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2178: END IF;
2179: IF (x_cacv_rec.id = OKC_API.G_MISS_NUM)
2180: THEN
2181: x_cacv_rec.id := l_cacv_rec.id;
2175: l_cacv_rec := get_rec(p_cacv_rec, l_row_notfound);
2176: IF (l_row_notfound) THEN
2177: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2178: END IF;
2179: IF (x_cacv_rec.id = OKC_API.G_MISS_NUM)
2180: THEN
2181: x_cacv_rec.id := l_cacv_rec.id;
2182: END IF;
2183: IF (x_cacv_rec.object_version_number = OKC_API.G_MISS_NUM)
2179: IF (x_cacv_rec.id = OKC_API.G_MISS_NUM)
2180: THEN
2181: x_cacv_rec.id := l_cacv_rec.id;
2182: END IF;
2183: IF (x_cacv_rec.object_version_number = OKC_API.G_MISS_NUM)
2184: THEN
2185: x_cacv_rec.object_version_number := l_cacv_rec.object_version_number;
2186: END IF;
2187: IF (x_cacv_rec.group_id = OKC_API.G_MISS_NUM)
2183: IF (x_cacv_rec.object_version_number = OKC_API.G_MISS_NUM)
2184: THEN
2185: x_cacv_rec.object_version_number := l_cacv_rec.object_version_number;
2186: END IF;
2187: IF (x_cacv_rec.group_id = OKC_API.G_MISS_NUM)
2188: THEN
2189: x_cacv_rec.group_id := l_cacv_rec.group_id;
2190: END IF;
2191: IF (x_cacv_rec.chr_id = OKC_API.G_MISS_NUM)
2187: IF (x_cacv_rec.group_id = OKC_API.G_MISS_NUM)
2188: THEN
2189: x_cacv_rec.group_id := l_cacv_rec.group_id;
2190: END IF;
2191: IF (x_cacv_rec.chr_id = OKC_API.G_MISS_NUM)
2192: THEN
2193: x_cacv_rec.chr_id := l_cacv_rec.chr_id;
2194: END IF;
2195: IF (x_cacv_rec.resource_id = OKC_API.G_MISS_NUM)
2191: IF (x_cacv_rec.chr_id = OKC_API.G_MISS_NUM)
2192: THEN
2193: x_cacv_rec.chr_id := l_cacv_rec.chr_id;
2194: END IF;
2195: IF (x_cacv_rec.resource_id = OKC_API.G_MISS_NUM)
2196: THEN
2197: x_cacv_rec.resource_id := l_cacv_rec.resource_id;
2198: END IF;
2199: IF (x_cacv_rec.access_level = OKC_API.G_MISS_CHAR)
2195: IF (x_cacv_rec.resource_id = OKC_API.G_MISS_NUM)
2196: THEN
2197: x_cacv_rec.resource_id := l_cacv_rec.resource_id;
2198: END IF;
2199: IF (x_cacv_rec.access_level = OKC_API.G_MISS_CHAR)
2200: THEN
2201: x_cacv_rec.access_level := l_cacv_rec.access_level;
2202: END IF;
2203: IF (x_cacv_rec.created_by = OKC_API.G_MISS_NUM)
2199: IF (x_cacv_rec.access_level = OKC_API.G_MISS_CHAR)
2200: THEN
2201: x_cacv_rec.access_level := l_cacv_rec.access_level;
2202: END IF;
2203: IF (x_cacv_rec.created_by = OKC_API.G_MISS_NUM)
2204: THEN
2205: x_cacv_rec.created_by := l_cacv_rec.created_by;
2206: END IF;
2207: IF (x_cacv_rec.creation_date = OKC_API.G_MISS_DATE)
2203: IF (x_cacv_rec.created_by = OKC_API.G_MISS_NUM)
2204: THEN
2205: x_cacv_rec.created_by := l_cacv_rec.created_by;
2206: END IF;
2207: IF (x_cacv_rec.creation_date = OKC_API.G_MISS_DATE)
2208: THEN
2209: x_cacv_rec.creation_date := l_cacv_rec.creation_date;
2210: END IF;
2211: IF (x_cacv_rec.last_updated_by = OKC_API.G_MISS_NUM)
2207: IF (x_cacv_rec.creation_date = OKC_API.G_MISS_DATE)
2208: THEN
2209: x_cacv_rec.creation_date := l_cacv_rec.creation_date;
2210: END IF;
2211: IF (x_cacv_rec.last_updated_by = OKC_API.G_MISS_NUM)
2212: THEN
2213: x_cacv_rec.last_updated_by := l_cacv_rec.last_updated_by;
2214: END IF;
2215: IF (x_cacv_rec.last_update_date = OKC_API.G_MISS_DATE)
2211: IF (x_cacv_rec.last_updated_by = OKC_API.G_MISS_NUM)
2212: THEN
2213: x_cacv_rec.last_updated_by := l_cacv_rec.last_updated_by;
2214: END IF;
2215: IF (x_cacv_rec.last_update_date = OKC_API.G_MISS_DATE)
2216: THEN
2217: x_cacv_rec.last_update_date := l_cacv_rec.last_update_date;
2218: END IF;
2219: IF (x_cacv_rec.last_update_login = OKC_API.G_MISS_NUM)
2215: IF (x_cacv_rec.last_update_date = OKC_API.G_MISS_DATE)
2216: THEN
2217: x_cacv_rec.last_update_date := l_cacv_rec.last_update_date;
2218: END IF;
2219: IF (x_cacv_rec.last_update_login = OKC_API.G_MISS_NUM)
2220: THEN
2221: x_cacv_rec.last_update_login := l_cacv_rec.last_update_login;
2222: END IF;
2223:
2235: FUNCTION Set_Attributes (
2236: p_cacv_rec IN cacv_rec_type,
2237: x_cacv_rec OUT NOCOPY cacv_rec_type
2238: ) RETURN VARCHAR2 IS
2239: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2240: BEGIN
2241:
2242: x_cacv_rec := p_cacv_rec;
2243: x_cacv_rec.OBJECT_VERSION_NUMBER := NVL(x_cacv_rec.OBJECT_VERSION_NUMBER, 0) + 1;
2253: okc_debug.Set_Indentation('OKC_CAC_PVT');
2254: okc_debug.log('8400: Entered update_row', 2);
2255: END IF;
2256:
2257: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2258: G_PKG_NAME,
2259: p_init_msg_list,
2260: l_api_version,
2261: p_api_version,
2260: l_api_version,
2261: p_api_version,
2262: '_PVT',
2263: x_return_status);
2264: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2265: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2266: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2267: RAISE OKC_API.G_EXCEPTION_ERROR;
2268: END IF;
2261: p_api_version,
2262: '_PVT',
2263: x_return_status);
2264: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2265: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2266: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2267: RAISE OKC_API.G_EXCEPTION_ERROR;
2268: END IF;
2269: --- Setting item attributes
2262: '_PVT',
2263: x_return_status);
2264: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2265: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2266: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2267: RAISE OKC_API.G_EXCEPTION_ERROR;
2268: END IF;
2269: --- Setting item attributes
2270: l_return_status := Set_Attributes(
2263: x_return_status);
2264: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2265: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2266: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2267: RAISE OKC_API.G_EXCEPTION_ERROR;
2268: END IF;
2269: --- Setting item attributes
2270: l_return_status := Set_Attributes(
2271: p_cacv_rec, -- IN
2270: l_return_status := Set_Attributes(
2271: p_cacv_rec, -- IN
2272: l_cacv_rec); -- OUT
2273: --- If any errors happen abort API
2274: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2275: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2276: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2277: RAISE OKC_API.G_EXCEPTION_ERROR;
2278: END IF;
2271: p_cacv_rec, -- IN
2272: l_cacv_rec); -- OUT
2273: --- If any errors happen abort API
2274: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2275: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2276: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2277: RAISE OKC_API.G_EXCEPTION_ERROR;
2278: END IF;
2279: l_return_status := populate_new_record(l_cacv_rec, l_def_cacv_rec);
2272: l_cacv_rec); -- OUT
2273: --- If any errors happen abort API
2274: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2275: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2276: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2277: RAISE OKC_API.G_EXCEPTION_ERROR;
2278: END IF;
2279: l_return_status := populate_new_record(l_cacv_rec, l_def_cacv_rec);
2280: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2273: --- If any errors happen abort API
2274: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2275: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2276: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2277: RAISE OKC_API.G_EXCEPTION_ERROR;
2278: END IF;
2279: l_return_status := populate_new_record(l_cacv_rec, l_def_cacv_rec);
2280: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2281: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2276: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2277: RAISE OKC_API.G_EXCEPTION_ERROR;
2278: END IF;
2279: l_return_status := populate_new_record(l_cacv_rec, l_def_cacv_rec);
2280: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2281: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2282: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2283: RAISE OKC_API.G_EXCEPTION_ERROR;
2284: END IF;
2277: RAISE OKC_API.G_EXCEPTION_ERROR;
2278: END IF;
2279: l_return_status := populate_new_record(l_cacv_rec, l_def_cacv_rec);
2280: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2281: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2282: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2283: RAISE OKC_API.G_EXCEPTION_ERROR;
2284: END IF;
2285: l_def_cacv_rec := fill_who_columns(l_def_cacv_rec);
2278: END IF;
2279: l_return_status := populate_new_record(l_cacv_rec, l_def_cacv_rec);
2280: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2281: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2282: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2283: RAISE OKC_API.G_EXCEPTION_ERROR;
2284: END IF;
2285: l_def_cacv_rec := fill_who_columns(l_def_cacv_rec);
2286: --- Validate all non-missing attributes (Item Level Validation)
2279: l_return_status := populate_new_record(l_cacv_rec, l_def_cacv_rec);
2280: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2281: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2282: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2283: RAISE OKC_API.G_EXCEPTION_ERROR;
2284: END IF;
2285: l_def_cacv_rec := fill_who_columns(l_def_cacv_rec);
2286: --- Validate all non-missing attributes (Item Level Validation)
2287: l_return_status := Validate_Attributes(l_def_cacv_rec);
2285: l_def_cacv_rec := fill_who_columns(l_def_cacv_rec);
2286: --- Validate all non-missing attributes (Item Level Validation)
2287: l_return_status := Validate_Attributes(l_def_cacv_rec);
2288: --- If any errors happen abort API
2289: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2290: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2291: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2292: RAISE OKC_API.G_EXCEPTION_ERROR;
2293: END IF;
2286: --- Validate all non-missing attributes (Item Level Validation)
2287: l_return_status := Validate_Attributes(l_def_cacv_rec);
2288: --- If any errors happen abort API
2289: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2290: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2291: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2292: RAISE OKC_API.G_EXCEPTION_ERROR;
2293: END IF;
2294: l_return_status := Validate_Record(l_def_cacv_rec);
2287: l_return_status := Validate_Attributes(l_def_cacv_rec);
2288: --- If any errors happen abort API
2289: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2290: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2291: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2292: RAISE OKC_API.G_EXCEPTION_ERROR;
2293: END IF;
2294: l_return_status := Validate_Record(l_def_cacv_rec);
2295: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2288: --- If any errors happen abort API
2289: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2290: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2291: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2292: RAISE OKC_API.G_EXCEPTION_ERROR;
2293: END IF;
2294: l_return_status := Validate_Record(l_def_cacv_rec);
2295: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2296: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2291: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2292: RAISE OKC_API.G_EXCEPTION_ERROR;
2293: END IF;
2294: l_return_status := Validate_Record(l_def_cacv_rec);
2295: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2296: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2297: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2298: RAISE OKC_API.G_EXCEPTION_ERROR;
2299: END IF;
2292: RAISE OKC_API.G_EXCEPTION_ERROR;
2293: END IF;
2294: l_return_status := Validate_Record(l_def_cacv_rec);
2295: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2296: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2297: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2298: RAISE OKC_API.G_EXCEPTION_ERROR;
2299: END IF;
2300:
2293: END IF;
2294: l_return_status := Validate_Record(l_def_cacv_rec);
2295: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2296: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2297: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2298: RAISE OKC_API.G_EXCEPTION_ERROR;
2299: END IF;
2300:
2301: --------------------------------------
2294: l_return_status := Validate_Record(l_def_cacv_rec);
2295: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2296: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2297: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2298: RAISE OKC_API.G_EXCEPTION_ERROR;
2299: END IF;
2300:
2301: --------------------------------------
2302: -- Move VIEW record to "Child" records
2312: x_msg_data,
2313: l_cac_rec,
2314: lx_cac_rec
2315: );
2316: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2317: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2318: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2319: RAISE OKC_API.G_EXCEPTION_ERROR;
2320: END IF;
2313: l_cac_rec,
2314: lx_cac_rec
2315: );
2316: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2317: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2318: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2319: RAISE OKC_API.G_EXCEPTION_ERROR;
2320: END IF;
2321: migrate(lx_cac_rec, l_def_cacv_rec);
2314: lx_cac_rec
2315: );
2316: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2317: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2318: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2319: RAISE OKC_API.G_EXCEPTION_ERROR;
2320: END IF;
2321: migrate(lx_cac_rec, l_def_cacv_rec);
2322: x_cacv_rec := l_def_cacv_rec;
2315: );
2316: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2317: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2318: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2319: RAISE OKC_API.G_EXCEPTION_ERROR;
2320: END IF;
2321: migrate(lx_cac_rec, l_def_cacv_rec);
2322: x_cacv_rec := l_def_cacv_rec;
2323: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2319: RAISE OKC_API.G_EXCEPTION_ERROR;
2320: END IF;
2321: migrate(lx_cac_rec, l_def_cacv_rec);
2322: x_cacv_rec := l_def_cacv_rec;
2323: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2324:
2325: IF (l_debug = 'Y') THEN
2326: okc_debug.log('8450: Leaving update_row', 2);
2327: okc_debug.Reset_Indentation;
2327: okc_debug.Reset_Indentation;
2328: END IF;
2329:
2330: EXCEPTION
2331: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2332:
2333: IF (l_debug = 'Y') THEN
2334: okc_debug.log('8500: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2335: okc_debug.Reset_Indentation;
2330: EXCEPTION
2331: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2332:
2333: IF (l_debug = 'Y') THEN
2334: okc_debug.log('8500: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2335: okc_debug.Reset_Indentation;
2336: END IF;
2337:
2338: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2334: okc_debug.log('8500: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2335: okc_debug.Reset_Indentation;
2336: END IF;
2337:
2338: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2339: (
2340: l_api_name,
2341: G_PKG_NAME,
2342: 'OKC_API.G_RET_STS_ERROR',
2338: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2339: (
2340: l_api_name,
2341: G_PKG_NAME,
2342: 'OKC_API.G_RET_STS_ERROR',
2343: x_msg_count,
2344: x_msg_data,
2345: '_PVT'
2346: );
2343: x_msg_count,
2344: x_msg_data,
2345: '_PVT'
2346: );
2347: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2348:
2349: IF (l_debug = 'Y') THEN
2350: okc_debug.log('8600: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2351: okc_debug.Reset_Indentation;
2346: );
2347: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2348:
2349: IF (l_debug = 'Y') THEN
2350: okc_debug.log('8600: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2351: okc_debug.Reset_Indentation;
2352: END IF;
2353:
2354: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2350: okc_debug.log('8600: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2351: okc_debug.Reset_Indentation;
2352: END IF;
2353:
2354: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2355: (
2356: l_api_name,
2357: G_PKG_NAME,
2358: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2354: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2355: (
2356: l_api_name,
2357: G_PKG_NAME,
2358: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2359: x_msg_count,
2360: x_msg_data,
2361: '_PVT'
2362: );
2366: okc_debug.log('8700: Exiting update_row:OTHERS Exception', 2);
2367: okc_debug.Reset_Indentation;
2368: END IF;
2369:
2370: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2371: (
2372: l_api_name,
2373: G_PKG_NAME,
2374: 'OTHERS',
2391: x_cacv_tbl OUT NOCOPY cacv_tbl_type) IS
2392:
2393: l_api_version CONSTANT NUMBER := 1;
2394: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_update_row';
2395: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2396: l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2397: i NUMBER := 0;
2398: BEGIN
2399:
2392:
2393: l_api_version CONSTANT NUMBER := 1;
2394: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_update_row';
2395: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2396: l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2397: i NUMBER := 0;
2398: BEGIN
2399:
2400: IF (l_debug = 'Y') THEN
2401: okc_debug.Set_Indentation('OKC_CAC_PVT');
2402: okc_debug.log('8900: Entered update_row', 2);
2403: END IF;
2404:
2405: OKC_API.init_msg_list(p_init_msg_list);
2406: -- Make sure PL/SQL table has records in it before passing
2407: IF (p_cacv_tbl.COUNT > 0) THEN
2408: i := p_cacv_tbl.FIRST;
2409: LOOP
2408: i := p_cacv_tbl.FIRST;
2409: LOOP
2410: update_row (
2411: p_api_version => p_api_version,
2412: p_init_msg_list => OKC_API.G_FALSE,
2413: x_return_status => x_return_status,
2414: x_msg_count => x_msg_count,
2415: x_msg_data => x_msg_data,
2416: p_cacv_rec => p_cacv_tbl(i),
2416: p_cacv_rec => p_cacv_tbl(i),
2417: x_cacv_rec => x_cacv_tbl(i));
2418:
2419: -- store the highest degree of error
2420: If x_return_status <> OKC_API.G_RET_STS_SUCCESS Then
2421: If l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
2422: l_overall_status := x_return_status;
2423: End If;
2424: End If;
2417: x_cacv_rec => x_cacv_tbl(i));
2418:
2419: -- store the highest degree of error
2420: If x_return_status <> OKC_API.G_RET_STS_SUCCESS Then
2421: If l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
2422: l_overall_status := x_return_status;
2423: End If;
2424: End If;
2425:
2435: okc_debug.Reset_Indentation;
2436: END IF;
2437:
2438: EXCEPTION
2439: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2440:
2441: IF (l_debug = 'Y') THEN
2442: okc_debug.log('9000: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2443: okc_debug.Reset_Indentation;
2438: EXCEPTION
2439: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2440:
2441: IF (l_debug = 'Y') THEN
2442: okc_debug.log('9000: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2443: okc_debug.Reset_Indentation;
2444: END IF;
2445:
2446: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2442: okc_debug.log('9000: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2443: okc_debug.Reset_Indentation;
2444: END IF;
2445:
2446: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2447: (
2448: l_api_name,
2449: G_PKG_NAME,
2450: 'OKC_API.G_RET_STS_ERROR',
2446: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2447: (
2448: l_api_name,
2449: G_PKG_NAME,
2450: 'OKC_API.G_RET_STS_ERROR',
2451: x_msg_count,
2452: x_msg_data,
2453: '_PVT'
2454: );
2451: x_msg_count,
2452: x_msg_data,
2453: '_PVT'
2454: );
2455: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2456:
2457: IF (l_debug = 'Y') THEN
2458: okc_debug.log('9100: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2459: okc_debug.Reset_Indentation;
2454: );
2455: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2456:
2457: IF (l_debug = 'Y') THEN
2458: okc_debug.log('9100: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2459: okc_debug.Reset_Indentation;
2460: END IF;
2461:
2462: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2458: okc_debug.log('9100: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2459: okc_debug.Reset_Indentation;
2460: END IF;
2461:
2462: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2463: (
2464: l_api_name,
2465: G_PKG_NAME,
2466: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2462: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2463: (
2464: l_api_name,
2465: G_PKG_NAME,
2466: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2467: x_msg_count,
2468: x_msg_data,
2469: '_PVT'
2470: );
2474: okc_debug.log('9200: Exiting update_row:OTHERS Exception', 2);
2475: okc_debug.Reset_Indentation;
2476: END IF;
2477:
2478: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2479: (
2480: l_api_name,
2481: G_PKG_NAME,
2482: 'OTHERS',
2501: p_cac_rec IN cac_rec_type) IS
2502:
2503: l_api_version CONSTANT NUMBER := 1;
2504: l_api_name CONSTANT VARCHAR2(30) := 'ACCESSES_delete_row';
2505: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2506: l_cac_rec cac_rec_type:= p_cac_rec;
2507: l_row_notfound BOOLEAN := TRUE;
2508: BEGIN
2509:
2511: okc_debug.Set_Indentation('OKC_CAC_PVT');
2512: okc_debug.log('9400: Entered delete_row', 2);
2513: END IF;
2514:
2515: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2516: p_init_msg_list,
2517: '_PVT',
2518: x_return_status);
2519: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2515: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2516: p_init_msg_list,
2517: '_PVT',
2518: x_return_status);
2519: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2520: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2521: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2522: RAISE OKC_API.G_EXCEPTION_ERROR;
2523: END IF;
2516: p_init_msg_list,
2517: '_PVT',
2518: x_return_status);
2519: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2520: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2521: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2522: RAISE OKC_API.G_EXCEPTION_ERROR;
2523: END IF;
2524: DELETE FROM OKC_K_ACCESSES
2517: '_PVT',
2518: x_return_status);
2519: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2520: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2521: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2522: RAISE OKC_API.G_EXCEPTION_ERROR;
2523: END IF;
2524: DELETE FROM OKC_K_ACCESSES
2525: WHERE ID = l_cac_rec.id;
2518: x_return_status);
2519: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2520: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2521: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2522: RAISE OKC_API.G_EXCEPTION_ERROR;
2523: END IF;
2524: DELETE FROM OKC_K_ACCESSES
2525: WHERE ID = l_cac_rec.id;
2526:
2523: END IF;
2524: DELETE FROM OKC_K_ACCESSES
2525: WHERE ID = l_cac_rec.id;
2526:
2527: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2528:
2529: IF (l_debug = 'Y') THEN
2530: okc_debug.log('9450: Leaving delete_row', 2);
2531: okc_debug.Reset_Indentation;
2531: okc_debug.Reset_Indentation;
2532: END IF;
2533:
2534: EXCEPTION
2535: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2536:
2537: IF (l_debug = 'Y') THEN
2538: okc_debug.log('9500: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2539: okc_debug.Reset_Indentation;
2534: EXCEPTION
2535: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2536:
2537: IF (l_debug = 'Y') THEN
2538: okc_debug.log('9500: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2539: okc_debug.Reset_Indentation;
2540: END IF;
2541:
2542: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2538: okc_debug.log('9500: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2539: okc_debug.Reset_Indentation;
2540: END IF;
2541:
2542: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2543: (
2544: l_api_name,
2545: G_PKG_NAME,
2546: 'OKC_API.G_RET_STS_ERROR',
2542: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2543: (
2544: l_api_name,
2545: G_PKG_NAME,
2546: 'OKC_API.G_RET_STS_ERROR',
2547: x_msg_count,
2548: x_msg_data,
2549: '_PVT'
2550: );
2547: x_msg_count,
2548: x_msg_data,
2549: '_PVT'
2550: );
2551: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2552:
2553: IF (l_debug = 'Y') THEN
2554: okc_debug.log('9600: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2555: okc_debug.Reset_Indentation;
2550: );
2551: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2552:
2553: IF (l_debug = 'Y') THEN
2554: okc_debug.log('9600: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2555: okc_debug.Reset_Indentation;
2556: END IF;
2557:
2558: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2554: okc_debug.log('9600: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2555: okc_debug.Reset_Indentation;
2556: END IF;
2557:
2558: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2559: (
2560: l_api_name,
2561: G_PKG_NAME,
2562: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2558: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2559: (
2560: l_api_name,
2561: G_PKG_NAME,
2562: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2563: x_msg_count,
2564: x_msg_data,
2565: '_PVT'
2566: );
2570: okc_debug.log('9700: Exiting delete_row:OTHERS Exception', 2);
2571: okc_debug.Reset_Indentation;
2572: END IF;
2573:
2574: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2575: (
2576: l_api_name,
2577: G_PKG_NAME,
2578: 'OTHERS',
2594: p_cacv_rec IN cacv_rec_type) IS
2595:
2596: l_api_version CONSTANT NUMBER := 1;
2597: l_api_name CONSTANT VARCHAR2(30) := 'V_delete_row';
2598: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2599: l_cacv_rec cacv_rec_type := p_cacv_rec;
2600: l_cac_rec cac_rec_type;
2601: BEGIN
2602:
2604: okc_debug.Set_Indentation('OKC_CAC_PVT');
2605: okc_debug.log('9900: Entered delete_row', 2);
2606: END IF;
2607:
2608: l_return_status := OKC_API.START_ACTIVITY(l_api_name,
2609: G_PKG_NAME,
2610: p_init_msg_list,
2611: l_api_version,
2612: p_api_version,
2611: l_api_version,
2612: p_api_version,
2613: '_PVT',
2614: x_return_status);
2615: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2616: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2617: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2618: RAISE OKC_API.G_EXCEPTION_ERROR;
2619: END IF;
2612: p_api_version,
2613: '_PVT',
2614: x_return_status);
2615: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2616: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2617: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2618: RAISE OKC_API.G_EXCEPTION_ERROR;
2619: END IF;
2620: --------------------------------------
2613: '_PVT',
2614: x_return_status);
2615: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2616: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2617: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2618: RAISE OKC_API.G_EXCEPTION_ERROR;
2619: END IF;
2620: --------------------------------------
2621: -- Move VIEW record to "Child" records
2614: x_return_status);
2615: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2616: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2617: ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
2618: RAISE OKC_API.G_EXCEPTION_ERROR;
2619: END IF;
2620: --------------------------------------
2621: -- Move VIEW record to "Child" records
2622: --------------------------------------
2630: x_msg_count,
2631: x_msg_data,
2632: l_cac_rec
2633: );
2634: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2635: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2636: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2637: RAISE OKC_API.G_EXCEPTION_ERROR;
2638: END IF;
2631: x_msg_data,
2632: l_cac_rec
2633: );
2634: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2635: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2636: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2637: RAISE OKC_API.G_EXCEPTION_ERROR;
2638: END IF;
2639: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2632: l_cac_rec
2633: );
2634: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2635: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2636: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2637: RAISE OKC_API.G_EXCEPTION_ERROR;
2638: END IF;
2639: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2640:
2633: );
2634: IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2635: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2636: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2637: RAISE OKC_API.G_EXCEPTION_ERROR;
2638: END IF;
2639: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2640:
2641: IF (l_debug = 'Y') THEN
2635: RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
2636: ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
2637: RAISE OKC_API.G_EXCEPTION_ERROR;
2638: END IF;
2639: OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
2640:
2641: IF (l_debug = 'Y') THEN
2642: okc_debug.log('9950: Leaving delete_row', 2);
2643: okc_debug.Reset_Indentation;
2643: okc_debug.Reset_Indentation;
2644: END IF;
2645:
2646: EXCEPTION
2647: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2648:
2649: IF (l_debug = 'Y') THEN
2650: okc_debug.log('10000: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2651: okc_debug.Reset_Indentation;
2646: EXCEPTION
2647: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2648:
2649: IF (l_debug = 'Y') THEN
2650: okc_debug.log('10000: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2651: okc_debug.Reset_Indentation;
2652: END IF;
2653:
2654: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2650: okc_debug.log('10000: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2651: okc_debug.Reset_Indentation;
2652: END IF;
2653:
2654: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2655: (
2656: l_api_name,
2657: G_PKG_NAME,
2658: 'OKC_API.G_RET_STS_ERROR',
2654: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2655: (
2656: l_api_name,
2657: G_PKG_NAME,
2658: 'OKC_API.G_RET_STS_ERROR',
2659: x_msg_count,
2660: x_msg_data,
2661: '_PVT'
2662: );
2659: x_msg_count,
2660: x_msg_data,
2661: '_PVT'
2662: );
2663: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2664:
2665: IF (l_debug = 'Y') THEN
2666: okc_debug.log('10100: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2667: okc_debug.Reset_Indentation;
2662: );
2663: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2664:
2665: IF (l_debug = 'Y') THEN
2666: okc_debug.log('10100: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2667: okc_debug.Reset_Indentation;
2668: END IF;
2669:
2670: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2666: okc_debug.log('10100: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2667: okc_debug.Reset_Indentation;
2668: END IF;
2669:
2670: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2671: (
2672: l_api_name,
2673: G_PKG_NAME,
2674: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2670: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2671: (
2672: l_api_name,
2673: G_PKG_NAME,
2674: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2675: x_msg_count,
2676: x_msg_data,
2677: '_PVT'
2678: );
2682: okc_debug.log('10200: Exiting delete_row:OTHERS Exception', 2);
2683: okc_debug.Reset_Indentation;
2684: END IF;
2685:
2686: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2687: (
2688: l_api_name,
2689: G_PKG_NAME,
2690: 'OTHERS',
2706: p_cacv_tbl IN cacv_tbl_type) IS
2707:
2708: l_api_version CONSTANT NUMBER := 1;
2709: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_delete_row';
2710: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2711: l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2712: i NUMBER := 0;
2713: BEGIN
2714:
2707:
2708: l_api_version CONSTANT NUMBER := 1;
2709: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_delete_row';
2710: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2711: l_overall_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2712: i NUMBER := 0;
2713: BEGIN
2714:
2715: IF (l_debug = 'Y') THEN
2716: okc_debug.Set_Indentation('OKC_CAC_PVT');
2717: okc_debug.log('10400: Entered delete_row', 2);
2718: END IF;
2719:
2720: OKC_API.init_msg_list(p_init_msg_list);
2721: -- Make sure PL/SQL table has records in it before passing
2722: IF (p_cacv_tbl.COUNT > 0) THEN
2723: i := p_cacv_tbl.FIRST;
2724: LOOP
2723: i := p_cacv_tbl.FIRST;
2724: LOOP
2725: delete_row (
2726: p_api_version => p_api_version,
2727: p_init_msg_list => OKC_API.G_FALSE,
2728: x_return_status => x_return_status,
2729: x_msg_count => x_msg_count,
2730: x_msg_data => x_msg_data,
2731: p_cacv_rec => p_cacv_tbl(i));
2730: x_msg_data => x_msg_data,
2731: p_cacv_rec => p_cacv_tbl(i));
2732:
2733: -- store the highest degree of error
2734: If x_return_status <> OKC_API.G_RET_STS_SUCCESS Then
2735: If l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
2736: l_overall_status := x_return_status;
2737: End If;
2738: End If;
2731: p_cacv_rec => p_cacv_tbl(i));
2732:
2733: -- store the highest degree of error
2734: If x_return_status <> OKC_API.G_RET_STS_SUCCESS Then
2735: If l_overall_status <> OKC_API.G_RET_STS_UNEXP_ERROR Then
2736: l_overall_status := x_return_status;
2737: End If;
2738: End If;
2739:
2749: okc_debug.Reset_Indentation;
2750: END IF;
2751:
2752: EXCEPTION
2753: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2754:
2755: IF (l_debug = 'Y') THEN
2756: okc_debug.log('10500: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2757: okc_debug.Reset_Indentation;
2752: EXCEPTION
2753: WHEN OKC_API.G_EXCEPTION_ERROR THEN
2754:
2755: IF (l_debug = 'Y') THEN
2756: okc_debug.log('10500: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2757: okc_debug.Reset_Indentation;
2758: END IF;
2759:
2760: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2756: okc_debug.log('10500: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
2757: okc_debug.Reset_Indentation;
2758: END IF;
2759:
2760: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2761: (
2762: l_api_name,
2763: G_PKG_NAME,
2764: 'OKC_API.G_RET_STS_ERROR',
2760: x_return_status := OKC_API.HANDLE_EXCEPTIONS
2761: (
2762: l_api_name,
2763: G_PKG_NAME,
2764: 'OKC_API.G_RET_STS_ERROR',
2765: x_msg_count,
2766: x_msg_data,
2767: '_PVT'
2768: );
2765: x_msg_count,
2766: x_msg_data,
2767: '_PVT'
2768: );
2769: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2770:
2771: IF (l_debug = 'Y') THEN
2772: okc_debug.log('10600: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2773: okc_debug.Reset_Indentation;
2768: );
2769: WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
2770:
2771: IF (l_debug = 'Y') THEN
2772: okc_debug.log('10600: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2773: okc_debug.Reset_Indentation;
2774: END IF;
2775:
2776: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2772: okc_debug.log('10600: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
2773: okc_debug.Reset_Indentation;
2774: END IF;
2775:
2776: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2777: (
2778: l_api_name,
2779: G_PKG_NAME,
2780: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2776: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2777: (
2778: l_api_name,
2779: G_PKG_NAME,
2780: 'OKC_API.G_RET_STS_UNEXP_ERROR',
2781: x_msg_count,
2782: x_msg_data,
2783: '_PVT'
2784: );
2788: okc_debug.log('10700: Exiting delete_row:OTHERS Exception', 2);
2789: okc_debug.Reset_Indentation;
2790: END IF;
2791:
2792: x_return_status :=OKC_API.HANDLE_EXCEPTIONS
2793: (
2794: l_api_name,
2795: G_PKG_NAME,
2796: 'OTHERS',
2809: p_chr_id IN NUMBER,
2810: p_major_version IN NUMBER
2811: ) RETURN VARCHAR2 IS
2812:
2813: l_return_status VARCHAR2(1):= OKC_API.G_RET_STS_SUCCESS;
2814:
2815: BEGIN
2816:
2817: IF (l_debug = 'Y') THEN
2866: okc_debug.Reset_Indentation;
2867: END IF;
2868:
2869: -- store SQL error message on message stack
2870: OKC_API.SET_MESSAGE(p_app_name => okc_version_pvt.G_APP_NAME,
2871: p_msg_name => okc_version_pvt.G_UNEXPECTED_ERROR,
2872: p_token1 => okc_version_pvt.G_SQLCODE_TOKEN,
2873: p_token1_value => sqlcode,
2874: p_token2 => okc_version_pvt.G_SQLERRM_TOKEN,
2874: p_token2 => okc_version_pvt.G_SQLERRM_TOKEN,
2875: p_token2_value => sqlerrm);
2876:
2877: -- notify UNEXPECTED error
2878: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2879: return l_return_status;
2880:
2881: END create_version;
2882:
2888: p_chr_id IN NUMBER,
2889: p_major_version IN NUMBER
2890: ) RETURN VARCHAR2 IS
2891:
2892: l_return_status VARCHAR2(1):= OKC_API.G_RET_STS_SUCCESS;
2893:
2894: BEGIN
2895:
2896: IF (l_debug = 'Y') THEN
2944: okc_debug.Reset_Indentation;
2945: END IF;
2946:
2947: -- store SQL error message on message stack
2948: OKC_API.SET_MESSAGE(p_app_name => okc_version_pvt.G_APP_NAME,
2949: p_msg_name => okc_version_pvt.G_UNEXPECTED_ERROR,
2950: p_token1 => okc_version_pvt.G_SQLCODE_TOKEN,
2951: p_token1_value => sqlcode,
2952: p_token2 => okc_version_pvt.G_SQLERRM_TOKEN,
2952: p_token2 => okc_version_pvt.G_SQLERRM_TOKEN,
2953: p_token2_value => sqlerrm);
2954:
2955: -- notify UNEXPECTED error
2956: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2957: return l_return_status;
2958:
2959: END restore_version;
2960: --