UTL_FILE package
484135May 22 2006 — edited May 23 2006Dear All,
I created a directory named "SAMPLE_TEST" in the database. I have full access on this directory. But if I execute the following block I get an error stating
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.UTL_FILE", line 98
ORA-06512: at "SYS.UTL_FILE", line 157
ORA-06512: at line 4
/*---------------------Code starts -----------------------------*/
DECLARE
fp UTL_FILE.FILE_TYPE;
BEGIN
fp := UTL_FILE.FOPEN('SAMPLE_TEST','test_dba','w');
UTL_FILE.PUT_LINE(fp,'Line 1');
UTL_FILE.FCLOSE(fp);
DBMS_OUTPUT.PUT_LINE('end of the block');
END;
/*-------------------------code ends--------------------------*/
output of my all_directories is:
"SYS --SAMPLE_TEST-- /sample2"
I get the same error even if I give directly the path name of the directory in the fopen instead of giving the directory name.
I will be so thankful and greatful for any help, explanation and solution....Thanks in advance....