-
UTL_FILE problem
I want to retrive the rows from a table and write to a file in one directory. So I used UTL_FILE package and I have created a directory in init.ora file also. But when I execute the procedure, I get the following error message.
ORA-06510 - PL/SQL unhandled user defined exception.
ORA-06512 - at "SYS.UTL_FILE", line 101
ORA-06512 - at "SYS.UTL_FILE", line 157
The code is as follows:
declare
cursor c1 is
select * from precord;
rec precord%ROWTYPE;
v_handle UTL_FILE.FILE_TYPE;
v_filedir varchar2(200);
v_filename varchar2(200);
begin
v_filedir := '/usr5/mis/output_files'; /* (OUtput_files is the directory)*/
v_filename := 'test.out';
v_handle := UTL_FILE.FOPEN(v_filedir, v_filename, 'w');
for rec in c1 loop
UTL_FILE.PUTF(v_handle, 'Employee name: %s\n', rec.ename);
end loop;
UTL_FILE.FCLOSE(v_handle);
end;
Kindly help me.
Thanks.
-
There is a possiblity that you have not mounted the disk where you are writng the file so please check it.
Shailendra
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|