Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

UTL_FILE package

484135May 22 2006 — edited May 23 2006
Dear 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....
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 20 2006
Added on May 22 2006
8 comments
427 views