I have just installed oracle server on my machine and am trying to use the utl_file package. I have created a database called cldtest. When I try to execute a simple procedure to just open a file and write to it I get the error note:
SQL> exec select_data('claudedemo')
BEGIN select_data('claudedemo'); END;
*
ERROR at line 1:
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.UTL_FILE", line 101
ORA-06512: at "SYS.UTL_FILE", line 157
ORA-06512: at "CLAUDEDEMO.SELECT_DATA", line 6
ORA-06512: at line 1
My code is :
CREATE OR REPLACE PROCEDURE select_data(v_owner IN VARCHAR2) IS
fHandle UTL_FILE.FILE_TYPE;
BEGIN
fHandle:=UTL_FILE.FOPEN('o:\users\claude_vinaccia\temp','archivedata.txt','w');
UTL_FILE.PUT_LINE(fHandle,'File Begin');
UTL_FILE.PUT(fHandle,'schema:' || v_owner || ':' || 'table:' || 'tablename');
UTL_FILE.PUT(fHandle, 'columndata');
UTL_FILE.PUT(fHandle, ',');
UTL_FILE.PUT_LINE(fHandle, ';');
UTL_FILE.PUT_LINE(fHandle,'End File');
UTL_FILE.FCLOSE(fHandle);
END select_data;
/
I have set up auser called claudedemo and and granted execute on utl_file, and I have put utl_file_dir = * in the initCLDTEST.ora file.
Has anyone any ideas.
SQL> exec select_data('claudedemo')
BEGIN select_data('claudedemo'); END;
*
ERROR at line 1:
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.UTL_FILE", line 101
ORA-06512: at "SYS.UTL_FILE", line 157
ORA-06512: at "CLAUDEDEMO.SELECT_DATA", line 6
ORA-06512: at line 1
My code is :
CREATE OR REPLACE PROCEDURE select_data(v_owner IN VARCHAR2) IS
fHandle UTL_FILE.FILE_TYPE;
BEGIN
fHandle:=UTL_FILE.FOPEN('o:\users\claude_vinaccia\temp','archivedata.txt','w');
UTL_FILE.PUT_LINE(fHandle,'File Begin');
UTL_FILE.PUT(fHandle,'schema:' || v_owner || ':' || 'table:' || 'tablename');
UTL_FILE.PUT(fHandle, 'columndata');
UTL_FILE.PUT(fHandle, ',');
UTL_FILE.PUT_LINE(fHandle, ';');
UTL_FILE.PUT_LINE(fHandle,'End File');
UTL_FILE.FCLOSE(fHandle);
END select_data;
/
I have set up auser called claudedemo and and granted execute on utl_file, and I have put utl_file_dir = * in the initCLDTEST.ora file.
Has anyone any ideas.