Skip to Main Content

Oracle Database Express Edition (XE)

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 is not working

2767498Oct 3 2014 — edited Oct 6 2014

Hi Friends,

     IN my machine i need to work with UTL_FILE so i did the following but the error is still so can anybody please help me on that.

[root@localhost ~]# su oracle

[oracle@localhost root]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Oct 3 09:24:06 2014

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:

Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

SQL> create or replace directory T1 as '/home/test/raja';

Directory created.

SQL> grant read,write on directory T1 to RAJA;

Grant succeeded.

SQL> grant execute on UTL_FILE to RAJA;

Grant succeeded.

SQL> select * from dba_directories where directory_name ='T1';

OWNER                   DIRECTORY_NAME

------------------------------ ------------------------------

DIRECTORY_PATH

--------------------------------------------------------------------------------

SYS                   T1

/home/test/raja

SQL> select * from v$version;

BANNER

----------------------------------------------------------------

Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product

PL/SQL Release 10.2.0.1.0 - Production

CORE    10.2.0.1.0    Production

TNS for Linux: Version 10.2.0.1.0 - Production

NLSRTL Version 10.2.0.1.0 - Production

SQL> DECLARE

  2        L_HANDLER UTL_FILE.FILE_TYPE;

  3      BEGIN

  4        L_HANDLER := UTL_FILE.FOPEN('T1', 'SYS.txt', 'W');

  5        UTL_FILE.PUTF(L_HANDLER, 'UTL_FILE write mode demonstration');

  6        UTL_FILE.FCLOSE(L_HANDLER);

  7*     END;

SQL> /

    DECLARE

*

ERROR at line 1:

ORA-29283: invalid file operation

ORA-06512: at "SYS.UTL_FILE", line 475

ORA-29283: invalid file operation

ORA-06512: at line 4

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 3 2014
Added on Oct 3 2014
12 comments
3,157 views