7: PROCEDURE validate_id (p_awrv_rec IN awrv_rec_type,
8: x_return_status OUT NOCOPY VARCHAR2) IS
9:
10: BEGIN
11: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
12: --Check for Null
13: IF p_awrv_rec.id = Okl_Api.G_MISS_NUM OR
14: p_awrv_rec.id IS NULL
15: THEN
9:
10: BEGIN
11: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
12: --Check for Null
13: IF p_awrv_rec.id = Okl_Api.G_MISS_NUM OR
14: p_awrv_rec.id IS NULL
15: THEN
16:
17: x_return_status := Okl_Api.G_RET_STS_ERROR;
13: IF p_awrv_rec.id = Okl_Api.G_MISS_NUM OR
14: p_awrv_rec.id IS NULL
15: THEN
16:
17: x_return_status := Okl_Api.G_RET_STS_ERROR;
18: --set error message in message stack
19: Okl_Api.SET_MESSAGE(p_app_name => G_APP_NAME,
20: p_msg_name => G_REQUIRED_VALUE,
21: p_token1 => G_COL_NAME_TOKEN,
15: THEN
16:
17: x_return_status := Okl_Api.G_RET_STS_ERROR;
18: --set error message in message stack
19: Okl_Api.SET_MESSAGE(p_app_name => G_APP_NAME,
20: p_msg_name => G_REQUIRED_VALUE,
21: p_token1 => G_COL_NAME_TOKEN,
22: p_token1_value => 'id');
23: RAISE G_EXCEPTION_HALT_VALIDATION;
31: PROCEDURE validate_object_version_number (p_awrv_rec IN awrv_rec_type,
32: x_return_status OUT NOCOPY VARCHAR2) IS
33:
34: BEGIN
35: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
36: --Check for Null
37: IF p_awrv_rec.object_version_number = Okl_Api.G_MISS_NUM OR
38: p_awrv_rec.object_version_number IS NULL
39: THEN
33:
34: BEGIN
35: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
36: --Check for Null
37: IF p_awrv_rec.object_version_number = Okl_Api.G_MISS_NUM OR
38: p_awrv_rec.object_version_number IS NULL
39: THEN
40:
41: x_return_status := Okl_Api.G_RET_STS_ERROR;
37: IF p_awrv_rec.object_version_number = Okl_Api.G_MISS_NUM OR
38: p_awrv_rec.object_version_number IS NULL
39: THEN
40:
41: x_return_status := Okl_Api.G_RET_STS_ERROR;
42: --set error message in message stack
43: Okl_Api.SET_MESSAGE(p_app_name => G_APP_NAME,
44: p_msg_name => G_REQUIRED_VALUE,
45: p_token1 => G_COL_NAME_TOKEN,
39: THEN
40:
41: x_return_status := Okl_Api.G_RET_STS_ERROR;
42: --set error message in message stack
43: Okl_Api.SET_MESSAGE(p_app_name => G_APP_NAME,
44: p_msg_name => G_REQUIRED_VALUE,
45: p_token1 => G_COL_NAME_TOKEN,
46: p_token1_value => 'object_version_number');
47: RAISE G_EXCEPTION_HALT_VALIDATION;
62: FROM OKL_ANSWER_SETS_B
63: WHERE id = p_awrv_rec.ant_id;
64:
65: BEGIN
66: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
67:
68: --Check for Null
69: IF p_awrv_rec.ant_id = Okl_Api.G_MISS_NUM OR
70: p_awrv_rec.ant_id IS NULL
65: BEGIN
66: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
67:
68: --Check for Null
69: IF p_awrv_rec.ant_id = Okl_Api.G_MISS_NUM OR
70: p_awrv_rec.ant_id IS NULL
71: THEN
72: x_return_status := Okl_Api.G_RET_STS_ERROR;
73: --set error message in message stack
68: --Check for Null
69: IF p_awrv_rec.ant_id = Okl_Api.G_MISS_NUM OR
70: p_awrv_rec.ant_id IS NULL
71: THEN
72: x_return_status := Okl_Api.G_RET_STS_ERROR;
73: --set error message in message stack
74: Okl_Api.SET_MESSAGE(p_app_name => G_APP_NAME,
75: p_msg_name => G_REQUIRED_VALUE,
76: p_token1 => G_COL_NAME_TOKEN,
70: p_awrv_rec.ant_id IS NULL
71: THEN
72: x_return_status := Okl_Api.G_RET_STS_ERROR;
73: --set error message in message stack
74: Okl_Api.SET_MESSAGE(p_app_name => G_APP_NAME,
75: p_msg_name => G_REQUIRED_VALUE,
76: p_token1 => G_COL_NAME_TOKEN,
77: p_token1_value => 'ant_id');
78: RAISE G_EXCEPTION_HALT_VALIDATION;
83: FETCH l_ant_id_csr INTO l_dummy_var;
84: CLOSE l_ant_id_csr;
85:
86: IF (l_dummy_var <> '1') THEN
87: x_return_status := Okl_Api.G_RET_STS_ERROR;
88: Okl_Api.SET_MESSAGE(p_app_name => G_APP_NAME,
89: p_msg_name => G_NO_PARENT_RECORD,
90: p_token1 => G_COL_NAME_TOKEN,
91: p_token1_value => 'ANT_ID_FOR',
84: CLOSE l_ant_id_csr;
85:
86: IF (l_dummy_var <> '1') THEN
87: x_return_status := Okl_Api.G_RET_STS_ERROR;
88: Okl_Api.SET_MESSAGE(p_app_name => G_APP_NAME,
89: p_msg_name => G_NO_PARENT_RECORD,
90: p_token1 => G_COL_NAME_TOKEN,
91: p_token1_value => 'ANT_ID_FOR',
92: p_token2 => G_CHILD_TABLE_TOKEN,
111: FROM OKC_RULES_B
112: WHERE id = p_awrv_rec.rul_id;
113:
114: BEGIN
115: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
116:
117: --Check for Null
118: IF p_awrv_rec.rul_id = Okl_Api.G_MISS_NUM OR
119: p_awrv_rec.rul_id IS NULL
114: BEGIN
115: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
116:
117: --Check for Null
118: IF p_awrv_rec.rul_id = Okl_Api.G_MISS_NUM OR
119: p_awrv_rec.rul_id IS NULL
120: THEN
121: x_return_status := Okl_Api.G_RET_STS_ERROR;
122: --set error message in message stack
117: --Check for Null
118: IF p_awrv_rec.rul_id = Okl_Api.G_MISS_NUM OR
119: p_awrv_rec.rul_id IS NULL
120: THEN
121: x_return_status := Okl_Api.G_RET_STS_ERROR;
122: --set error message in message stack
123: Okl_Api.SET_MESSAGE(p_app_name => G_APP_NAME,
124: p_msg_name => G_REQUIRED_VALUE,
125: p_token1 => G_COL_NAME_TOKEN,
119: p_awrv_rec.rul_id IS NULL
120: THEN
121: x_return_status := Okl_Api.G_RET_STS_ERROR;
122: --set error message in message stack
123: Okl_Api.SET_MESSAGE(p_app_name => G_APP_NAME,
124: p_msg_name => G_REQUIRED_VALUE,
125: p_token1 => G_COL_NAME_TOKEN,
126: p_token1_value => 'rul_id');
127: RAISE G_EXCEPTION_HALT_VALIDATION;
132: FETCH l_rul_id_csr INTO l_dummy_var;
133: CLOSE l_rul_id_csr;
134:
135: IF (l_dummy_var <> '1') THEN
136: x_return_status := Okl_Api.G_RET_STS_ERROR;
137: Okl_Api.SET_MESSAGE(p_app_name => G_APP_NAME,
138: p_msg_name => G_NO_PARENT_RECORD,
139: p_token1 => G_COL_NAME_TOKEN,
140: p_token1_value => 'RUL_ID_FOR',
133: CLOSE l_rul_id_csr;
134:
135: IF (l_dummy_var <> '1') THEN
136: x_return_status := Okl_Api.G_RET_STS_ERROR;
137: Okl_Api.SET_MESSAGE(p_app_name => G_APP_NAME,
138: p_msg_name => G_NO_PARENT_RECORD,
139: p_token1 => G_COL_NAME_TOKEN,
140: p_token1_value => 'RUL_ID_FOR',
141: p_token2 => G_CHILD_TABLE_TOKEN,
153: PROCEDURE validate_sort_sequence (p_awrv_rec IN awrv_rec_type,
154: x_return_status OUT NOCOPY VARCHAR2) IS
155:
156: BEGIN
157: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
158: --Check for Null
159: IF p_awrv_rec.sort_sequence = Okl_Api.G_MISS_NUM OR
160: p_awrv_rec.sort_sequence IS NULL
161: THEN
155:
156: BEGIN
157: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
158: --Check for Null
159: IF p_awrv_rec.sort_sequence = Okl_Api.G_MISS_NUM OR
160: p_awrv_rec.sort_sequence IS NULL
161: THEN
162:
163: x_return_status := Okl_Api.G_RET_STS_ERROR;
159: IF p_awrv_rec.sort_sequence = Okl_Api.G_MISS_NUM OR
160: p_awrv_rec.sort_sequence IS NULL
161: THEN
162:
163: x_return_status := Okl_Api.G_RET_STS_ERROR;
164: --set error message in message stack
165: Okl_Api.SET_MESSAGE(p_app_name => G_APP_NAME,
166: p_msg_name => G_REQUIRED_VALUE,
167: p_token1 => G_COL_NAME_TOKEN,
161: THEN
162:
163: x_return_status := Okl_Api.G_RET_STS_ERROR;
164: --set error message in message stack
165: Okl_Api.SET_MESSAGE(p_app_name => G_APP_NAME,
166: p_msg_name => G_REQUIRED_VALUE,
167: p_token1 => G_COL_NAME_TOKEN,
168: p_token1_value => 'object_version_number');
169: RAISE G_EXCEPTION_HALT_VALIDATION;
375: p_awrv_rec IN awrv_rec_type
376: ) RETURN awrv_rec_type IS
377: l_awrv_rec awrv_rec_type := p_awrv_rec;
378: BEGIN
379: IF (l_awrv_rec.object_version_number = okl_api.G_MISS_NUM) THEN
380: l_awrv_rec.object_version_number := NULL;
381: END IF;
382: IF (l_awrv_rec.ant_id = okl_api.G_MISS_NUM) THEN
383: l_awrv_rec.ant_id := NULL;
378: BEGIN
379: IF (l_awrv_rec.object_version_number = okl_api.G_MISS_NUM) THEN
380: l_awrv_rec.object_version_number := NULL;
381: END IF;
382: IF (l_awrv_rec.ant_id = okl_api.G_MISS_NUM) THEN
383: l_awrv_rec.ant_id := NULL;
384: END IF;
385: IF (l_awrv_rec.rul_id = okl_api.G_MISS_NUM) THEN
386: l_awrv_rec.rul_id := NULL;
381: END IF;
382: IF (l_awrv_rec.ant_id = okl_api.G_MISS_NUM) THEN
383: l_awrv_rec.ant_id := NULL;
384: END IF;
385: IF (l_awrv_rec.rul_id = okl_api.G_MISS_NUM) THEN
386: l_awrv_rec.rul_id := NULL;
387: END IF;
388: IF (l_awrv_rec.sort_sequence = okl_api.G_MISS_NUM) THEN
389: l_awrv_rec.sort_sequence := NULL;
384: END IF;
385: IF (l_awrv_rec.rul_id = okl_api.G_MISS_NUM) THEN
386: l_awrv_rec.rul_id := NULL;
387: END IF;
388: IF (l_awrv_rec.sort_sequence = okl_api.G_MISS_NUM) THEN
389: l_awrv_rec.sort_sequence := NULL;
390: END IF;
391: IF (l_awrv_rec.attribute_category = okl_api.G_MISS_CHAR) THEN
392: l_awrv_rec.attribute_category := NULL;
387: END IF;
388: IF (l_awrv_rec.sort_sequence = okl_api.G_MISS_NUM) THEN
389: l_awrv_rec.sort_sequence := NULL;
390: END IF;
391: IF (l_awrv_rec.attribute_category = okl_api.G_MISS_CHAR) THEN
392: l_awrv_rec.attribute_category := NULL;
393: END IF;
394: IF (l_awrv_rec.attribute1 = okl_api.G_MISS_CHAR) THEN
395: l_awrv_rec.attribute1 := NULL;
390: END IF;
391: IF (l_awrv_rec.attribute_category = okl_api.G_MISS_CHAR) THEN
392: l_awrv_rec.attribute_category := NULL;
393: END IF;
394: IF (l_awrv_rec.attribute1 = okl_api.G_MISS_CHAR) THEN
395: l_awrv_rec.attribute1 := NULL;
396: END IF;
397: IF (l_awrv_rec.attribute2 = okl_api.G_MISS_CHAR) THEN
398: l_awrv_rec.attribute2 := NULL;
393: END IF;
394: IF (l_awrv_rec.attribute1 = okl_api.G_MISS_CHAR) THEN
395: l_awrv_rec.attribute1 := NULL;
396: END IF;
397: IF (l_awrv_rec.attribute2 = okl_api.G_MISS_CHAR) THEN
398: l_awrv_rec.attribute2 := NULL;
399: END IF;
400: IF (l_awrv_rec.attribute3 = okl_api.G_MISS_CHAR) THEN
401: l_awrv_rec.attribute3 := NULL;
396: END IF;
397: IF (l_awrv_rec.attribute2 = okl_api.G_MISS_CHAR) THEN
398: l_awrv_rec.attribute2 := NULL;
399: END IF;
400: IF (l_awrv_rec.attribute3 = okl_api.G_MISS_CHAR) THEN
401: l_awrv_rec.attribute3 := NULL;
402: END IF;
403: IF (l_awrv_rec.attribute4 = okl_api.G_MISS_CHAR) THEN
404: l_awrv_rec.attribute4 := NULL;
399: END IF;
400: IF (l_awrv_rec.attribute3 = okl_api.G_MISS_CHAR) THEN
401: l_awrv_rec.attribute3 := NULL;
402: END IF;
403: IF (l_awrv_rec.attribute4 = okl_api.G_MISS_CHAR) THEN
404: l_awrv_rec.attribute4 := NULL;
405: END IF;
406: IF (l_awrv_rec.attribute5 = okl_api.G_MISS_CHAR) THEN
407: l_awrv_rec.attribute5 := NULL;
402: END IF;
403: IF (l_awrv_rec.attribute4 = okl_api.G_MISS_CHAR) THEN
404: l_awrv_rec.attribute4 := NULL;
405: END IF;
406: IF (l_awrv_rec.attribute5 = okl_api.G_MISS_CHAR) THEN
407: l_awrv_rec.attribute5 := NULL;
408: END IF;
409: IF (l_awrv_rec.attribute6 = okl_api.G_MISS_CHAR) THEN
410: l_awrv_rec.attribute6 := NULL;
405: END IF;
406: IF (l_awrv_rec.attribute5 = okl_api.G_MISS_CHAR) THEN
407: l_awrv_rec.attribute5 := NULL;
408: END IF;
409: IF (l_awrv_rec.attribute6 = okl_api.G_MISS_CHAR) THEN
410: l_awrv_rec.attribute6 := NULL;
411: END IF;
412: IF (l_awrv_rec.attribute7 = okl_api.G_MISS_CHAR) THEN
413: l_awrv_rec.attribute7 := NULL;
408: END IF;
409: IF (l_awrv_rec.attribute6 = okl_api.G_MISS_CHAR) THEN
410: l_awrv_rec.attribute6 := NULL;
411: END IF;
412: IF (l_awrv_rec.attribute7 = okl_api.G_MISS_CHAR) THEN
413: l_awrv_rec.attribute7 := NULL;
414: END IF;
415: IF (l_awrv_rec.attribute8 = okl_api.G_MISS_CHAR) THEN
416: l_awrv_rec.attribute8 := NULL;
411: END IF;
412: IF (l_awrv_rec.attribute7 = okl_api.G_MISS_CHAR) THEN
413: l_awrv_rec.attribute7 := NULL;
414: END IF;
415: IF (l_awrv_rec.attribute8 = okl_api.G_MISS_CHAR) THEN
416: l_awrv_rec.attribute8 := NULL;
417: END IF;
418: IF (l_awrv_rec.attribute9 = okl_api.G_MISS_CHAR) THEN
419: l_awrv_rec.attribute9 := NULL;
414: END IF;
415: IF (l_awrv_rec.attribute8 = okl_api.G_MISS_CHAR) THEN
416: l_awrv_rec.attribute8 := NULL;
417: END IF;
418: IF (l_awrv_rec.attribute9 = okl_api.G_MISS_CHAR) THEN
419: l_awrv_rec.attribute9 := NULL;
420: END IF;
421: IF (l_awrv_rec.attribute10 = okl_api.G_MISS_CHAR) THEN
422: l_awrv_rec.attribute10 := NULL;
417: END IF;
418: IF (l_awrv_rec.attribute9 = okl_api.G_MISS_CHAR) THEN
419: l_awrv_rec.attribute9 := NULL;
420: END IF;
421: IF (l_awrv_rec.attribute10 = okl_api.G_MISS_CHAR) THEN
422: l_awrv_rec.attribute10 := NULL;
423: END IF;
424: IF (l_awrv_rec.attribute11 = okl_api.G_MISS_CHAR) THEN
425: l_awrv_rec.attribute11 := NULL;
420: END IF;
421: IF (l_awrv_rec.attribute10 = okl_api.G_MISS_CHAR) THEN
422: l_awrv_rec.attribute10 := NULL;
423: END IF;
424: IF (l_awrv_rec.attribute11 = okl_api.G_MISS_CHAR) THEN
425: l_awrv_rec.attribute11 := NULL;
426: END IF;
427: IF (l_awrv_rec.attribute12 = okl_api.G_MISS_CHAR) THEN
428: l_awrv_rec.attribute12 := NULL;
423: END IF;
424: IF (l_awrv_rec.attribute11 = okl_api.G_MISS_CHAR) THEN
425: l_awrv_rec.attribute11 := NULL;
426: END IF;
427: IF (l_awrv_rec.attribute12 = okl_api.G_MISS_CHAR) THEN
428: l_awrv_rec.attribute12 := NULL;
429: END IF;
430: IF (l_awrv_rec.attribute13 = okl_api.G_MISS_CHAR) THEN
431: l_awrv_rec.attribute13 := NULL;
426: END IF;
427: IF (l_awrv_rec.attribute12 = okl_api.G_MISS_CHAR) THEN
428: l_awrv_rec.attribute12 := NULL;
429: END IF;
430: IF (l_awrv_rec.attribute13 = okl_api.G_MISS_CHAR) THEN
431: l_awrv_rec.attribute13 := NULL;
432: END IF;
433: IF (l_awrv_rec.attribute14 = okl_api.G_MISS_CHAR) THEN
434: l_awrv_rec.attribute14 := NULL;
429: END IF;
430: IF (l_awrv_rec.attribute13 = okl_api.G_MISS_CHAR) THEN
431: l_awrv_rec.attribute13 := NULL;
432: END IF;
433: IF (l_awrv_rec.attribute14 = okl_api.G_MISS_CHAR) THEN
434: l_awrv_rec.attribute14 := NULL;
435: END IF;
436: IF (l_awrv_rec.attribute15 = okl_api.G_MISS_CHAR) THEN
437: l_awrv_rec.attribute15 := NULL;
432: END IF;
433: IF (l_awrv_rec.attribute14 = okl_api.G_MISS_CHAR) THEN
434: l_awrv_rec.attribute14 := NULL;
435: END IF;
436: IF (l_awrv_rec.attribute15 = okl_api.G_MISS_CHAR) THEN
437: l_awrv_rec.attribute15 := NULL;
438: END IF;
439: IF (l_awrv_rec.created_by = okl_api.G_MISS_NUM) THEN
440: l_awrv_rec.created_by := NULL;
435: END IF;
436: IF (l_awrv_rec.attribute15 = okl_api.G_MISS_CHAR) THEN
437: l_awrv_rec.attribute15 := NULL;
438: END IF;
439: IF (l_awrv_rec.created_by = okl_api.G_MISS_NUM) THEN
440: l_awrv_rec.created_by := NULL;
441: END IF;
442: IF (l_awrv_rec.creation_date = okl_api.G_MISS_DATE) THEN
443: l_awrv_rec.creation_date := NULL;
438: END IF;
439: IF (l_awrv_rec.created_by = okl_api.G_MISS_NUM) THEN
440: l_awrv_rec.created_by := NULL;
441: END IF;
442: IF (l_awrv_rec.creation_date = okl_api.G_MISS_DATE) THEN
443: l_awrv_rec.creation_date := NULL;
444: END IF;
445: IF (l_awrv_rec.last_updated_by = okl_api.G_MISS_NUM) THEN
446: l_awrv_rec.last_updated_by := NULL;
441: END IF;
442: IF (l_awrv_rec.creation_date = okl_api.G_MISS_DATE) THEN
443: l_awrv_rec.creation_date := NULL;
444: END IF;
445: IF (l_awrv_rec.last_updated_by = okl_api.G_MISS_NUM) THEN
446: l_awrv_rec.last_updated_by := NULL;
447: END IF;
448: IF (l_awrv_rec.last_update_date = okl_api.G_MISS_DATE) THEN
449: l_awrv_rec.last_update_date := NULL;
444: END IF;
445: IF (l_awrv_rec.last_updated_by = okl_api.G_MISS_NUM) THEN
446: l_awrv_rec.last_updated_by := NULL;
447: END IF;
448: IF (l_awrv_rec.last_update_date = okl_api.G_MISS_DATE) THEN
449: l_awrv_rec.last_update_date := NULL;
450: END IF;
451: IF (l_awrv_rec.last_update_login = okl_api.G_MISS_NUM) THEN
452: l_awrv_rec.last_update_login := NULL;
447: END IF;
448: IF (l_awrv_rec.last_update_date = okl_api.G_MISS_DATE) THEN
449: l_awrv_rec.last_update_date := NULL;
450: END IF;
451: IF (l_awrv_rec.last_update_login = okl_api.G_MISS_NUM) THEN
452: l_awrv_rec.last_update_login := NULL;
453: END IF;
454: RETURN(l_awrv_rec);
455: END null_out_defaults;
461: -------------------------------------------
462: FUNCTION Validate_Attributes (
463: p_awrv_rec IN awrv_rec_type
464: ) RETURN VARCHAR2 IS
465: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
466: -- TAPI postgen 05/23/2001
467: x_return_status VARCHAR2(1) := Okl_Api.G_RET_STS_SUCCESS;
468: -- End TAPI postgen 05/23/2001
469: BEGIN
463: p_awrv_rec IN awrv_rec_type
464: ) RETURN VARCHAR2 IS
465: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
466: -- TAPI postgen 05/23/2001
467: x_return_status VARCHAR2(1) := Okl_Api.G_RET_STS_SUCCESS;
468: -- End TAPI postgen 05/23/2001
469: BEGIN
470: -- TAPI postgen 05/23/2001
471: validate_id(p_awrv_rec, x_return_status);
468: -- End TAPI postgen 05/23/2001
469: BEGIN
470: -- TAPI postgen 05/23/2001
471: validate_id(p_awrv_rec, x_return_status);
472: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
473: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN -- need to leave
474: l_return_status := x_return_status;
475: RAISE G_EXCEPTION_HALT_VALIDATION;
476: ELSE
469: BEGIN
470: -- TAPI postgen 05/23/2001
471: validate_id(p_awrv_rec, x_return_status);
472: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
473: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN -- need to leave
474: l_return_status := x_return_status;
475: RAISE G_EXCEPTION_HALT_VALIDATION;
476: ELSE
477: l_return_status := x_return_status; -- record that there was an error
478: END IF;
479: END IF;
480:
481: validate_object_version_number(p_awrv_rec, x_return_status);
482: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
483: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN -- need to leave
484: l_return_status := x_return_status;
485: RAISE G_EXCEPTION_HALT_VALIDATION;
486: ELSE
479: END IF;
480:
481: validate_object_version_number(p_awrv_rec, x_return_status);
482: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
483: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN -- need to leave
484: l_return_status := x_return_status;
485: RAISE G_EXCEPTION_HALT_VALIDATION;
486: ELSE
487: l_return_status := x_return_status; -- record that there was an error
488: END IF;
489: END IF;
490:
491: validate_ant_id(p_awrv_rec, x_return_status);
492: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
493: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN -- need to leave
494: l_return_status := x_return_status;
495: RAISE G_EXCEPTION_HALT_VALIDATION;
496: ELSE
489: END IF;
490:
491: validate_ant_id(p_awrv_rec, x_return_status);
492: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
493: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN -- need to leave
494: l_return_status := x_return_status;
495: RAISE G_EXCEPTION_HALT_VALIDATION;
496: ELSE
497: l_return_status := x_return_status; -- record that there was an error
498: END IF;
499: END IF;
500:
501: validate_rul_id(p_awrv_rec, x_return_status);
502: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
503: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN -- need to leave
504: l_return_status := x_return_status;
505: RAISE G_EXCEPTION_HALT_VALIDATION;
506: ELSE
499: END IF;
500:
501: validate_rul_id(p_awrv_rec, x_return_status);
502: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
503: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN -- need to leave
504: l_return_status := x_return_status;
505: RAISE G_EXCEPTION_HALT_VALIDATION;
506: ELSE
507: l_return_status := x_return_status; -- record that there was an error
508: END IF;
509: END IF;
510:
511: validate_sort_sequence(p_awrv_rec, x_return_status);
512: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
513: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN -- need to leave
514: l_return_status := x_return_status;
515: RAISE G_EXCEPTION_HALT_VALIDATION;
516: ELSE
509: END IF;
510:
511: validate_sort_sequence(p_awrv_rec, x_return_status);
512: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
513: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN -- need to leave
514: l_return_status := x_return_status;
515: RAISE G_EXCEPTION_HALT_VALIDATION;
516: ELSE
517: l_return_status := x_return_status; -- record that there was an error
530: ---------------------------------------
531: FUNCTION Validate_Record (
532: p_awrv_rec IN awrv_rec_type
533: ) RETURN VARCHAR2 IS
534: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
535: BEGIN
536: RETURN (l_return_status);
537: END Validate_Record;
538:
611: -- validate_row for:OKL_ANSWERS_V --
612: ------------------------------------
613: PROCEDURE validate_row(
614: p_api_version IN NUMBER,
615: p_init_msg_list IN VARCHAR2 DEFAULT okl_api.G_FALSE,
616: x_return_status OUT NOCOPY VARCHAR2,
617: x_msg_count OUT NOCOPY NUMBER,
618: x_msg_data OUT NOCOPY VARCHAR2,
619: p_awrv_rec IN awrv_rec_type) IS
619: p_awrv_rec IN awrv_rec_type) IS
620:
621: l_api_version CONSTANT NUMBER := 1;
622: l_api_name CONSTANT VARCHAR2(30) := 'V_validate_row';
623: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
624: l_awrv_rec awrv_rec_type := p_awrv_rec;
625: l_awr_rec awr_rec_type;
626: BEGIN
627: l_return_status := okl_api.START_ACTIVITY(l_api_name,
623: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
624: l_awrv_rec awrv_rec_type := p_awrv_rec;
625: l_awr_rec awr_rec_type;
626: BEGIN
627: l_return_status := okl_api.START_ACTIVITY(l_api_name,
628: G_PKG_NAME,
629: p_init_msg_list,
630: l_api_version,
631: p_api_version,
630: l_api_version,
631: p_api_version,
632: '_PVT',
633: x_return_status);
634: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
635: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
636: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
637: RAISE okl_api.G_EXCEPTION_ERROR;
638: END IF;
631: p_api_version,
632: '_PVT',
633: x_return_status);
634: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
635: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
636: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
637: RAISE okl_api.G_EXCEPTION_ERROR;
638: END IF;
639: --- Validate all non-missing attributes (Item Level Validation)
632: '_PVT',
633: x_return_status);
634: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
635: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
636: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
637: RAISE okl_api.G_EXCEPTION_ERROR;
638: END IF;
639: --- Validate all non-missing attributes (Item Level Validation)
640: l_return_status := Validate_Attributes(l_awrv_rec);
633: x_return_status);
634: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
635: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
636: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
637: RAISE okl_api.G_EXCEPTION_ERROR;
638: END IF;
639: --- Validate all non-missing attributes (Item Level Validation)
640: l_return_status := Validate_Attributes(l_awrv_rec);
641: --- If any errors happen abort API
638: END IF;
639: --- Validate all non-missing attributes (Item Level Validation)
640: l_return_status := Validate_Attributes(l_awrv_rec);
641: --- If any errors happen abort API
642: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
643: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
644: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
645: RAISE okl_api.G_EXCEPTION_ERROR;
646: END IF;
639: --- Validate all non-missing attributes (Item Level Validation)
640: l_return_status := Validate_Attributes(l_awrv_rec);
641: --- If any errors happen abort API
642: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
643: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
644: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
645: RAISE okl_api.G_EXCEPTION_ERROR;
646: END IF;
647: l_return_status := Validate_Record(l_awrv_rec);
640: l_return_status := Validate_Attributes(l_awrv_rec);
641: --- If any errors happen abort API
642: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
643: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
644: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
645: RAISE okl_api.G_EXCEPTION_ERROR;
646: END IF;
647: l_return_status := Validate_Record(l_awrv_rec);
648: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
641: --- If any errors happen abort API
642: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
643: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
644: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
645: RAISE okl_api.G_EXCEPTION_ERROR;
646: END IF;
647: l_return_status := Validate_Record(l_awrv_rec);
648: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
649: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
644: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
645: RAISE okl_api.G_EXCEPTION_ERROR;
646: END IF;
647: l_return_status := Validate_Record(l_awrv_rec);
648: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
649: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
650: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
651: RAISE okl_api.G_EXCEPTION_ERROR;
652: END IF;
645: RAISE okl_api.G_EXCEPTION_ERROR;
646: END IF;
647: l_return_status := Validate_Record(l_awrv_rec);
648: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
649: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
650: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
651: RAISE okl_api.G_EXCEPTION_ERROR;
652: END IF;
653: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
646: END IF;
647: l_return_status := Validate_Record(l_awrv_rec);
648: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
649: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
650: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
651: RAISE okl_api.G_EXCEPTION_ERROR;
652: END IF;
653: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
654: EXCEPTION
647: l_return_status := Validate_Record(l_awrv_rec);
648: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
649: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
650: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
651: RAISE okl_api.G_EXCEPTION_ERROR;
652: END IF;
653: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
654: EXCEPTION
655: WHEN okl_api.G_EXCEPTION_ERROR THEN
649: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
650: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
651: RAISE okl_api.G_EXCEPTION_ERROR;
652: END IF;
653: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
654: EXCEPTION
655: WHEN okl_api.G_EXCEPTION_ERROR THEN
656: x_return_status := okl_api.HANDLE_EXCEPTIONS
657: (
651: RAISE okl_api.G_EXCEPTION_ERROR;
652: END IF;
653: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
654: EXCEPTION
655: WHEN okl_api.G_EXCEPTION_ERROR THEN
656: x_return_status := okl_api.HANDLE_EXCEPTIONS
657: (
658: l_api_name,
659: G_PKG_NAME,
652: END IF;
653: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
654: EXCEPTION
655: WHEN okl_api.G_EXCEPTION_ERROR THEN
656: x_return_status := okl_api.HANDLE_EXCEPTIONS
657: (
658: l_api_name,
659: G_PKG_NAME,
660: 'okl_api.G_RET_STS_ERROR',
656: x_return_status := okl_api.HANDLE_EXCEPTIONS
657: (
658: l_api_name,
659: G_PKG_NAME,
660: 'okl_api.G_RET_STS_ERROR',
661: x_msg_count,
662: x_msg_data,
663: '_PVT'
664: );
661: x_msg_count,
662: x_msg_data,
663: '_PVT'
664: );
665: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
666: x_return_status :=okl_api.HANDLE_EXCEPTIONS
667: (
668: l_api_name,
669: G_PKG_NAME,
662: x_msg_data,
663: '_PVT'
664: );
665: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
666: x_return_status :=okl_api.HANDLE_EXCEPTIONS
667: (
668: l_api_name,
669: G_PKG_NAME,
670: 'okl_api.G_RET_STS_UNEXP_ERROR',
666: x_return_status :=okl_api.HANDLE_EXCEPTIONS
667: (
668: l_api_name,
669: G_PKG_NAME,
670: 'okl_api.G_RET_STS_UNEXP_ERROR',
671: x_msg_count,
672: x_msg_data,
673: '_PVT'
674: );
672: x_msg_data,
673: '_PVT'
674: );
675: WHEN OTHERS THEN
676: x_return_status :=okl_api.HANDLE_EXCEPTIONS
677: (
678: l_api_name,
679: G_PKG_NAME,
680: 'OTHERS',
687: -- PL/SQL TBL validate_row for:AWRV_TBL --
688: ------------------------------------------
689: PROCEDURE validate_row(
690: p_api_version IN NUMBER,
691: p_init_msg_list IN VARCHAR2 DEFAULT okl_api.G_FALSE,
692: x_return_status OUT NOCOPY VARCHAR2,
693: x_msg_count OUT NOCOPY NUMBER,
694: x_msg_data OUT NOCOPY VARCHAR2,
695: p_awrv_tbl IN awrv_tbl_type) IS
695: p_awrv_tbl IN awrv_tbl_type) IS
696:
697: l_api_version CONSTANT NUMBER := 1;
698: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_validate_row';
699: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
700: i NUMBER := 0;
701: BEGIN
702: okl_api.init_msg_list(p_init_msg_list);
703: -- Make sure PL/SQL table has records in it before passing
698: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_validate_row';
699: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
700: i NUMBER := 0;
701: BEGIN
702: okl_api.init_msg_list(p_init_msg_list);
703: -- Make sure PL/SQL table has records in it before passing
704: IF (p_awrv_tbl.COUNT > 0) THEN
705: i := p_awrv_tbl.FIRST;
706: LOOP
705: i := p_awrv_tbl.FIRST;
706: LOOP
707: validate_row (
708: p_api_version => p_api_version,
709: p_init_msg_list => okl_api.G_FALSE,
710: x_return_status => x_return_status,
711: x_msg_count => x_msg_count,
712: x_msg_data => x_msg_data,
713: p_awrv_rec => p_awrv_tbl(i));
715: i := p_awrv_tbl.NEXT(i);
716: END LOOP;
717: END IF;
718: EXCEPTION
719: WHEN okl_api.G_EXCEPTION_ERROR THEN
720: x_return_status := okl_api.HANDLE_EXCEPTIONS
721: (
722: l_api_name,
723: G_PKG_NAME,
716: END LOOP;
717: END IF;
718: EXCEPTION
719: WHEN okl_api.G_EXCEPTION_ERROR THEN
720: x_return_status := okl_api.HANDLE_EXCEPTIONS
721: (
722: l_api_name,
723: G_PKG_NAME,
724: 'okl_api.G_RET_STS_ERROR',
720: x_return_status := okl_api.HANDLE_EXCEPTIONS
721: (
722: l_api_name,
723: G_PKG_NAME,
724: 'okl_api.G_RET_STS_ERROR',
725: x_msg_count,
726: x_msg_data,
727: '_PVT'
728: );
725: x_msg_count,
726: x_msg_data,
727: '_PVT'
728: );
729: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
730: x_return_status :=okl_api.HANDLE_EXCEPTIONS
731: (
732: l_api_name,
733: G_PKG_NAME,
726: x_msg_data,
727: '_PVT'
728: );
729: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
730: x_return_status :=okl_api.HANDLE_EXCEPTIONS
731: (
732: l_api_name,
733: G_PKG_NAME,
734: 'okl_api.G_RET_STS_UNEXP_ERROR',
730: x_return_status :=okl_api.HANDLE_EXCEPTIONS
731: (
732: l_api_name,
733: G_PKG_NAME,
734: 'okl_api.G_RET_STS_UNEXP_ERROR',
735: x_msg_count,
736: x_msg_data,
737: '_PVT'
738: );
736: x_msg_data,
737: '_PVT'
738: );
739: WHEN OTHERS THEN
740: x_return_status :=okl_api.HANDLE_EXCEPTIONS
741: (
742: l_api_name,
743: G_PKG_NAME,
744: 'OTHERS',
754: --------------------------------
755: -- insert_row for:OKL_ANSWERS --
756: --------------------------------
757: PROCEDURE insert_row(
758: p_init_msg_list IN VARCHAR2 DEFAULT okl_api.G_FALSE,
759: x_return_status OUT NOCOPY VARCHAR2,
760: x_msg_count OUT NOCOPY NUMBER,
761: x_msg_data OUT NOCOPY VARCHAR2,
762: p_awr_rec IN awr_rec_type,
763: x_awr_rec OUT NOCOPY awr_rec_type) IS
764:
765: l_api_version CONSTANT NUMBER := 1;
766: l_api_name CONSTANT VARCHAR2(30) := 'ANSWERS_insert_row';
767: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
768: l_awr_rec awr_rec_type := p_awr_rec;
769: l_def_awr_rec awr_rec_type;
770: ------------------------------------
771: -- Set_Attributes for:OKL_ANSWERS --
773: FUNCTION Set_Attributes (
774: p_awr_rec IN awr_rec_type,
775: x_awr_rec OUT NOCOPY awr_rec_type
776: ) RETURN VARCHAR2 IS
777: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
778: BEGIN
779: x_awr_rec := p_awr_rec;
780: RETURN(l_return_status);
781: END Set_Attributes;
779: x_awr_rec := p_awr_rec;
780: RETURN(l_return_status);
781: END Set_Attributes;
782: BEGIN
783: l_return_status := okl_api.START_ACTIVITY(l_api_name,
784: p_init_msg_list,
785: '_PVT',
786: x_return_status);
787: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
783: l_return_status := okl_api.START_ACTIVITY(l_api_name,
784: p_init_msg_list,
785: '_PVT',
786: x_return_status);
787: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
788: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
789: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
790: RAISE okl_api.G_EXCEPTION_ERROR;
791: END IF;
784: p_init_msg_list,
785: '_PVT',
786: x_return_status);
787: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
788: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
789: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
790: RAISE okl_api.G_EXCEPTION_ERROR;
791: END IF;
792: --- Setting item attributes
785: '_PVT',
786: x_return_status);
787: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
788: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
789: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
790: RAISE okl_api.G_EXCEPTION_ERROR;
791: END IF;
792: --- Setting item attributes
793: l_return_status := Set_Attributes(
786: x_return_status);
787: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
788: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
789: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
790: RAISE okl_api.G_EXCEPTION_ERROR;
791: END IF;
792: --- Setting item attributes
793: l_return_status := Set_Attributes(
794: p_awr_rec, -- IN
793: l_return_status := Set_Attributes(
794: p_awr_rec, -- IN
795: l_awr_rec); -- OUT
796: --- If any errors happen abort API
797: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
798: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
799: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
800: RAISE okl_api.G_EXCEPTION_ERROR;
801: END IF;
794: p_awr_rec, -- IN
795: l_awr_rec); -- OUT
796: --- If any errors happen abort API
797: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
798: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
799: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
800: RAISE okl_api.G_EXCEPTION_ERROR;
801: END IF;
802: INSERT INTO OKL_ANSWERS(
795: l_awr_rec); -- OUT
796: --- If any errors happen abort API
797: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
798: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
799: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
800: RAISE okl_api.G_EXCEPTION_ERROR;
801: END IF;
802: INSERT INTO OKL_ANSWERS(
803: id,
796: --- If any errors happen abort API
797: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
798: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
799: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
800: RAISE okl_api.G_EXCEPTION_ERROR;
801: END IF;
802: INSERT INTO OKL_ANSWERS(
803: id,
804: ant_id,
854: l_awr_rec.last_update_date,
855: l_awr_rec.last_update_login);
856: -- Set OUT values
857: x_awr_rec := l_awr_rec;
858: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
859: EXCEPTION
860: WHEN okl_api.G_EXCEPTION_ERROR THEN
861: x_return_status := okl_api.HANDLE_EXCEPTIONS
862: (
856: -- Set OUT values
857: x_awr_rec := l_awr_rec;
858: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
859: EXCEPTION
860: WHEN okl_api.G_EXCEPTION_ERROR THEN
861: x_return_status := okl_api.HANDLE_EXCEPTIONS
862: (
863: l_api_name,
864: G_PKG_NAME,
857: x_awr_rec := l_awr_rec;
858: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
859: EXCEPTION
860: WHEN okl_api.G_EXCEPTION_ERROR THEN
861: x_return_status := okl_api.HANDLE_EXCEPTIONS
862: (
863: l_api_name,
864: G_PKG_NAME,
865: 'okl_api.G_RET_STS_ERROR',
861: x_return_status := okl_api.HANDLE_EXCEPTIONS
862: (
863: l_api_name,
864: G_PKG_NAME,
865: 'okl_api.G_RET_STS_ERROR',
866: x_msg_count,
867: x_msg_data,
868: '_PVT'
869: );
866: x_msg_count,
867: x_msg_data,
868: '_PVT'
869: );
870: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
871: x_return_status :=okl_api.HANDLE_EXCEPTIONS
872: (
873: l_api_name,
874: G_PKG_NAME,
867: x_msg_data,
868: '_PVT'
869: );
870: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
871: x_return_status :=okl_api.HANDLE_EXCEPTIONS
872: (
873: l_api_name,
874: G_PKG_NAME,
875: 'okl_api.G_RET_STS_UNEXP_ERROR',
871: x_return_status :=okl_api.HANDLE_EXCEPTIONS
872: (
873: l_api_name,
874: G_PKG_NAME,
875: 'okl_api.G_RET_STS_UNEXP_ERROR',
876: x_msg_count,
877: x_msg_data,
878: '_PVT'
879: );
877: x_msg_data,
878: '_PVT'
879: );
880: WHEN OTHERS THEN
881: x_return_status :=okl_api.HANDLE_EXCEPTIONS
882: (
883: l_api_name,
884: G_PKG_NAME,
885: 'OTHERS',
892: -- insert_row for:OKL_ANSWERS_V --
893: ----------------------------------
894: PROCEDURE insert_row(
895: p_api_version IN NUMBER,
896: p_init_msg_list IN VARCHAR2 DEFAULT okl_api.G_FALSE,
897: x_return_status OUT NOCOPY VARCHAR2,
898: x_msg_count OUT NOCOPY NUMBER,
899: x_msg_data OUT NOCOPY VARCHAR2,
900: p_awrv_rec IN awrv_rec_type,
901: x_awrv_rec OUT NOCOPY awrv_rec_type) IS
902:
903: l_api_version CONSTANT NUMBER := 1;
904: l_api_name CONSTANT VARCHAR2(30) := 'V_insert_row';
905: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
906: l_awrv_rec awrv_rec_type;
907: l_def_awrv_rec awrv_rec_type;
908: l_awr_rec awr_rec_type;
909: lx_awr_rec awr_rec_type;
928: FUNCTION Set_Attributes (
929: p_awrv_rec IN awrv_rec_type,
930: x_awrv_rec OUT NOCOPY awrv_rec_type
931: ) RETURN VARCHAR2 IS
932: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
933: BEGIN
934: x_awrv_rec := p_awrv_rec;
935: x_awrv_rec.OBJECT_VERSION_NUMBER := 1;
936: RETURN(l_return_status);
935: x_awrv_rec.OBJECT_VERSION_NUMBER := 1;
936: RETURN(l_return_status);
937: END Set_Attributes;
938: BEGIN
939: l_return_status := okl_api.START_ACTIVITY(l_api_name,
940: G_PKG_NAME,
941: p_init_msg_list,
942: l_api_version,
943: p_api_version,
942: l_api_version,
943: p_api_version,
944: '_PVT',
945: x_return_status);
946: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
947: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
948: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
949: RAISE okl_api.G_EXCEPTION_ERROR;
950: END IF;
943: p_api_version,
944: '_PVT',
945: x_return_status);
946: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
947: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
948: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
949: RAISE okl_api.G_EXCEPTION_ERROR;
950: END IF;
951: l_awrv_rec := null_out_defaults(p_awrv_rec);
944: '_PVT',
945: x_return_status);
946: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
947: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
948: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
949: RAISE okl_api.G_EXCEPTION_ERROR;
950: END IF;
951: l_awrv_rec := null_out_defaults(p_awrv_rec);
952: -- Set primary key value
945: x_return_status);
946: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
947: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
948: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
949: RAISE okl_api.G_EXCEPTION_ERROR;
950: END IF;
951: l_awrv_rec := null_out_defaults(p_awrv_rec);
952: -- Set primary key value
953: l_awrv_rec.ID := get_seq_id;
955: l_return_status := Set_Attributes(
956: l_awrv_rec, -- IN
957: l_def_awrv_rec); -- OUT
958: --- If any errors happen abort API
959: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
960: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
961: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
962: RAISE okl_api.G_EXCEPTION_ERROR;
963: END IF;
956: l_awrv_rec, -- IN
957: l_def_awrv_rec); -- OUT
958: --- If any errors happen abort API
959: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
960: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
961: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
962: RAISE okl_api.G_EXCEPTION_ERROR;
963: END IF;
964: l_def_awrv_rec := fill_who_columns(l_def_awrv_rec);
957: l_def_awrv_rec); -- OUT
958: --- If any errors happen abort API
959: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
960: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
961: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
962: RAISE okl_api.G_EXCEPTION_ERROR;
963: END IF;
964: l_def_awrv_rec := fill_who_columns(l_def_awrv_rec);
965: --- Validate all non-missing attributes (Item Level Validation)
958: --- If any errors happen abort API
959: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
960: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
961: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
962: RAISE okl_api.G_EXCEPTION_ERROR;
963: END IF;
964: l_def_awrv_rec := fill_who_columns(l_def_awrv_rec);
965: --- Validate all non-missing attributes (Item Level Validation)
966: l_return_status := Validate_Attributes(l_def_awrv_rec);
964: l_def_awrv_rec := fill_who_columns(l_def_awrv_rec);
965: --- Validate all non-missing attributes (Item Level Validation)
966: l_return_status := Validate_Attributes(l_def_awrv_rec);
967: --- If any errors happen abort API
968: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
969: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
970: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
971: RAISE okl_api.G_EXCEPTION_ERROR;
972: END IF;
965: --- Validate all non-missing attributes (Item Level Validation)
966: l_return_status := Validate_Attributes(l_def_awrv_rec);
967: --- If any errors happen abort API
968: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
969: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
970: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
971: RAISE okl_api.G_EXCEPTION_ERROR;
972: END IF;
973: l_return_status := Validate_Record(l_def_awrv_rec);
966: l_return_status := Validate_Attributes(l_def_awrv_rec);
967: --- If any errors happen abort API
968: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
969: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
970: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
971: RAISE okl_api.G_EXCEPTION_ERROR;
972: END IF;
973: l_return_status := Validate_Record(l_def_awrv_rec);
974: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
967: --- If any errors happen abort API
968: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
969: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
970: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
971: RAISE okl_api.G_EXCEPTION_ERROR;
972: END IF;
973: l_return_status := Validate_Record(l_def_awrv_rec);
974: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
975: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
970: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
971: RAISE okl_api.G_EXCEPTION_ERROR;
972: END IF;
973: l_return_status := Validate_Record(l_def_awrv_rec);
974: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
975: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
976: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
977: RAISE okl_api.G_EXCEPTION_ERROR;
978: END IF;
971: RAISE okl_api.G_EXCEPTION_ERROR;
972: END IF;
973: l_return_status := Validate_Record(l_def_awrv_rec);
974: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
975: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
976: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
977: RAISE okl_api.G_EXCEPTION_ERROR;
978: END IF;
979: --------------------------------------
972: END IF;
973: l_return_status := Validate_Record(l_def_awrv_rec);
974: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
975: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
976: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
977: RAISE okl_api.G_EXCEPTION_ERROR;
978: END IF;
979: --------------------------------------
980: -- Move VIEW record to "Child" records
973: l_return_status := Validate_Record(l_def_awrv_rec);
974: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
975: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
976: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
977: RAISE okl_api.G_EXCEPTION_ERROR;
978: END IF;
979: --------------------------------------
980: -- Move VIEW record to "Child" records
981: --------------------------------------
990: x_msg_data,
991: l_awr_rec,
992: lx_awr_rec
993: );
994: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
995: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
996: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
997: RAISE okl_api.G_EXCEPTION_ERROR;
998: END IF;
991: l_awr_rec,
992: lx_awr_rec
993: );
994: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
995: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
996: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
997: RAISE okl_api.G_EXCEPTION_ERROR;
998: END IF;
999: migrate(lx_awr_rec, l_def_awrv_rec);
992: lx_awr_rec
993: );
994: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
995: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
996: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
997: RAISE okl_api.G_EXCEPTION_ERROR;
998: END IF;
999: migrate(lx_awr_rec, l_def_awrv_rec);
1000: -- Set OUT values
993: );
994: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
995: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
996: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
997: RAISE okl_api.G_EXCEPTION_ERROR;
998: END IF;
999: migrate(lx_awr_rec, l_def_awrv_rec);
1000: -- Set OUT values
1001: x_awrv_rec := l_def_awrv_rec;
998: END IF;
999: migrate(lx_awr_rec, l_def_awrv_rec);
1000: -- Set OUT values
1001: x_awrv_rec := l_def_awrv_rec;
1002: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1003: EXCEPTION
1004: WHEN okl_api.G_EXCEPTION_ERROR THEN
1005: x_return_status := okl_api.HANDLE_EXCEPTIONS
1006: (
1000: -- Set OUT values
1001: x_awrv_rec := l_def_awrv_rec;
1002: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1003: EXCEPTION
1004: WHEN okl_api.G_EXCEPTION_ERROR THEN
1005: x_return_status := okl_api.HANDLE_EXCEPTIONS
1006: (
1007: l_api_name,
1008: G_PKG_NAME,
1001: x_awrv_rec := l_def_awrv_rec;
1002: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1003: EXCEPTION
1004: WHEN okl_api.G_EXCEPTION_ERROR THEN
1005: x_return_status := okl_api.HANDLE_EXCEPTIONS
1006: (
1007: l_api_name,
1008: G_PKG_NAME,
1009: 'okl_api.G_RET_STS_ERROR',
1005: x_return_status := okl_api.HANDLE_EXCEPTIONS
1006: (
1007: l_api_name,
1008: G_PKG_NAME,
1009: 'okl_api.G_RET_STS_ERROR',
1010: x_msg_count,
1011: x_msg_data,
1012: '_PVT'
1013: );
1010: x_msg_count,
1011: x_msg_data,
1012: '_PVT'
1013: );
1014: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1015: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1016: (
1017: l_api_name,
1018: G_PKG_NAME,
1011: x_msg_data,
1012: '_PVT'
1013: );
1014: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1015: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1016: (
1017: l_api_name,
1018: G_PKG_NAME,
1019: 'okl_api.G_RET_STS_UNEXP_ERROR',
1015: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1016: (
1017: l_api_name,
1018: G_PKG_NAME,
1019: 'okl_api.G_RET_STS_UNEXP_ERROR',
1020: x_msg_count,
1021: x_msg_data,
1022: '_PVT'
1023: );
1021: x_msg_data,
1022: '_PVT'
1023: );
1024: WHEN OTHERS THEN
1025: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1026: (
1027: l_api_name,
1028: G_PKG_NAME,
1029: 'OTHERS',
1036: -- PL/SQL TBL insert_row for:AWRV_TBL --
1037: ----------------------------------------
1038: PROCEDURE insert_row(
1039: p_api_version IN NUMBER,
1040: p_init_msg_list IN VARCHAR2 DEFAULT okl_api.G_FALSE,
1041: x_return_status OUT NOCOPY VARCHAR2,
1042: x_msg_count OUT NOCOPY NUMBER,
1043: x_msg_data OUT NOCOPY VARCHAR2,
1044: p_awrv_tbl IN awrv_tbl_type,
1045: x_awrv_tbl OUT NOCOPY awrv_tbl_type) IS
1046:
1047: l_api_version CONSTANT NUMBER := 1;
1048: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_insert_row';
1049: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1050: i NUMBER := 0;
1051: BEGIN
1052: okl_api.init_msg_list(p_init_msg_list);
1053: -- Make sure PL/SQL table has records in it before passing
1048: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_insert_row';
1049: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1050: i NUMBER := 0;
1051: BEGIN
1052: okl_api.init_msg_list(p_init_msg_list);
1053: -- Make sure PL/SQL table has records in it before passing
1054: IF (p_awrv_tbl.COUNT > 0) THEN
1055: i := p_awrv_tbl.FIRST;
1056: LOOP
1055: i := p_awrv_tbl.FIRST;
1056: LOOP
1057: insert_row (
1058: p_api_version => p_api_version,
1059: p_init_msg_list => okl_api.G_FALSE,
1060: x_return_status => x_return_status,
1061: x_msg_count => x_msg_count,
1062: x_msg_data => x_msg_data,
1063: p_awrv_rec => p_awrv_tbl(i),
1066: i := p_awrv_tbl.NEXT(i);
1067: END LOOP;
1068: END IF;
1069: EXCEPTION
1070: WHEN okl_api.G_EXCEPTION_ERROR THEN
1071: x_return_status := okl_api.HANDLE_EXCEPTIONS
1072: (
1073: l_api_name,
1074: G_PKG_NAME,
1067: END LOOP;
1068: END IF;
1069: EXCEPTION
1070: WHEN okl_api.G_EXCEPTION_ERROR THEN
1071: x_return_status := okl_api.HANDLE_EXCEPTIONS
1072: (
1073: l_api_name,
1074: G_PKG_NAME,
1075: 'okl_api.G_RET_STS_ERROR',
1071: x_return_status := okl_api.HANDLE_EXCEPTIONS
1072: (
1073: l_api_name,
1074: G_PKG_NAME,
1075: 'okl_api.G_RET_STS_ERROR',
1076: x_msg_count,
1077: x_msg_data,
1078: '_PVT'
1079: );
1076: x_msg_count,
1077: x_msg_data,
1078: '_PVT'
1079: );
1080: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1081: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1082: (
1083: l_api_name,
1084: G_PKG_NAME,
1077: x_msg_data,
1078: '_PVT'
1079: );
1080: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1081: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1082: (
1083: l_api_name,
1084: G_PKG_NAME,
1085: 'okl_api.G_RET_STS_UNEXP_ERROR',
1081: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1082: (
1083: l_api_name,
1084: G_PKG_NAME,
1085: 'okl_api.G_RET_STS_UNEXP_ERROR',
1086: x_msg_count,
1087: x_msg_data,
1088: '_PVT'
1089: );
1087: x_msg_data,
1088: '_PVT'
1089: );
1090: WHEN OTHERS THEN
1091: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1092: (
1093: l_api_name,
1094: G_PKG_NAME,
1095: 'OTHERS',
1105: ------------------------------
1106: -- lock_row for:OKL_ANSWERS --
1107: ------------------------------
1108: PROCEDURE lock_row(
1109: p_init_msg_list IN VARCHAR2 DEFAULT okl_api.G_FALSE,
1110: x_return_status OUT NOCOPY VARCHAR2,
1111: x_msg_count OUT NOCOPY NUMBER,
1112: x_msg_data OUT NOCOPY VARCHAR2,
1113: p_awr_rec IN awr_rec_type) IS
1126: FROM OKL_ANSWERS
1127: WHERE ID = p_awr_rec.id;
1128: l_api_version CONSTANT NUMBER := 1;
1129: l_api_name CONSTANT VARCHAR2(30) := 'ANSWERS_lock_row';
1130: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1131: l_object_version_number OKL_ANSWERS.OBJECT_VERSION_NUMBER%TYPE;
1132: lc_object_version_number OKL_ANSWERS.OBJECT_VERSION_NUMBER%TYPE;
1133: l_row_notfound BOOLEAN := FALSE;
1134: lc_row_notfound BOOLEAN := FALSE;
1132: lc_object_version_number OKL_ANSWERS.OBJECT_VERSION_NUMBER%TYPE;
1133: l_row_notfound BOOLEAN := FALSE;
1134: lc_row_notfound BOOLEAN := FALSE;
1135: BEGIN
1136: l_return_status := okl_api.START_ACTIVITY(l_api_name,
1137: p_init_msg_list,
1138: '_PVT',
1139: x_return_status);
1140: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1136: l_return_status := okl_api.START_ACTIVITY(l_api_name,
1137: p_init_msg_list,
1138: '_PVT',
1139: x_return_status);
1140: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1141: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1142: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1143: RAISE okl_api.G_EXCEPTION_ERROR;
1144: END IF;
1137: p_init_msg_list,
1138: '_PVT',
1139: x_return_status);
1140: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1141: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1142: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1143: RAISE okl_api.G_EXCEPTION_ERROR;
1144: END IF;
1145: BEGIN
1138: '_PVT',
1139: x_return_status);
1140: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1141: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1142: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1143: RAISE okl_api.G_EXCEPTION_ERROR;
1144: END IF;
1145: BEGIN
1146: OPEN lock_csr(p_awr_rec);
1139: x_return_status);
1140: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1141: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1142: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1143: RAISE okl_api.G_EXCEPTION_ERROR;
1144: END IF;
1145: BEGIN
1146: OPEN lock_csr(p_awr_rec);
1147: FETCH lock_csr INTO l_object_version_number;
1151: WHEN E_Resource_Busy THEN
1152: IF (lock_csr%ISOPEN) THEN
1153: CLOSE lock_csr;
1154: END IF;
1155: okl_api.set_message(G_FND_APP,G_FORM_UNABLE_TO_RESERVE_REC);
1156: RAISE App_Exceptions.RECORD_LOCK_EXCEPTION;
1157: END;
1158:
1159: IF ( l_row_notfound ) THEN
1162: lc_row_notfound := lchk_csr%NOTFOUND;
1163: CLOSE lchk_csr;
1164: END IF;
1165: IF (lc_row_notfound) THEN
1166: okl_api.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
1167: RAISE okl_api.G_EXCEPTION_ERROR;
1168: ELSIF lc_object_version_number > p_awr_rec.object_version_number THEN
1169: okl_api.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1170: RAISE okl_api.G_EXCEPTION_ERROR;
1163: CLOSE lchk_csr;
1164: END IF;
1165: IF (lc_row_notfound) THEN
1166: okl_api.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
1167: RAISE okl_api.G_EXCEPTION_ERROR;
1168: ELSIF lc_object_version_number > p_awr_rec.object_version_number THEN
1169: okl_api.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1170: RAISE okl_api.G_EXCEPTION_ERROR;
1171: ELSIF lc_object_version_number <> p_awr_rec.object_version_number THEN
1165: IF (lc_row_notfound) THEN
1166: okl_api.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
1167: RAISE okl_api.G_EXCEPTION_ERROR;
1168: ELSIF lc_object_version_number > p_awr_rec.object_version_number THEN
1169: okl_api.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1170: RAISE okl_api.G_EXCEPTION_ERROR;
1171: ELSIF lc_object_version_number <> p_awr_rec.object_version_number THEN
1172: okl_api.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1173: RAISE okl_api.G_EXCEPTION_ERROR;
1166: okl_api.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
1167: RAISE okl_api.G_EXCEPTION_ERROR;
1168: ELSIF lc_object_version_number > p_awr_rec.object_version_number THEN
1169: okl_api.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1170: RAISE okl_api.G_EXCEPTION_ERROR;
1171: ELSIF lc_object_version_number <> p_awr_rec.object_version_number THEN
1172: okl_api.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1173: RAISE okl_api.G_EXCEPTION_ERROR;
1174: ELSIF lc_object_version_number = -1 THEN
1168: ELSIF lc_object_version_number > p_awr_rec.object_version_number THEN
1169: okl_api.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1170: RAISE okl_api.G_EXCEPTION_ERROR;
1171: ELSIF lc_object_version_number <> p_awr_rec.object_version_number THEN
1172: okl_api.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1173: RAISE okl_api.G_EXCEPTION_ERROR;
1174: ELSIF lc_object_version_number = -1 THEN
1175: okl_api.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
1176: RAISE okl_api.G_EXCEPTION_ERROR;
1169: okl_api.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1170: RAISE okl_api.G_EXCEPTION_ERROR;
1171: ELSIF lc_object_version_number <> p_awr_rec.object_version_number THEN
1172: okl_api.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1173: RAISE okl_api.G_EXCEPTION_ERROR;
1174: ELSIF lc_object_version_number = -1 THEN
1175: okl_api.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
1176: RAISE okl_api.G_EXCEPTION_ERROR;
1177: END IF;
1171: ELSIF lc_object_version_number <> p_awr_rec.object_version_number THEN
1172: okl_api.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1173: RAISE okl_api.G_EXCEPTION_ERROR;
1174: ELSIF lc_object_version_number = -1 THEN
1175: okl_api.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
1176: RAISE okl_api.G_EXCEPTION_ERROR;
1177: END IF;
1178: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1179: EXCEPTION
1172: okl_api.set_message(G_FND_APP,G_FORM_RECORD_CHANGED);
1173: RAISE okl_api.G_EXCEPTION_ERROR;
1174: ELSIF lc_object_version_number = -1 THEN
1175: okl_api.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
1176: RAISE okl_api.G_EXCEPTION_ERROR;
1177: END IF;
1178: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1179: EXCEPTION
1180: WHEN okl_api.G_EXCEPTION_ERROR THEN
1174: ELSIF lc_object_version_number = -1 THEN
1175: okl_api.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
1176: RAISE okl_api.G_EXCEPTION_ERROR;
1177: END IF;
1178: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1179: EXCEPTION
1180: WHEN okl_api.G_EXCEPTION_ERROR THEN
1181: x_return_status := okl_api.HANDLE_EXCEPTIONS
1182: (
1176: RAISE okl_api.G_EXCEPTION_ERROR;
1177: END IF;
1178: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1179: EXCEPTION
1180: WHEN okl_api.G_EXCEPTION_ERROR THEN
1181: x_return_status := okl_api.HANDLE_EXCEPTIONS
1182: (
1183: l_api_name,
1184: G_PKG_NAME,
1177: END IF;
1178: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1179: EXCEPTION
1180: WHEN okl_api.G_EXCEPTION_ERROR THEN
1181: x_return_status := okl_api.HANDLE_EXCEPTIONS
1182: (
1183: l_api_name,
1184: G_PKG_NAME,
1185: 'okl_api.G_RET_STS_ERROR',
1181: x_return_status := okl_api.HANDLE_EXCEPTIONS
1182: (
1183: l_api_name,
1184: G_PKG_NAME,
1185: 'okl_api.G_RET_STS_ERROR',
1186: x_msg_count,
1187: x_msg_data,
1188: '_PVT'
1189: );
1186: x_msg_count,
1187: x_msg_data,
1188: '_PVT'
1189: );
1190: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1191: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1192: (
1193: l_api_name,
1194: G_PKG_NAME,
1187: x_msg_data,
1188: '_PVT'
1189: );
1190: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1191: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1192: (
1193: l_api_name,
1194: G_PKG_NAME,
1195: 'okl_api.G_RET_STS_UNEXP_ERROR',
1191: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1192: (
1193: l_api_name,
1194: G_PKG_NAME,
1195: 'okl_api.G_RET_STS_UNEXP_ERROR',
1196: x_msg_count,
1197: x_msg_data,
1198: '_PVT'
1199: );
1197: x_msg_data,
1198: '_PVT'
1199: );
1200: WHEN OTHERS THEN
1201: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1202: (
1203: l_api_name,
1204: G_PKG_NAME,
1205: 'OTHERS',
1212: -- lock_row for:OKL_ANSWERS_V --
1213: --------------------------------
1214: PROCEDURE lock_row(
1215: p_api_version IN NUMBER,
1216: p_init_msg_list IN VARCHAR2 DEFAULT okl_api.G_FALSE,
1217: x_return_status OUT NOCOPY VARCHAR2,
1218: x_msg_count OUT NOCOPY NUMBER,
1219: x_msg_data OUT NOCOPY VARCHAR2,
1220: p_awrv_rec IN awrv_rec_type) IS
1220: p_awrv_rec IN awrv_rec_type) IS
1221:
1222: l_api_version CONSTANT NUMBER := 1;
1223: l_api_name CONSTANT VARCHAR2(30) := 'V_lock_row';
1224: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1225: l_awr_rec awr_rec_type;
1226: BEGIN
1227: l_return_status := okl_api.START_ACTIVITY(l_api_name,
1228: G_PKG_NAME,
1223: l_api_name CONSTANT VARCHAR2(30) := 'V_lock_row';
1224: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1225: l_awr_rec awr_rec_type;
1226: BEGIN
1227: l_return_status := okl_api.START_ACTIVITY(l_api_name,
1228: G_PKG_NAME,
1229: p_init_msg_list,
1230: l_api_version,
1231: p_api_version,
1230: l_api_version,
1231: p_api_version,
1232: '_PVT',
1233: x_return_status);
1234: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1235: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1236: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1237: RAISE okl_api.G_EXCEPTION_ERROR;
1238: END IF;
1231: p_api_version,
1232: '_PVT',
1233: x_return_status);
1234: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1235: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1236: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1237: RAISE okl_api.G_EXCEPTION_ERROR;
1238: END IF;
1239: --------------------------------------
1232: '_PVT',
1233: x_return_status);
1234: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1235: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1236: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1237: RAISE okl_api.G_EXCEPTION_ERROR;
1238: END IF;
1239: --------------------------------------
1240: -- Move VIEW record to "Child" records
1233: x_return_status);
1234: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1235: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1236: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1237: RAISE okl_api.G_EXCEPTION_ERROR;
1238: END IF;
1239: --------------------------------------
1240: -- Move VIEW record to "Child" records
1241: --------------------------------------
1249: x_msg_count,
1250: x_msg_data,
1251: l_awr_rec
1252: );
1253: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1254: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1255: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
1256: RAISE okl_api.G_EXCEPTION_ERROR;
1257: END IF;
1250: x_msg_data,
1251: l_awr_rec
1252: );
1253: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1254: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1255: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
1256: RAISE okl_api.G_EXCEPTION_ERROR;
1257: END IF;
1258: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1251: l_awr_rec
1252: );
1253: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1254: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1255: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
1256: RAISE okl_api.G_EXCEPTION_ERROR;
1257: END IF;
1258: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1259: EXCEPTION
1252: );
1253: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1254: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1255: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
1256: RAISE okl_api.G_EXCEPTION_ERROR;
1257: END IF;
1258: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1259: EXCEPTION
1260: WHEN okl_api.G_EXCEPTION_ERROR THEN
1254: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1255: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
1256: RAISE okl_api.G_EXCEPTION_ERROR;
1257: END IF;
1258: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1259: EXCEPTION
1260: WHEN okl_api.G_EXCEPTION_ERROR THEN
1261: x_return_status := okl_api.HANDLE_EXCEPTIONS
1262: (
1256: RAISE okl_api.G_EXCEPTION_ERROR;
1257: END IF;
1258: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1259: EXCEPTION
1260: WHEN okl_api.G_EXCEPTION_ERROR THEN
1261: x_return_status := okl_api.HANDLE_EXCEPTIONS
1262: (
1263: l_api_name,
1264: G_PKG_NAME,
1257: END IF;
1258: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1259: EXCEPTION
1260: WHEN okl_api.G_EXCEPTION_ERROR THEN
1261: x_return_status := okl_api.HANDLE_EXCEPTIONS
1262: (
1263: l_api_name,
1264: G_PKG_NAME,
1265: 'okl_api.G_RET_STS_ERROR',
1261: x_return_status := okl_api.HANDLE_EXCEPTIONS
1262: (
1263: l_api_name,
1264: G_PKG_NAME,
1265: 'okl_api.G_RET_STS_ERROR',
1266: x_msg_count,
1267: x_msg_data,
1268: '_PVT'
1269: );
1266: x_msg_count,
1267: x_msg_data,
1268: '_PVT'
1269: );
1270: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1271: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1272: (
1273: l_api_name,
1274: G_PKG_NAME,
1267: x_msg_data,
1268: '_PVT'
1269: );
1270: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1271: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1272: (
1273: l_api_name,
1274: G_PKG_NAME,
1275: 'okl_api.G_RET_STS_UNEXP_ERROR',
1271: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1272: (
1273: l_api_name,
1274: G_PKG_NAME,
1275: 'okl_api.G_RET_STS_UNEXP_ERROR',
1276: x_msg_count,
1277: x_msg_data,
1278: '_PVT'
1279: );
1277: x_msg_data,
1278: '_PVT'
1279: );
1280: WHEN OTHERS THEN
1281: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1282: (
1283: l_api_name,
1284: G_PKG_NAME,
1285: 'OTHERS',
1292: -- PL/SQL TBL lock_row for:AWRV_TBL --
1293: --------------------------------------
1294: PROCEDURE lock_row(
1295: p_api_version IN NUMBER,
1296: p_init_msg_list IN VARCHAR2 DEFAULT okl_api.G_FALSE,
1297: x_return_status OUT NOCOPY VARCHAR2,
1298: x_msg_count OUT NOCOPY NUMBER,
1299: x_msg_data OUT NOCOPY VARCHAR2,
1300: p_awrv_tbl IN awrv_tbl_type) IS
1300: p_awrv_tbl IN awrv_tbl_type) IS
1301:
1302: l_api_version CONSTANT NUMBER := 1;
1303: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_lock_row';
1304: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1305: i NUMBER := 0;
1306: BEGIN
1307: okl_api.init_msg_list(p_init_msg_list);
1308: -- Make sure PL/SQL table has records in it before passing
1303: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_lock_row';
1304: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1305: i NUMBER := 0;
1306: BEGIN
1307: okl_api.init_msg_list(p_init_msg_list);
1308: -- Make sure PL/SQL table has records in it before passing
1309: IF (p_awrv_tbl.COUNT > 0) THEN
1310: i := p_awrv_tbl.FIRST;
1311: LOOP
1310: i := p_awrv_tbl.FIRST;
1311: LOOP
1312: lock_row (
1313: p_api_version => p_api_version,
1314: p_init_msg_list => okl_api.G_FALSE,
1315: x_return_status => x_return_status,
1316: x_msg_count => x_msg_count,
1317: x_msg_data => x_msg_data,
1318: p_awrv_rec => p_awrv_tbl(i));
1320: i := p_awrv_tbl.NEXT(i);
1321: END LOOP;
1322: END IF;
1323: EXCEPTION
1324: WHEN okl_api.G_EXCEPTION_ERROR THEN
1325: x_return_status := okl_api.HANDLE_EXCEPTIONS
1326: (
1327: l_api_name,
1328: G_PKG_NAME,
1321: END LOOP;
1322: END IF;
1323: EXCEPTION
1324: WHEN okl_api.G_EXCEPTION_ERROR THEN
1325: x_return_status := okl_api.HANDLE_EXCEPTIONS
1326: (
1327: l_api_name,
1328: G_PKG_NAME,
1329: 'okl_api.G_RET_STS_ERROR',
1325: x_return_status := okl_api.HANDLE_EXCEPTIONS
1326: (
1327: l_api_name,
1328: G_PKG_NAME,
1329: 'okl_api.G_RET_STS_ERROR',
1330: x_msg_count,
1331: x_msg_data,
1332: '_PVT'
1333: );
1330: x_msg_count,
1331: x_msg_data,
1332: '_PVT'
1333: );
1334: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1335: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1336: (
1337: l_api_name,
1338: G_PKG_NAME,
1331: x_msg_data,
1332: '_PVT'
1333: );
1334: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1335: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1336: (
1337: l_api_name,
1338: G_PKG_NAME,
1339: 'okl_api.G_RET_STS_UNEXP_ERROR',
1335: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1336: (
1337: l_api_name,
1338: G_PKG_NAME,
1339: 'okl_api.G_RET_STS_UNEXP_ERROR',
1340: x_msg_count,
1341: x_msg_data,
1342: '_PVT'
1343: );
1341: x_msg_data,
1342: '_PVT'
1343: );
1344: WHEN OTHERS THEN
1345: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1346: (
1347: l_api_name,
1348: G_PKG_NAME,
1349: 'OTHERS',
1359: --------------------------------
1360: -- update_row for:OKL_ANSWERS --
1361: --------------------------------
1362: PROCEDURE update_row(
1363: p_init_msg_list IN VARCHAR2 DEFAULT okl_api.G_FALSE,
1364: x_return_status OUT NOCOPY VARCHAR2,
1365: x_msg_count OUT NOCOPY NUMBER,
1366: x_msg_data OUT NOCOPY VARCHAR2,
1367: p_awr_rec IN awr_rec_type,
1368: x_awr_rec OUT NOCOPY awr_rec_type) IS
1369:
1370: l_api_version CONSTANT NUMBER := 1;
1371: l_api_name CONSTANT VARCHAR2(30) := 'ANSWERS_update_row';
1372: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1373: l_awr_rec awr_rec_type := p_awr_rec;
1374: l_def_awr_rec awr_rec_type;
1375: l_row_notfound BOOLEAN := TRUE;
1376: ----------------------------------
1381: x_awr_rec OUT NOCOPY awr_rec_type
1382: ) RETURN VARCHAR2 IS
1383: l_awr_rec awr_rec_type;
1384: l_row_notfound BOOLEAN := TRUE;
1385: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1386: BEGIN
1387: x_awr_rec := p_awr_rec;
1388: -- Get current database values
1389: l_awr_rec := get_rec(p_awr_rec, l_row_notfound);
1387: x_awr_rec := p_awr_rec;
1388: -- Get current database values
1389: l_awr_rec := get_rec(p_awr_rec, l_row_notfound);
1390: IF (l_row_notfound) THEN
1391: l_return_status := okl_api.G_RET_STS_UNEXP_ERROR;
1392: END IF;
1393: IF (x_awr_rec.id = okl_api.G_MISS_NUM)
1394: THEN
1395: x_awr_rec.id := l_awr_rec.id;
1389: l_awr_rec := get_rec(p_awr_rec, l_row_notfound);
1390: IF (l_row_notfound) THEN
1391: l_return_status := okl_api.G_RET_STS_UNEXP_ERROR;
1392: END IF;
1393: IF (x_awr_rec.id = okl_api.G_MISS_NUM)
1394: THEN
1395: x_awr_rec.id := l_awr_rec.id;
1396: END IF;
1397: IF (x_awr_rec.ant_id = okl_api.G_MISS_NUM)
1393: IF (x_awr_rec.id = okl_api.G_MISS_NUM)
1394: THEN
1395: x_awr_rec.id := l_awr_rec.id;
1396: END IF;
1397: IF (x_awr_rec.ant_id = okl_api.G_MISS_NUM)
1398: THEN
1399: x_awr_rec.ant_id := l_awr_rec.ant_id;
1400: END IF;
1401: IF (x_awr_rec.rul_id = okl_api.G_MISS_NUM)
1397: IF (x_awr_rec.ant_id = okl_api.G_MISS_NUM)
1398: THEN
1399: x_awr_rec.ant_id := l_awr_rec.ant_id;
1400: END IF;
1401: IF (x_awr_rec.rul_id = okl_api.G_MISS_NUM)
1402: THEN
1403: x_awr_rec.rul_id := l_awr_rec.rul_id;
1404: END IF;
1405: IF (x_awr_rec.sort_sequence = okl_api.G_MISS_NUM)
1401: IF (x_awr_rec.rul_id = okl_api.G_MISS_NUM)
1402: THEN
1403: x_awr_rec.rul_id := l_awr_rec.rul_id;
1404: END IF;
1405: IF (x_awr_rec.sort_sequence = okl_api.G_MISS_NUM)
1406: THEN
1407: x_awr_rec.sort_sequence := l_awr_rec.sort_sequence;
1408: END IF;
1409: IF (x_awr_rec.object_version_number = okl_api.G_MISS_NUM)
1405: IF (x_awr_rec.sort_sequence = okl_api.G_MISS_NUM)
1406: THEN
1407: x_awr_rec.sort_sequence := l_awr_rec.sort_sequence;
1408: END IF;
1409: IF (x_awr_rec.object_version_number = okl_api.G_MISS_NUM)
1410: THEN
1411: x_awr_rec.object_version_number := l_awr_rec.object_version_number;
1412: END IF;
1413: IF (x_awr_rec.attribute_category = okl_api.G_MISS_CHAR)
1409: IF (x_awr_rec.object_version_number = okl_api.G_MISS_NUM)
1410: THEN
1411: x_awr_rec.object_version_number := l_awr_rec.object_version_number;
1412: END IF;
1413: IF (x_awr_rec.attribute_category = okl_api.G_MISS_CHAR)
1414: THEN
1415: x_awr_rec.attribute_category := l_awr_rec.attribute_category;
1416: END IF;
1417: IF (x_awr_rec.attribute1 = okl_api.G_MISS_CHAR)
1413: IF (x_awr_rec.attribute_category = okl_api.G_MISS_CHAR)
1414: THEN
1415: x_awr_rec.attribute_category := l_awr_rec.attribute_category;
1416: END IF;
1417: IF (x_awr_rec.attribute1 = okl_api.G_MISS_CHAR)
1418: THEN
1419: x_awr_rec.attribute1 := l_awr_rec.attribute1;
1420: END IF;
1421: IF (x_awr_rec.attribute2 = okl_api.G_MISS_CHAR)
1417: IF (x_awr_rec.attribute1 = okl_api.G_MISS_CHAR)
1418: THEN
1419: x_awr_rec.attribute1 := l_awr_rec.attribute1;
1420: END IF;
1421: IF (x_awr_rec.attribute2 = okl_api.G_MISS_CHAR)
1422: THEN
1423: x_awr_rec.attribute2 := l_awr_rec.attribute2;
1424: END IF;
1425: IF (x_awr_rec.attribute3 = okl_api.G_MISS_CHAR)
1421: IF (x_awr_rec.attribute2 = okl_api.G_MISS_CHAR)
1422: THEN
1423: x_awr_rec.attribute2 := l_awr_rec.attribute2;
1424: END IF;
1425: IF (x_awr_rec.attribute3 = okl_api.G_MISS_CHAR)
1426: THEN
1427: x_awr_rec.attribute3 := l_awr_rec.attribute3;
1428: END IF;
1429: IF (x_awr_rec.attribute4 = okl_api.G_MISS_CHAR)
1425: IF (x_awr_rec.attribute3 = okl_api.G_MISS_CHAR)
1426: THEN
1427: x_awr_rec.attribute3 := l_awr_rec.attribute3;
1428: END IF;
1429: IF (x_awr_rec.attribute4 = okl_api.G_MISS_CHAR)
1430: THEN
1431: x_awr_rec.attribute4 := l_awr_rec.attribute4;
1432: END IF;
1433: IF (x_awr_rec.attribute5 = okl_api.G_MISS_CHAR)
1429: IF (x_awr_rec.attribute4 = okl_api.G_MISS_CHAR)
1430: THEN
1431: x_awr_rec.attribute4 := l_awr_rec.attribute4;
1432: END IF;
1433: IF (x_awr_rec.attribute5 = okl_api.G_MISS_CHAR)
1434: THEN
1435: x_awr_rec.attribute5 := l_awr_rec.attribute5;
1436: END IF;
1437: IF (x_awr_rec.attribute6 = okl_api.G_MISS_CHAR)
1433: IF (x_awr_rec.attribute5 = okl_api.G_MISS_CHAR)
1434: THEN
1435: x_awr_rec.attribute5 := l_awr_rec.attribute5;
1436: END IF;
1437: IF (x_awr_rec.attribute6 = okl_api.G_MISS_CHAR)
1438: THEN
1439: x_awr_rec.attribute6 := l_awr_rec.attribute6;
1440: END IF;
1441: IF (x_awr_rec.attribute7 = okl_api.G_MISS_CHAR)
1437: IF (x_awr_rec.attribute6 = okl_api.G_MISS_CHAR)
1438: THEN
1439: x_awr_rec.attribute6 := l_awr_rec.attribute6;
1440: END IF;
1441: IF (x_awr_rec.attribute7 = okl_api.G_MISS_CHAR)
1442: THEN
1443: x_awr_rec.attribute7 := l_awr_rec.attribute7;
1444: END IF;
1445: IF (x_awr_rec.attribute8 = okl_api.G_MISS_CHAR)
1441: IF (x_awr_rec.attribute7 = okl_api.G_MISS_CHAR)
1442: THEN
1443: x_awr_rec.attribute7 := l_awr_rec.attribute7;
1444: END IF;
1445: IF (x_awr_rec.attribute8 = okl_api.G_MISS_CHAR)
1446: THEN
1447: x_awr_rec.attribute8 := l_awr_rec.attribute8;
1448: END IF;
1449: IF (x_awr_rec.attribute9 = okl_api.G_MISS_CHAR)
1445: IF (x_awr_rec.attribute8 = okl_api.G_MISS_CHAR)
1446: THEN
1447: x_awr_rec.attribute8 := l_awr_rec.attribute8;
1448: END IF;
1449: IF (x_awr_rec.attribute9 = okl_api.G_MISS_CHAR)
1450: THEN
1451: x_awr_rec.attribute9 := l_awr_rec.attribute9;
1452: END IF;
1453: IF (x_awr_rec.attribute10 = okl_api.G_MISS_CHAR)
1449: IF (x_awr_rec.attribute9 = okl_api.G_MISS_CHAR)
1450: THEN
1451: x_awr_rec.attribute9 := l_awr_rec.attribute9;
1452: END IF;
1453: IF (x_awr_rec.attribute10 = okl_api.G_MISS_CHAR)
1454: THEN
1455: x_awr_rec.attribute10 := l_awr_rec.attribute10;
1456: END IF;
1457: IF (x_awr_rec.attribute11 = okl_api.G_MISS_CHAR)
1453: IF (x_awr_rec.attribute10 = okl_api.G_MISS_CHAR)
1454: THEN
1455: x_awr_rec.attribute10 := l_awr_rec.attribute10;
1456: END IF;
1457: IF (x_awr_rec.attribute11 = okl_api.G_MISS_CHAR)
1458: THEN
1459: x_awr_rec.attribute11 := l_awr_rec.attribute11;
1460: END IF;
1461: IF (x_awr_rec.attribute12 = okl_api.G_MISS_CHAR)
1457: IF (x_awr_rec.attribute11 = okl_api.G_MISS_CHAR)
1458: THEN
1459: x_awr_rec.attribute11 := l_awr_rec.attribute11;
1460: END IF;
1461: IF (x_awr_rec.attribute12 = okl_api.G_MISS_CHAR)
1462: THEN
1463: x_awr_rec.attribute12 := l_awr_rec.attribute12;
1464: END IF;
1465: IF (x_awr_rec.attribute13 = okl_api.G_MISS_CHAR)
1461: IF (x_awr_rec.attribute12 = okl_api.G_MISS_CHAR)
1462: THEN
1463: x_awr_rec.attribute12 := l_awr_rec.attribute12;
1464: END IF;
1465: IF (x_awr_rec.attribute13 = okl_api.G_MISS_CHAR)
1466: THEN
1467: x_awr_rec.attribute13 := l_awr_rec.attribute13;
1468: END IF;
1469: IF (x_awr_rec.attribute14 = okl_api.G_MISS_CHAR)
1465: IF (x_awr_rec.attribute13 = okl_api.G_MISS_CHAR)
1466: THEN
1467: x_awr_rec.attribute13 := l_awr_rec.attribute13;
1468: END IF;
1469: IF (x_awr_rec.attribute14 = okl_api.G_MISS_CHAR)
1470: THEN
1471: x_awr_rec.attribute14 := l_awr_rec.attribute14;
1472: END IF;
1473: IF (x_awr_rec.attribute15 = okl_api.G_MISS_CHAR)
1469: IF (x_awr_rec.attribute14 = okl_api.G_MISS_CHAR)
1470: THEN
1471: x_awr_rec.attribute14 := l_awr_rec.attribute14;
1472: END IF;
1473: IF (x_awr_rec.attribute15 = okl_api.G_MISS_CHAR)
1474: THEN
1475: x_awr_rec.attribute15 := l_awr_rec.attribute15;
1476: END IF;
1477: IF (x_awr_rec.created_by = okl_api.G_MISS_NUM)
1473: IF (x_awr_rec.attribute15 = okl_api.G_MISS_CHAR)
1474: THEN
1475: x_awr_rec.attribute15 := l_awr_rec.attribute15;
1476: END IF;
1477: IF (x_awr_rec.created_by = okl_api.G_MISS_NUM)
1478: THEN
1479: x_awr_rec.created_by := l_awr_rec.created_by;
1480: END IF;
1481: IF (x_awr_rec.creation_date = okl_api.G_MISS_DATE)
1477: IF (x_awr_rec.created_by = okl_api.G_MISS_NUM)
1478: THEN
1479: x_awr_rec.created_by := l_awr_rec.created_by;
1480: END IF;
1481: IF (x_awr_rec.creation_date = okl_api.G_MISS_DATE)
1482: THEN
1483: x_awr_rec.creation_date := l_awr_rec.creation_date;
1484: END IF;
1485: IF (x_awr_rec.last_updated_by = okl_api.G_MISS_NUM)
1481: IF (x_awr_rec.creation_date = okl_api.G_MISS_DATE)
1482: THEN
1483: x_awr_rec.creation_date := l_awr_rec.creation_date;
1484: END IF;
1485: IF (x_awr_rec.last_updated_by = okl_api.G_MISS_NUM)
1486: THEN
1487: x_awr_rec.last_updated_by := l_awr_rec.last_updated_by;
1488: END IF;
1489: IF (x_awr_rec.last_update_date = okl_api.G_MISS_DATE)
1485: IF (x_awr_rec.last_updated_by = okl_api.G_MISS_NUM)
1486: THEN
1487: x_awr_rec.last_updated_by := l_awr_rec.last_updated_by;
1488: END IF;
1489: IF (x_awr_rec.last_update_date = okl_api.G_MISS_DATE)
1490: THEN
1491: x_awr_rec.last_update_date := l_awr_rec.last_update_date;
1492: END IF;
1493: IF (x_awr_rec.last_update_login = okl_api.G_MISS_NUM)
1489: IF (x_awr_rec.last_update_date = okl_api.G_MISS_DATE)
1490: THEN
1491: x_awr_rec.last_update_date := l_awr_rec.last_update_date;
1492: END IF;
1493: IF (x_awr_rec.last_update_login = okl_api.G_MISS_NUM)
1494: THEN
1495: x_awr_rec.last_update_login := l_awr_rec.last_update_login;
1496: END IF;
1497: RETURN(l_return_status);
1502: FUNCTION Set_Attributes (
1503: p_awr_rec IN awr_rec_type,
1504: x_awr_rec OUT NOCOPY awr_rec_type
1505: ) RETURN VARCHAR2 IS
1506: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1507: BEGIN
1508: x_awr_rec := p_awr_rec;
1509: RETURN(l_return_status);
1510: END Set_Attributes;
1508: x_awr_rec := p_awr_rec;
1509: RETURN(l_return_status);
1510: END Set_Attributes;
1511: BEGIN
1512: l_return_status := okl_api.START_ACTIVITY(l_api_name,
1513: p_init_msg_list,
1514: '_PVT',
1515: x_return_status);
1516: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1512: l_return_status := okl_api.START_ACTIVITY(l_api_name,
1513: p_init_msg_list,
1514: '_PVT',
1515: x_return_status);
1516: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1517: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1518: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1519: RAISE okl_api.G_EXCEPTION_ERROR;
1520: END IF;
1513: p_init_msg_list,
1514: '_PVT',
1515: x_return_status);
1516: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1517: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1518: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1519: RAISE okl_api.G_EXCEPTION_ERROR;
1520: END IF;
1521: --- Setting item attributes
1514: '_PVT',
1515: x_return_status);
1516: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1517: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1518: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1519: RAISE okl_api.G_EXCEPTION_ERROR;
1520: END IF;
1521: --- Setting item attributes
1522: l_return_status := Set_Attributes(
1515: x_return_status);
1516: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1517: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1518: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1519: RAISE okl_api.G_EXCEPTION_ERROR;
1520: END IF;
1521: --- Setting item attributes
1522: l_return_status := Set_Attributes(
1523: p_awr_rec, -- IN
1522: l_return_status := Set_Attributes(
1523: p_awr_rec, -- IN
1524: l_awr_rec); -- OUT
1525: --- If any errors happen abort API
1526: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1527: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1528: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1529: RAISE okl_api.G_EXCEPTION_ERROR;
1530: END IF;
1523: p_awr_rec, -- IN
1524: l_awr_rec); -- OUT
1525: --- If any errors happen abort API
1526: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1527: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1528: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1529: RAISE okl_api.G_EXCEPTION_ERROR;
1530: END IF;
1531: l_return_status := populate_new_record(l_awr_rec, l_def_awr_rec);
1524: l_awr_rec); -- OUT
1525: --- If any errors happen abort API
1526: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1527: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1528: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1529: RAISE okl_api.G_EXCEPTION_ERROR;
1530: END IF;
1531: l_return_status := populate_new_record(l_awr_rec, l_def_awr_rec);
1532: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1525: --- If any errors happen abort API
1526: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1527: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1528: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1529: RAISE okl_api.G_EXCEPTION_ERROR;
1530: END IF;
1531: l_return_status := populate_new_record(l_awr_rec, l_def_awr_rec);
1532: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1533: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1528: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1529: RAISE okl_api.G_EXCEPTION_ERROR;
1530: END IF;
1531: l_return_status := populate_new_record(l_awr_rec, l_def_awr_rec);
1532: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1533: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1534: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1535: RAISE okl_api.G_EXCEPTION_ERROR;
1536: END IF;
1529: RAISE okl_api.G_EXCEPTION_ERROR;
1530: END IF;
1531: l_return_status := populate_new_record(l_awr_rec, l_def_awr_rec);
1532: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1533: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1534: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1535: RAISE okl_api.G_EXCEPTION_ERROR;
1536: END IF;
1537: UPDATE OKL_ANSWERS
1530: END IF;
1531: l_return_status := populate_new_record(l_awr_rec, l_def_awr_rec);
1532: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1533: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1534: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1535: RAISE okl_api.G_EXCEPTION_ERROR;
1536: END IF;
1537: UPDATE OKL_ANSWERS
1538: SET ANT_ID = l_def_awr_rec.ant_id,
1531: l_return_status := populate_new_record(l_awr_rec, l_def_awr_rec);
1532: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1533: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1534: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1535: RAISE okl_api.G_EXCEPTION_ERROR;
1536: END IF;
1537: UPDATE OKL_ANSWERS
1538: SET ANT_ID = l_def_awr_rec.ant_id,
1539: RUL_ID = l_def_awr_rec.rul_id,
1562: LAST_UPDATE_LOGIN = l_def_awr_rec.last_update_login
1563: WHERE ID = l_def_awr_rec.id;
1564:
1565: x_awr_rec := l_def_awr_rec;
1566: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1567: EXCEPTION
1568: WHEN okl_api.G_EXCEPTION_ERROR THEN
1569: x_return_status := okl_api.HANDLE_EXCEPTIONS
1570: (
1564:
1565: x_awr_rec := l_def_awr_rec;
1566: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1567: EXCEPTION
1568: WHEN okl_api.G_EXCEPTION_ERROR THEN
1569: x_return_status := okl_api.HANDLE_EXCEPTIONS
1570: (
1571: l_api_name,
1572: G_PKG_NAME,
1565: x_awr_rec := l_def_awr_rec;
1566: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1567: EXCEPTION
1568: WHEN okl_api.G_EXCEPTION_ERROR THEN
1569: x_return_status := okl_api.HANDLE_EXCEPTIONS
1570: (
1571: l_api_name,
1572: G_PKG_NAME,
1573: 'okl_api.G_RET_STS_ERROR',
1569: x_return_status := okl_api.HANDLE_EXCEPTIONS
1570: (
1571: l_api_name,
1572: G_PKG_NAME,
1573: 'okl_api.G_RET_STS_ERROR',
1574: x_msg_count,
1575: x_msg_data,
1576: '_PVT'
1577: );
1574: x_msg_count,
1575: x_msg_data,
1576: '_PVT'
1577: );
1578: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1579: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1580: (
1581: l_api_name,
1582: G_PKG_NAME,
1575: x_msg_data,
1576: '_PVT'
1577: );
1578: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1579: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1580: (
1581: l_api_name,
1582: G_PKG_NAME,
1583: 'okl_api.G_RET_STS_UNEXP_ERROR',
1579: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1580: (
1581: l_api_name,
1582: G_PKG_NAME,
1583: 'okl_api.G_RET_STS_UNEXP_ERROR',
1584: x_msg_count,
1585: x_msg_data,
1586: '_PVT'
1587: );
1585: x_msg_data,
1586: '_PVT'
1587: );
1588: WHEN OTHERS THEN
1589: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1590: (
1591: l_api_name,
1592: G_PKG_NAME,
1593: 'OTHERS',
1600: -- update_row for:OKL_ANSWERS_V --
1601: ----------------------------------
1602: PROCEDURE update_row(
1603: p_api_version IN NUMBER,
1604: p_init_msg_list IN VARCHAR2 DEFAULT okl_api.G_FALSE,
1605: x_return_status OUT NOCOPY VARCHAR2,
1606: x_msg_count OUT NOCOPY NUMBER,
1607: x_msg_data OUT NOCOPY VARCHAR2,
1608: p_awrv_rec IN awrv_rec_type,
1609: x_awrv_rec OUT NOCOPY awrv_rec_type) IS
1610:
1611: l_api_version CONSTANT NUMBER := 1;
1612: l_api_name CONSTANT VARCHAR2(30) := 'V_update_row';
1613: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1614: l_awrv_rec awrv_rec_type := p_awrv_rec;
1615: l_def_awrv_rec awrv_rec_type;
1616: l_awr_rec awr_rec_type;
1617: lx_awr_rec awr_rec_type;
1636: x_awrv_rec OUT NOCOPY awrv_rec_type
1637: ) RETURN VARCHAR2 IS
1638: l_awrv_rec awrv_rec_type;
1639: l_row_notfound BOOLEAN := TRUE;
1640: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1641: BEGIN
1642: x_awrv_rec := p_awrv_rec;
1643: -- Get current database values
1644: l_awrv_rec := get_rec(p_awrv_rec, l_row_notfound);
1642: x_awrv_rec := p_awrv_rec;
1643: -- Get current database values
1644: l_awrv_rec := get_rec(p_awrv_rec, l_row_notfound);
1645: IF (l_row_notfound) THEN
1646: l_return_status := okl_api.G_RET_STS_UNEXP_ERROR;
1647: END IF;
1648: IF (x_awrv_rec.id = okl_api.G_MISS_NUM)
1649: THEN
1650: x_awrv_rec.id := l_awrv_rec.id;
1644: l_awrv_rec := get_rec(p_awrv_rec, l_row_notfound);
1645: IF (l_row_notfound) THEN
1646: l_return_status := okl_api.G_RET_STS_UNEXP_ERROR;
1647: END IF;
1648: IF (x_awrv_rec.id = okl_api.G_MISS_NUM)
1649: THEN
1650: x_awrv_rec.id := l_awrv_rec.id;
1651: END IF;
1652: IF (x_awrv_rec.object_version_number = okl_api.G_MISS_NUM)
1648: IF (x_awrv_rec.id = okl_api.G_MISS_NUM)
1649: THEN
1650: x_awrv_rec.id := l_awrv_rec.id;
1651: END IF;
1652: IF (x_awrv_rec.object_version_number = okl_api.G_MISS_NUM)
1653: THEN
1654: x_awrv_rec.object_version_number := l_awrv_rec.object_version_number;
1655: END IF;
1656: IF (x_awrv_rec.ant_id = okl_api.G_MISS_NUM)
1652: IF (x_awrv_rec.object_version_number = okl_api.G_MISS_NUM)
1653: THEN
1654: x_awrv_rec.object_version_number := l_awrv_rec.object_version_number;
1655: END IF;
1656: IF (x_awrv_rec.ant_id = okl_api.G_MISS_NUM)
1657: THEN
1658: x_awrv_rec.ant_id := l_awrv_rec.ant_id;
1659: END IF;
1660: IF (x_awrv_rec.rul_id = okl_api.G_MISS_NUM)
1656: IF (x_awrv_rec.ant_id = okl_api.G_MISS_NUM)
1657: THEN
1658: x_awrv_rec.ant_id := l_awrv_rec.ant_id;
1659: END IF;
1660: IF (x_awrv_rec.rul_id = okl_api.G_MISS_NUM)
1661: THEN
1662: x_awrv_rec.rul_id := l_awrv_rec.rul_id;
1663: END IF;
1664: IF (x_awrv_rec.sort_sequence = okl_api.G_MISS_NUM)
1660: IF (x_awrv_rec.rul_id = okl_api.G_MISS_NUM)
1661: THEN
1662: x_awrv_rec.rul_id := l_awrv_rec.rul_id;
1663: END IF;
1664: IF (x_awrv_rec.sort_sequence = okl_api.G_MISS_NUM)
1665: THEN
1666: x_awrv_rec.sort_sequence := l_awrv_rec.sort_sequence;
1667: END IF;
1668: IF (x_awrv_rec.attribute_category = okl_api.G_MISS_CHAR)
1664: IF (x_awrv_rec.sort_sequence = okl_api.G_MISS_NUM)
1665: THEN
1666: x_awrv_rec.sort_sequence := l_awrv_rec.sort_sequence;
1667: END IF;
1668: IF (x_awrv_rec.attribute_category = okl_api.G_MISS_CHAR)
1669: THEN
1670: x_awrv_rec.attribute_category := l_awrv_rec.attribute_category;
1671: END IF;
1672: IF (x_awrv_rec.attribute1 = okl_api.G_MISS_CHAR)
1668: IF (x_awrv_rec.attribute_category = okl_api.G_MISS_CHAR)
1669: THEN
1670: x_awrv_rec.attribute_category := l_awrv_rec.attribute_category;
1671: END IF;
1672: IF (x_awrv_rec.attribute1 = okl_api.G_MISS_CHAR)
1673: THEN
1674: x_awrv_rec.attribute1 := l_awrv_rec.attribute1;
1675: END IF;
1676: IF (x_awrv_rec.attribute2 = okl_api.G_MISS_CHAR)
1672: IF (x_awrv_rec.attribute1 = okl_api.G_MISS_CHAR)
1673: THEN
1674: x_awrv_rec.attribute1 := l_awrv_rec.attribute1;
1675: END IF;
1676: IF (x_awrv_rec.attribute2 = okl_api.G_MISS_CHAR)
1677: THEN
1678: x_awrv_rec.attribute2 := l_awrv_rec.attribute2;
1679: END IF;
1680: IF (x_awrv_rec.attribute3 = okl_api.G_MISS_CHAR)
1676: IF (x_awrv_rec.attribute2 = okl_api.G_MISS_CHAR)
1677: THEN
1678: x_awrv_rec.attribute2 := l_awrv_rec.attribute2;
1679: END IF;
1680: IF (x_awrv_rec.attribute3 = okl_api.G_MISS_CHAR)
1681: THEN
1682: x_awrv_rec.attribute3 := l_awrv_rec.attribute3;
1683: END IF;
1684: IF (x_awrv_rec.attribute4 = okl_api.G_MISS_CHAR)
1680: IF (x_awrv_rec.attribute3 = okl_api.G_MISS_CHAR)
1681: THEN
1682: x_awrv_rec.attribute3 := l_awrv_rec.attribute3;
1683: END IF;
1684: IF (x_awrv_rec.attribute4 = okl_api.G_MISS_CHAR)
1685: THEN
1686: x_awrv_rec.attribute4 := l_awrv_rec.attribute4;
1687: END IF;
1688: IF (x_awrv_rec.attribute5 = okl_api.G_MISS_CHAR)
1684: IF (x_awrv_rec.attribute4 = okl_api.G_MISS_CHAR)
1685: THEN
1686: x_awrv_rec.attribute4 := l_awrv_rec.attribute4;
1687: END IF;
1688: IF (x_awrv_rec.attribute5 = okl_api.G_MISS_CHAR)
1689: THEN
1690: x_awrv_rec.attribute5 := l_awrv_rec.attribute5;
1691: END IF;
1692: IF (x_awrv_rec.attribute6 = okl_api.G_MISS_CHAR)
1688: IF (x_awrv_rec.attribute5 = okl_api.G_MISS_CHAR)
1689: THEN
1690: x_awrv_rec.attribute5 := l_awrv_rec.attribute5;
1691: END IF;
1692: IF (x_awrv_rec.attribute6 = okl_api.G_MISS_CHAR)
1693: THEN
1694: x_awrv_rec.attribute6 := l_awrv_rec.attribute6;
1695: END IF;
1696: IF (x_awrv_rec.attribute7 = okl_api.G_MISS_CHAR)
1692: IF (x_awrv_rec.attribute6 = okl_api.G_MISS_CHAR)
1693: THEN
1694: x_awrv_rec.attribute6 := l_awrv_rec.attribute6;
1695: END IF;
1696: IF (x_awrv_rec.attribute7 = okl_api.G_MISS_CHAR)
1697: THEN
1698: x_awrv_rec.attribute7 := l_awrv_rec.attribute7;
1699: END IF;
1700: IF (x_awrv_rec.attribute8 = okl_api.G_MISS_CHAR)
1696: IF (x_awrv_rec.attribute7 = okl_api.G_MISS_CHAR)
1697: THEN
1698: x_awrv_rec.attribute7 := l_awrv_rec.attribute7;
1699: END IF;
1700: IF (x_awrv_rec.attribute8 = okl_api.G_MISS_CHAR)
1701: THEN
1702: x_awrv_rec.attribute8 := l_awrv_rec.attribute8;
1703: END IF;
1704: IF (x_awrv_rec.attribute9 = okl_api.G_MISS_CHAR)
1700: IF (x_awrv_rec.attribute8 = okl_api.G_MISS_CHAR)
1701: THEN
1702: x_awrv_rec.attribute8 := l_awrv_rec.attribute8;
1703: END IF;
1704: IF (x_awrv_rec.attribute9 = okl_api.G_MISS_CHAR)
1705: THEN
1706: x_awrv_rec.attribute9 := l_awrv_rec.attribute9;
1707: END IF;
1708: IF (x_awrv_rec.attribute10 = okl_api.G_MISS_CHAR)
1704: IF (x_awrv_rec.attribute9 = okl_api.G_MISS_CHAR)
1705: THEN
1706: x_awrv_rec.attribute9 := l_awrv_rec.attribute9;
1707: END IF;
1708: IF (x_awrv_rec.attribute10 = okl_api.G_MISS_CHAR)
1709: THEN
1710: x_awrv_rec.attribute10 := l_awrv_rec.attribute10;
1711: END IF;
1712: IF (x_awrv_rec.attribute11 = okl_api.G_MISS_CHAR)
1708: IF (x_awrv_rec.attribute10 = okl_api.G_MISS_CHAR)
1709: THEN
1710: x_awrv_rec.attribute10 := l_awrv_rec.attribute10;
1711: END IF;
1712: IF (x_awrv_rec.attribute11 = okl_api.G_MISS_CHAR)
1713: THEN
1714: x_awrv_rec.attribute11 := l_awrv_rec.attribute11;
1715: END IF;
1716: IF (x_awrv_rec.attribute12 = okl_api.G_MISS_CHAR)
1712: IF (x_awrv_rec.attribute11 = okl_api.G_MISS_CHAR)
1713: THEN
1714: x_awrv_rec.attribute11 := l_awrv_rec.attribute11;
1715: END IF;
1716: IF (x_awrv_rec.attribute12 = okl_api.G_MISS_CHAR)
1717: THEN
1718: x_awrv_rec.attribute12 := l_awrv_rec.attribute12;
1719: END IF;
1720: IF (x_awrv_rec.attribute13 = okl_api.G_MISS_CHAR)
1716: IF (x_awrv_rec.attribute12 = okl_api.G_MISS_CHAR)
1717: THEN
1718: x_awrv_rec.attribute12 := l_awrv_rec.attribute12;
1719: END IF;
1720: IF (x_awrv_rec.attribute13 = okl_api.G_MISS_CHAR)
1721: THEN
1722: x_awrv_rec.attribute13 := l_awrv_rec.attribute13;
1723: END IF;
1724: IF (x_awrv_rec.attribute14 = okl_api.G_MISS_CHAR)
1720: IF (x_awrv_rec.attribute13 = okl_api.G_MISS_CHAR)
1721: THEN
1722: x_awrv_rec.attribute13 := l_awrv_rec.attribute13;
1723: END IF;
1724: IF (x_awrv_rec.attribute14 = okl_api.G_MISS_CHAR)
1725: THEN
1726: x_awrv_rec.attribute14 := l_awrv_rec.attribute14;
1727: END IF;
1728: IF (x_awrv_rec.attribute15 = okl_api.G_MISS_CHAR)
1724: IF (x_awrv_rec.attribute14 = okl_api.G_MISS_CHAR)
1725: THEN
1726: x_awrv_rec.attribute14 := l_awrv_rec.attribute14;
1727: END IF;
1728: IF (x_awrv_rec.attribute15 = okl_api.G_MISS_CHAR)
1729: THEN
1730: x_awrv_rec.attribute15 := l_awrv_rec.attribute15;
1731: END IF;
1732: IF (x_awrv_rec.created_by = okl_api.G_MISS_NUM)
1728: IF (x_awrv_rec.attribute15 = okl_api.G_MISS_CHAR)
1729: THEN
1730: x_awrv_rec.attribute15 := l_awrv_rec.attribute15;
1731: END IF;
1732: IF (x_awrv_rec.created_by = okl_api.G_MISS_NUM)
1733: THEN
1734: x_awrv_rec.created_by := l_awrv_rec.created_by;
1735: END IF;
1736: IF (x_awrv_rec.creation_date = okl_api.G_MISS_DATE)
1732: IF (x_awrv_rec.created_by = okl_api.G_MISS_NUM)
1733: THEN
1734: x_awrv_rec.created_by := l_awrv_rec.created_by;
1735: END IF;
1736: IF (x_awrv_rec.creation_date = okl_api.G_MISS_DATE)
1737: THEN
1738: x_awrv_rec.creation_date := l_awrv_rec.creation_date;
1739: END IF;
1740: IF (x_awrv_rec.last_updated_by = okl_api.G_MISS_NUM)
1736: IF (x_awrv_rec.creation_date = okl_api.G_MISS_DATE)
1737: THEN
1738: x_awrv_rec.creation_date := l_awrv_rec.creation_date;
1739: END IF;
1740: IF (x_awrv_rec.last_updated_by = okl_api.G_MISS_NUM)
1741: THEN
1742: x_awrv_rec.last_updated_by := l_awrv_rec.last_updated_by;
1743: END IF;
1744: IF (x_awrv_rec.last_update_date = okl_api.G_MISS_DATE)
1740: IF (x_awrv_rec.last_updated_by = okl_api.G_MISS_NUM)
1741: THEN
1742: x_awrv_rec.last_updated_by := l_awrv_rec.last_updated_by;
1743: END IF;
1744: IF (x_awrv_rec.last_update_date = okl_api.G_MISS_DATE)
1745: THEN
1746: x_awrv_rec.last_update_date := l_awrv_rec.last_update_date;
1747: END IF;
1748: IF (x_awrv_rec.last_update_login = okl_api.G_MISS_NUM)
1744: IF (x_awrv_rec.last_update_date = okl_api.G_MISS_DATE)
1745: THEN
1746: x_awrv_rec.last_update_date := l_awrv_rec.last_update_date;
1747: END IF;
1748: IF (x_awrv_rec.last_update_login = okl_api.G_MISS_NUM)
1749: THEN
1750: x_awrv_rec.last_update_login := l_awrv_rec.last_update_login;
1751: END IF;
1752: RETURN(l_return_status);
1757: FUNCTION Set_Attributes (
1758: p_awrv_rec IN awrv_rec_type,
1759: x_awrv_rec OUT NOCOPY awrv_rec_type
1760: ) RETURN VARCHAR2 IS
1761: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1762: BEGIN
1763: x_awrv_rec := p_awrv_rec;
1764: x_awrv_rec.OBJECT_VERSION_NUMBER := NVL(x_awrv_rec.OBJECT_VERSION_NUMBER, 0) + 1;
1765: RETURN(l_return_status);
1764: x_awrv_rec.OBJECT_VERSION_NUMBER := NVL(x_awrv_rec.OBJECT_VERSION_NUMBER, 0) + 1;
1765: RETURN(l_return_status);
1766: END Set_Attributes;
1767: BEGIN
1768: l_return_status := okl_api.START_ACTIVITY(l_api_name,
1769: G_PKG_NAME,
1770: p_init_msg_list,
1771: l_api_version,
1772: p_api_version,
1771: l_api_version,
1772: p_api_version,
1773: '_PVT',
1774: x_return_status);
1775: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1776: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1777: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1778: RAISE okl_api.G_EXCEPTION_ERROR;
1779: END IF;
1772: p_api_version,
1773: '_PVT',
1774: x_return_status);
1775: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1776: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1777: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1778: RAISE okl_api.G_EXCEPTION_ERROR;
1779: END IF;
1780: --- Setting item attributes
1773: '_PVT',
1774: x_return_status);
1775: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1776: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1777: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1778: RAISE okl_api.G_EXCEPTION_ERROR;
1779: END IF;
1780: --- Setting item attributes
1781: l_return_status := Set_Attributes(
1774: x_return_status);
1775: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1776: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1777: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1778: RAISE okl_api.G_EXCEPTION_ERROR;
1779: END IF;
1780: --- Setting item attributes
1781: l_return_status := Set_Attributes(
1782: p_awrv_rec, -- IN
1781: l_return_status := Set_Attributes(
1782: p_awrv_rec, -- IN
1783: l_awrv_rec); -- OUT
1784: --- If any errors happen abort API
1785: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1786: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1787: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1788: RAISE okl_api.G_EXCEPTION_ERROR;
1789: END IF;
1782: p_awrv_rec, -- IN
1783: l_awrv_rec); -- OUT
1784: --- If any errors happen abort API
1785: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1786: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1787: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1788: RAISE okl_api.G_EXCEPTION_ERROR;
1789: END IF;
1790: l_return_status := populate_new_record(l_awrv_rec, l_def_awrv_rec);
1783: l_awrv_rec); -- OUT
1784: --- If any errors happen abort API
1785: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1786: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1787: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1788: RAISE okl_api.G_EXCEPTION_ERROR;
1789: END IF;
1790: l_return_status := populate_new_record(l_awrv_rec, l_def_awrv_rec);
1791: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1784: --- If any errors happen abort API
1785: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1786: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1787: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1788: RAISE okl_api.G_EXCEPTION_ERROR;
1789: END IF;
1790: l_return_status := populate_new_record(l_awrv_rec, l_def_awrv_rec);
1791: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1792: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1787: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1788: RAISE okl_api.G_EXCEPTION_ERROR;
1789: END IF;
1790: l_return_status := populate_new_record(l_awrv_rec, l_def_awrv_rec);
1791: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1792: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1793: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1794: RAISE okl_api.G_EXCEPTION_ERROR;
1795: END IF;
1788: RAISE okl_api.G_EXCEPTION_ERROR;
1789: END IF;
1790: l_return_status := populate_new_record(l_awrv_rec, l_def_awrv_rec);
1791: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1792: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1793: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1794: RAISE okl_api.G_EXCEPTION_ERROR;
1795: END IF;
1796: l_def_awrv_rec := fill_who_columns(l_def_awrv_rec);
1789: END IF;
1790: l_return_status := populate_new_record(l_awrv_rec, l_def_awrv_rec);
1791: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1792: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1793: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1794: RAISE okl_api.G_EXCEPTION_ERROR;
1795: END IF;
1796: l_def_awrv_rec := fill_who_columns(l_def_awrv_rec);
1797: --- Validate all non-missing attributes (Item Level Validation)
1790: l_return_status := populate_new_record(l_awrv_rec, l_def_awrv_rec);
1791: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1792: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1793: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1794: RAISE okl_api.G_EXCEPTION_ERROR;
1795: END IF;
1796: l_def_awrv_rec := fill_who_columns(l_def_awrv_rec);
1797: --- Validate all non-missing attributes (Item Level Validation)
1798: l_return_status := Validate_Attributes(l_def_awrv_rec);
1796: l_def_awrv_rec := fill_who_columns(l_def_awrv_rec);
1797: --- Validate all non-missing attributes (Item Level Validation)
1798: l_return_status := Validate_Attributes(l_def_awrv_rec);
1799: --- If any errors happen abort API
1800: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1801: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1802: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1803: RAISE okl_api.G_EXCEPTION_ERROR;
1804: END IF;
1797: --- Validate all non-missing attributes (Item Level Validation)
1798: l_return_status := Validate_Attributes(l_def_awrv_rec);
1799: --- If any errors happen abort API
1800: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1801: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1802: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1803: RAISE okl_api.G_EXCEPTION_ERROR;
1804: END IF;
1805: l_return_status := Validate_Record(l_def_awrv_rec);
1798: l_return_status := Validate_Attributes(l_def_awrv_rec);
1799: --- If any errors happen abort API
1800: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1801: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1802: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1803: RAISE okl_api.G_EXCEPTION_ERROR;
1804: END IF;
1805: l_return_status := Validate_Record(l_def_awrv_rec);
1806: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1799: --- If any errors happen abort API
1800: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1801: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1802: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1803: RAISE okl_api.G_EXCEPTION_ERROR;
1804: END IF;
1805: l_return_status := Validate_Record(l_def_awrv_rec);
1806: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1807: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1802: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1803: RAISE okl_api.G_EXCEPTION_ERROR;
1804: END IF;
1805: l_return_status := Validate_Record(l_def_awrv_rec);
1806: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1807: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1808: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1809: RAISE okl_api.G_EXCEPTION_ERROR;
1810: END IF;
1803: RAISE okl_api.G_EXCEPTION_ERROR;
1804: END IF;
1805: l_return_status := Validate_Record(l_def_awrv_rec);
1806: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1807: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1808: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1809: RAISE okl_api.G_EXCEPTION_ERROR;
1810: END IF;
1811:
1804: END IF;
1805: l_return_status := Validate_Record(l_def_awrv_rec);
1806: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1807: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1808: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1809: RAISE okl_api.G_EXCEPTION_ERROR;
1810: END IF;
1811:
1812: --------------------------------------
1805: l_return_status := Validate_Record(l_def_awrv_rec);
1806: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1807: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1808: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1809: RAISE okl_api.G_EXCEPTION_ERROR;
1810: END IF;
1811:
1812: --------------------------------------
1813: -- Move VIEW record to "Child" records
1823: x_msg_data,
1824: l_awr_rec,
1825: lx_awr_rec
1826: );
1827: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1828: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1829: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
1830: RAISE okl_api.G_EXCEPTION_ERROR;
1831: END IF;
1824: l_awr_rec,
1825: lx_awr_rec
1826: );
1827: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1828: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1829: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
1830: RAISE okl_api.G_EXCEPTION_ERROR;
1831: END IF;
1832: migrate(lx_awr_rec, l_def_awrv_rec);
1825: lx_awr_rec
1826: );
1827: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1828: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1829: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
1830: RAISE okl_api.G_EXCEPTION_ERROR;
1831: END IF;
1832: migrate(lx_awr_rec, l_def_awrv_rec);
1833: x_awrv_rec := l_def_awrv_rec;
1826: );
1827: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1828: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1829: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
1830: RAISE okl_api.G_EXCEPTION_ERROR;
1831: END IF;
1832: migrate(lx_awr_rec, l_def_awrv_rec);
1833: x_awrv_rec := l_def_awrv_rec;
1834: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1830: RAISE okl_api.G_EXCEPTION_ERROR;
1831: END IF;
1832: migrate(lx_awr_rec, l_def_awrv_rec);
1833: x_awrv_rec := l_def_awrv_rec;
1834: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1835: EXCEPTION
1836: WHEN okl_api.G_EXCEPTION_ERROR THEN
1837: x_return_status := okl_api.HANDLE_EXCEPTIONS
1838: (
1832: migrate(lx_awr_rec, l_def_awrv_rec);
1833: x_awrv_rec := l_def_awrv_rec;
1834: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1835: EXCEPTION
1836: WHEN okl_api.G_EXCEPTION_ERROR THEN
1837: x_return_status := okl_api.HANDLE_EXCEPTIONS
1838: (
1839: l_api_name,
1840: G_PKG_NAME,
1833: x_awrv_rec := l_def_awrv_rec;
1834: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1835: EXCEPTION
1836: WHEN okl_api.G_EXCEPTION_ERROR THEN
1837: x_return_status := okl_api.HANDLE_EXCEPTIONS
1838: (
1839: l_api_name,
1840: G_PKG_NAME,
1841: 'okl_api.G_RET_STS_ERROR',
1837: x_return_status := okl_api.HANDLE_EXCEPTIONS
1838: (
1839: l_api_name,
1840: G_PKG_NAME,
1841: 'okl_api.G_RET_STS_ERROR',
1842: x_msg_count,
1843: x_msg_data,
1844: '_PVT'
1845: );
1842: x_msg_count,
1843: x_msg_data,
1844: '_PVT'
1845: );
1846: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1847: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1848: (
1849: l_api_name,
1850: G_PKG_NAME,
1843: x_msg_data,
1844: '_PVT'
1845: );
1846: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1847: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1848: (
1849: l_api_name,
1850: G_PKG_NAME,
1851: 'okl_api.G_RET_STS_UNEXP_ERROR',
1847: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1848: (
1849: l_api_name,
1850: G_PKG_NAME,
1851: 'okl_api.G_RET_STS_UNEXP_ERROR',
1852: x_msg_count,
1853: x_msg_data,
1854: '_PVT'
1855: );
1853: x_msg_data,
1854: '_PVT'
1855: );
1856: WHEN OTHERS THEN
1857: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1858: (
1859: l_api_name,
1860: G_PKG_NAME,
1861: 'OTHERS',
1868: -- PL/SQL TBL update_row for:AWRV_TBL --
1869: ----------------------------------------
1870: PROCEDURE update_row(
1871: p_api_version IN NUMBER,
1872: p_init_msg_list IN VARCHAR2 DEFAULT okl_api.G_FALSE,
1873: x_return_status OUT NOCOPY VARCHAR2,
1874: x_msg_count OUT NOCOPY NUMBER,
1875: x_msg_data OUT NOCOPY VARCHAR2,
1876: p_awrv_tbl IN awrv_tbl_type,
1877: x_awrv_tbl OUT NOCOPY awrv_tbl_type) IS
1878:
1879: l_api_version CONSTANT NUMBER := 1;
1880: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_update_row';
1881: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1882: i NUMBER := 0;
1883: BEGIN
1884: okl_api.init_msg_list(p_init_msg_list);
1885: -- Make sure PL/SQL table has records in it before passing
1880: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_update_row';
1881: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1882: i NUMBER := 0;
1883: BEGIN
1884: okl_api.init_msg_list(p_init_msg_list);
1885: -- Make sure PL/SQL table has records in it before passing
1886: IF (p_awrv_tbl.COUNT > 0) THEN
1887: i := p_awrv_tbl.FIRST;
1888: LOOP
1887: i := p_awrv_tbl.FIRST;
1888: LOOP
1889: update_row (
1890: p_api_version => p_api_version,
1891: p_init_msg_list => okl_api.G_FALSE,
1892: x_return_status => x_return_status,
1893: x_msg_count => x_msg_count,
1894: x_msg_data => x_msg_data,
1895: p_awrv_rec => p_awrv_tbl(i),
1898: i := p_awrv_tbl.NEXT(i);
1899: END LOOP;
1900: END IF;
1901: EXCEPTION
1902: WHEN okl_api.G_EXCEPTION_ERROR THEN
1903: x_return_status := okl_api.HANDLE_EXCEPTIONS
1904: (
1905: l_api_name,
1906: G_PKG_NAME,
1899: END LOOP;
1900: END IF;
1901: EXCEPTION
1902: WHEN okl_api.G_EXCEPTION_ERROR THEN
1903: x_return_status := okl_api.HANDLE_EXCEPTIONS
1904: (
1905: l_api_name,
1906: G_PKG_NAME,
1907: 'okl_api.G_RET_STS_ERROR',
1903: x_return_status := okl_api.HANDLE_EXCEPTIONS
1904: (
1905: l_api_name,
1906: G_PKG_NAME,
1907: 'okl_api.G_RET_STS_ERROR',
1908: x_msg_count,
1909: x_msg_data,
1910: '_PVT'
1911: );
1908: x_msg_count,
1909: x_msg_data,
1910: '_PVT'
1911: );
1912: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1913: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1914: (
1915: l_api_name,
1916: G_PKG_NAME,
1909: x_msg_data,
1910: '_PVT'
1911: );
1912: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1913: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1914: (
1915: l_api_name,
1916: G_PKG_NAME,
1917: 'okl_api.G_RET_STS_UNEXP_ERROR',
1913: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1914: (
1915: l_api_name,
1916: G_PKG_NAME,
1917: 'okl_api.G_RET_STS_UNEXP_ERROR',
1918: x_msg_count,
1919: x_msg_data,
1920: '_PVT'
1921: );
1919: x_msg_data,
1920: '_PVT'
1921: );
1922: WHEN OTHERS THEN
1923: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1924: (
1925: l_api_name,
1926: G_PKG_NAME,
1927: 'OTHERS',
1937: --------------------------------
1938: -- delete_row for:OKL_ANSWERS --
1939: --------------------------------
1940: PROCEDURE delete_row(
1941: p_init_msg_list IN VARCHAR2 DEFAULT okl_api.G_FALSE,
1942: x_return_status OUT NOCOPY VARCHAR2,
1943: x_msg_count OUT NOCOPY NUMBER,
1944: x_msg_data OUT NOCOPY VARCHAR2,
1945: p_awr_rec IN awr_rec_type) IS
1945: p_awr_rec IN awr_rec_type) IS
1946:
1947: l_api_version CONSTANT NUMBER := 1;
1948: l_api_name CONSTANT VARCHAR2(30) := 'ANSWERS_delete_row';
1949: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1950: l_awr_rec awr_rec_type:= p_awr_rec;
1951: l_row_notfound BOOLEAN := TRUE;
1952: BEGIN
1953: l_return_status := okl_api.START_ACTIVITY(l_api_name,
1949: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
1950: l_awr_rec awr_rec_type:= p_awr_rec;
1951: l_row_notfound BOOLEAN := TRUE;
1952: BEGIN
1953: l_return_status := okl_api.START_ACTIVITY(l_api_name,
1954: p_init_msg_list,
1955: '_PVT',
1956: x_return_status);
1957: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1953: l_return_status := okl_api.START_ACTIVITY(l_api_name,
1954: p_init_msg_list,
1955: '_PVT',
1956: x_return_status);
1957: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1958: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1959: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1960: RAISE okl_api.G_EXCEPTION_ERROR;
1961: END IF;
1954: p_init_msg_list,
1955: '_PVT',
1956: x_return_status);
1957: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1958: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1959: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1960: RAISE okl_api.G_EXCEPTION_ERROR;
1961: END IF;
1962: DELETE FROM OKL_ANSWERS
1955: '_PVT',
1956: x_return_status);
1957: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1958: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1959: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1960: RAISE okl_api.G_EXCEPTION_ERROR;
1961: END IF;
1962: DELETE FROM OKL_ANSWERS
1963: WHERE ID = l_awr_rec.id;
1956: x_return_status);
1957: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
1958: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
1959: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
1960: RAISE okl_api.G_EXCEPTION_ERROR;
1961: END IF;
1962: DELETE FROM OKL_ANSWERS
1963: WHERE ID = l_awr_rec.id;
1964:
1961: END IF;
1962: DELETE FROM OKL_ANSWERS
1963: WHERE ID = l_awr_rec.id;
1964:
1965: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1966: EXCEPTION
1967: WHEN okl_api.G_EXCEPTION_ERROR THEN
1968: x_return_status := okl_api.HANDLE_EXCEPTIONS
1969: (
1963: WHERE ID = l_awr_rec.id;
1964:
1965: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1966: EXCEPTION
1967: WHEN okl_api.G_EXCEPTION_ERROR THEN
1968: x_return_status := okl_api.HANDLE_EXCEPTIONS
1969: (
1970: l_api_name,
1971: G_PKG_NAME,
1964:
1965: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
1966: EXCEPTION
1967: WHEN okl_api.G_EXCEPTION_ERROR THEN
1968: x_return_status := okl_api.HANDLE_EXCEPTIONS
1969: (
1970: l_api_name,
1971: G_PKG_NAME,
1972: 'okl_api.G_RET_STS_ERROR',
1968: x_return_status := okl_api.HANDLE_EXCEPTIONS
1969: (
1970: l_api_name,
1971: G_PKG_NAME,
1972: 'okl_api.G_RET_STS_ERROR',
1973: x_msg_count,
1974: x_msg_data,
1975: '_PVT'
1976: );
1973: x_msg_count,
1974: x_msg_data,
1975: '_PVT'
1976: );
1977: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1978: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1979: (
1980: l_api_name,
1981: G_PKG_NAME,
1974: x_msg_data,
1975: '_PVT'
1976: );
1977: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
1978: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1979: (
1980: l_api_name,
1981: G_PKG_NAME,
1982: 'okl_api.G_RET_STS_UNEXP_ERROR',
1978: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1979: (
1980: l_api_name,
1981: G_PKG_NAME,
1982: 'okl_api.G_RET_STS_UNEXP_ERROR',
1983: x_msg_count,
1984: x_msg_data,
1985: '_PVT'
1986: );
1984: x_msg_data,
1985: '_PVT'
1986: );
1987: WHEN OTHERS THEN
1988: x_return_status :=okl_api.HANDLE_EXCEPTIONS
1989: (
1990: l_api_name,
1991: G_PKG_NAME,
1992: 'OTHERS',
1999: -- delete_row for:OKL_ANSWERS_V --
2000: ----------------------------------
2001: PROCEDURE delete_row(
2002: p_api_version IN NUMBER,
2003: p_init_msg_list IN VARCHAR2 DEFAULT okl_api.G_FALSE,
2004: x_return_status OUT NOCOPY VARCHAR2,
2005: x_msg_count OUT NOCOPY NUMBER,
2006: x_msg_data OUT NOCOPY VARCHAR2,
2007: p_awrv_rec IN awrv_rec_type) IS
2007: p_awrv_rec IN awrv_rec_type) IS
2008:
2009: l_api_version CONSTANT NUMBER := 1;
2010: l_api_name CONSTANT VARCHAR2(30) := 'V_delete_row';
2011: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
2012: l_awrv_rec awrv_rec_type := p_awrv_rec;
2013: l_awr_rec awr_rec_type;
2014: BEGIN
2015: l_return_status := okl_api.START_ACTIVITY(l_api_name,
2011: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
2012: l_awrv_rec awrv_rec_type := p_awrv_rec;
2013: l_awr_rec awr_rec_type;
2014: BEGIN
2015: l_return_status := okl_api.START_ACTIVITY(l_api_name,
2016: G_PKG_NAME,
2017: p_init_msg_list,
2018: l_api_version,
2019: p_api_version,
2018: l_api_version,
2019: p_api_version,
2020: '_PVT',
2021: x_return_status);
2022: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
2023: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
2024: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
2025: RAISE okl_api.G_EXCEPTION_ERROR;
2026: END IF;
2019: p_api_version,
2020: '_PVT',
2021: x_return_status);
2022: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
2023: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
2024: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
2025: RAISE okl_api.G_EXCEPTION_ERROR;
2026: END IF;
2027: --------------------------------------
2020: '_PVT',
2021: x_return_status);
2022: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
2023: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
2024: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
2025: RAISE okl_api.G_EXCEPTION_ERROR;
2026: END IF;
2027: --------------------------------------
2028: -- Move VIEW record to "Child" records
2021: x_return_status);
2022: IF (l_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
2023: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
2024: ELSIF (l_return_status = okl_api.G_RET_STS_ERROR) THEN
2025: RAISE okl_api.G_EXCEPTION_ERROR;
2026: END IF;
2027: --------------------------------------
2028: -- Move VIEW record to "Child" records
2029: --------------------------------------
2037: x_msg_count,
2038: x_msg_data,
2039: l_awr_rec
2040: );
2041: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
2042: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
2043: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
2044: RAISE okl_api.G_EXCEPTION_ERROR;
2045: END IF;
2038: x_msg_data,
2039: l_awr_rec
2040: );
2041: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
2042: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
2043: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
2044: RAISE okl_api.G_EXCEPTION_ERROR;
2045: END IF;
2046: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
2039: l_awr_rec
2040: );
2041: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
2042: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
2043: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
2044: RAISE okl_api.G_EXCEPTION_ERROR;
2045: END IF;
2046: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
2047: EXCEPTION
2040: );
2041: IF (x_return_status = okl_api.G_RET_STS_UNEXP_ERROR) THEN
2042: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
2043: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
2044: RAISE okl_api.G_EXCEPTION_ERROR;
2045: END IF;
2046: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
2047: EXCEPTION
2048: WHEN okl_api.G_EXCEPTION_ERROR THEN
2042: RAISE okl_api.G_EXCEPTION_UNEXPECTED_ERROR;
2043: ELSIF (x_return_status = okl_api.G_RET_STS_ERROR) THEN
2044: RAISE okl_api.G_EXCEPTION_ERROR;
2045: END IF;
2046: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
2047: EXCEPTION
2048: WHEN okl_api.G_EXCEPTION_ERROR THEN
2049: x_return_status := okl_api.HANDLE_EXCEPTIONS
2050: (
2044: RAISE okl_api.G_EXCEPTION_ERROR;
2045: END IF;
2046: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
2047: EXCEPTION
2048: WHEN okl_api.G_EXCEPTION_ERROR THEN
2049: x_return_status := okl_api.HANDLE_EXCEPTIONS
2050: (
2051: l_api_name,
2052: G_PKG_NAME,
2045: END IF;
2046: okl_api.END_ACTIVITY(x_msg_count, x_msg_data);
2047: EXCEPTION
2048: WHEN okl_api.G_EXCEPTION_ERROR THEN
2049: x_return_status := okl_api.HANDLE_EXCEPTIONS
2050: (
2051: l_api_name,
2052: G_PKG_NAME,
2053: 'okl_api.G_RET_STS_ERROR',
2049: x_return_status := okl_api.HANDLE_EXCEPTIONS
2050: (
2051: l_api_name,
2052: G_PKG_NAME,
2053: 'okl_api.G_RET_STS_ERROR',
2054: x_msg_count,
2055: x_msg_data,
2056: '_PVT'
2057: );
2054: x_msg_count,
2055: x_msg_data,
2056: '_PVT'
2057: );
2058: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
2059: x_return_status :=okl_api.HANDLE_EXCEPTIONS
2060: (
2061: l_api_name,
2062: G_PKG_NAME,
2055: x_msg_data,
2056: '_PVT'
2057: );
2058: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
2059: x_return_status :=okl_api.HANDLE_EXCEPTIONS
2060: (
2061: l_api_name,
2062: G_PKG_NAME,
2063: 'okl_api.G_RET_STS_UNEXP_ERROR',
2059: x_return_status :=okl_api.HANDLE_EXCEPTIONS
2060: (
2061: l_api_name,
2062: G_PKG_NAME,
2063: 'okl_api.G_RET_STS_UNEXP_ERROR',
2064: x_msg_count,
2065: x_msg_data,
2066: '_PVT'
2067: );
2065: x_msg_data,
2066: '_PVT'
2067: );
2068: WHEN OTHERS THEN
2069: x_return_status :=okl_api.HANDLE_EXCEPTIONS
2070: (
2071: l_api_name,
2072: G_PKG_NAME,
2073: 'OTHERS',
2080: -- PL/SQL TBL delete_row for:AWRV_TBL --
2081: ----------------------------------------
2082: PROCEDURE delete_row(
2083: p_api_version IN NUMBER,
2084: p_init_msg_list IN VARCHAR2 DEFAULT okl_api.G_FALSE,
2085: x_return_status OUT NOCOPY VARCHAR2,
2086: x_msg_count OUT NOCOPY NUMBER,
2087: x_msg_data OUT NOCOPY VARCHAR2,
2088: p_awrv_tbl IN awrv_tbl_type) IS
2088: p_awrv_tbl IN awrv_tbl_type) IS
2089:
2090: l_api_version CONSTANT NUMBER := 1;
2091: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_delete_row';
2092: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
2093: i NUMBER := 0;
2094: BEGIN
2095: okl_api.init_msg_list(p_init_msg_list);
2096: -- Make sure PL/SQL table has records in it before passing
2091: l_api_name CONSTANT VARCHAR2(30) := 'V_tbl_delete_row';
2092: l_return_status VARCHAR2(1) := okl_api.G_RET_STS_SUCCESS;
2093: i NUMBER := 0;
2094: BEGIN
2095: okl_api.init_msg_list(p_init_msg_list);
2096: -- Make sure PL/SQL table has records in it before passing
2097: IF (p_awrv_tbl.COUNT > 0) THEN
2098: i := p_awrv_tbl.FIRST;
2099: LOOP
2098: i := p_awrv_tbl.FIRST;
2099: LOOP
2100: delete_row (
2101: p_api_version => p_api_version,
2102: p_init_msg_list => okl_api.G_FALSE,
2103: x_return_status => x_return_status,
2104: x_msg_count => x_msg_count,
2105: x_msg_data => x_msg_data,
2106: p_awrv_rec => p_awrv_tbl(i));
2108: i := p_awrv_tbl.NEXT(i);
2109: END LOOP;
2110: END IF;
2111: EXCEPTION
2112: WHEN okl_api.G_EXCEPTION_ERROR THEN
2113: x_return_status := okl_api.HANDLE_EXCEPTIONS
2114: (
2115: l_api_name,
2116: G_PKG_NAME,
2109: END LOOP;
2110: END IF;
2111: EXCEPTION
2112: WHEN okl_api.G_EXCEPTION_ERROR THEN
2113: x_return_status := okl_api.HANDLE_EXCEPTIONS
2114: (
2115: l_api_name,
2116: G_PKG_NAME,
2117: 'okl_api.G_RET_STS_ERROR',
2113: x_return_status := okl_api.HANDLE_EXCEPTIONS
2114: (
2115: l_api_name,
2116: G_PKG_NAME,
2117: 'okl_api.G_RET_STS_ERROR',
2118: x_msg_count,
2119: x_msg_data,
2120: '_PVT'
2121: );
2118: x_msg_count,
2119: x_msg_data,
2120: '_PVT'
2121: );
2122: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
2123: x_return_status :=okl_api.HANDLE_EXCEPTIONS
2124: (
2125: l_api_name,
2126: G_PKG_NAME,
2119: x_msg_data,
2120: '_PVT'
2121: );
2122: WHEN okl_api.G_EXCEPTION_UNEXPECTED_ERROR THEN
2123: x_return_status :=okl_api.HANDLE_EXCEPTIONS
2124: (
2125: l_api_name,
2126: G_PKG_NAME,
2127: 'okl_api.G_RET_STS_UNEXP_ERROR',
2123: x_return_status :=okl_api.HANDLE_EXCEPTIONS
2124: (
2125: l_api_name,
2126: G_PKG_NAME,
2127: 'okl_api.G_RET_STS_UNEXP_ERROR',
2128: x_msg_count,
2129: x_msg_data,
2130: '_PVT'
2131: );
2129: x_msg_data,
2130: '_PVT'
2131: );
2132: WHEN OTHERS THEN
2133: x_return_status :=Okl_Api.HANDLE_EXCEPTIONS
2134: (
2135: l_api_name,
2136: G_PKG_NAME,
2137: 'OTHERS',