37: x_return_status OUT NOCOPY VARCHAR2) IS
38:
39: l_file_name VARCHAR2(200);
40: l_file_loc BFILE;
41: l_file_type utl_file.file_type;
42: l_location VARCHAR2(32000);
43: l_comma_loc NUMBER;
44: l_session_id NUMBER;
45: l_perf_msg VARCHAR2(32000) := p_program_name || ': ' || p_perf_msg;
49:
50: cursor get_dir is
51: select value
52: from v$parameter
53: where name = 'utl_file_dir';
54:
55: Begin
56: x_return_status := OKC_API.G_RET_STS_SUCCESS;
57:
88: If p_path is not null then
89: l_location := p_path;
90: End If;
91:
92: l_file_type := utl_file.fopen(location => l_location,
93: filename => l_file_name,
94: open_mode => 'a');
95:
96: utl_file.put_line(file => l_file_type,
92: l_file_type := utl_file.fopen(location => l_location,
93: filename => l_file_name,
94: open_mode => 'a');
95:
96: utl_file.put_line(file => l_file_type,
97: buffer => l_perf_msg );
98:
99: utl_file.put_line(file => l_file_type,
100: buffer => l_error_msg );
95:
96: utl_file.put_line(file => l_file_type,
97: buffer => l_perf_msg );
98:
99: utl_file.put_line(file => l_file_type,
100: buffer => l_error_msg );
101:
102: utl_file.fflush(file => l_file_type);
103: utl_file.fclose(l_file_type);
98:
99: utl_file.put_line(file => l_file_type,
100: buffer => l_error_msg );
101:
102: utl_file.fflush(file => l_file_type);
103: utl_file.fclose(l_file_type);
104: End If;
105:
106: Exception
99: utl_file.put_line(file => l_file_type,
100: buffer => l_error_msg );
101:
102: utl_file.fflush(file => l_file_type);
103: utl_file.fclose(l_file_type);
104: End If;
105:
106: Exception
107: when utl_file.INVALID_PATH then
103: utl_file.fclose(l_file_type);
104: End If;
105:
106: Exception
107: when utl_file.INVALID_PATH then
108: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
109: x_msg_data := l_error_msg || ' Invalid Path';
110: x_msg_count:= 1;
111: OKC_API.set_message
116: SQLCODE,
117: G_SQLERRM_TOKEN,
118: 'Invalid path'
119: );
120: when utl_file.INVALID_OPERATION then
121: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
122: x_msg_data := l_error_msg || ' Invalid operation';
123: x_msg_count:= 1;
124: OKC_API.set_message