Message from discussion
Why is UTL_FILE.FOPEN failing?
Received: by 10.68.202.37 with SMTP id kf5mr1705121pbc.7.1334243781686;
Thu, 12 Apr 2012 08:16:21 -0700 (PDT)
Path: r9ni48145pbh.0!nntp.google.com!news2.google.com!postnews.google.com!2g2000yqp.googlegroups.com!not-for-mail
From: PeteOlcott <peteolc...@gmail.com>
Newsgroups: comp.databases.oracle.tools
Subject: Why is UTL_FILE.FOPEN failing?
Date: Thu, 12 Apr 2012 08:16:21 -0700 (PDT)
Organization: http://groups.google.com
Lines: 36
Message-ID: <87ce2ab3-2927-4e7e-9955-891006505516@2g2000yqp.googlegroups.com>
NNTP-Posting-Host: 204.58.233.6
Mime-Version: 1.0
X-Trace: posting.google.com 1334243781 31552 127.0.0.1 (12 Apr 2012 15:16:21 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 12 Apr 2012 15:16:21 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 2g2000yqp.googlegroups.com; posting-host=204.58.233.6; posting-account=m_bN-QoAAACUzML6OWGLBFOhnGpncwel
User-Agent: G2/1.0
X-HTTP-Via: ICAP/1.0 192.168.26.9
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729;
.NET4.0C; .NET4.0E; InfoPath.1),gzip(gfe)
Content-Type: text/plain; charset=ISO-8859-1
INPUT:
create or replace directory filesdir as 'c:\';
grant read on directory filesdir to public;
declare
namesfile UTL_FILE.FILE_TYPE;
begin
-- Syntax : FOPEN ( directory alias, filename, open mode)
namesfile := UTL_FILE.FOPEN('FILESDIR','CASELIST.TXT','r');
end;
OUTPUT:
SQL> create or replace directory filesdir as 'c:\';
Directory created.
SQL> grant read on directory filesdir to public;
Grant succeeded.
SQL>
1 declare
2 namesfile UTL_FILE.FILE_TYPE;
3 begin
4 -- Syntax : FOPEN ( directory alias, filename, open mode)
5 namesfile := UTL_FILE.FOPEN('FILESDIR','CASELIST.TXT','r');
6* end;
7 /
declare
*
ERROR at line 1:
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 488
ORA-29283: invalid file operation
ORA-06512: at line 5