Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> UTL_FILE.READ_ERROR

UTL_FILE.READ_ERROR

From: Steve Thomas <thomas_at_axiom.net>
Date: 1998/01/10
Message-ID: <697bpi$lk4$1@usenet87.supernews.com>#1/1

I can't seem to use the UTL_FILE and HTP/HTF packages together.

Platform: SCO 5.0.4, Oracle 7.3.3 web enabled with server 2.0, PL/SQL 2.3

TAR# - 10512389.6 I would like to display an operating system file on the web.

utl_file/dir = /u/tmp - permissions are set in init file.

User who creates html is called www_user and by default Oracle creates files with UTL_FILE package with permissions of 664.

Test1:

Lets say I create a file with the following:

CREATE OR REPLACE PROCEDURE test1 IS

    Fplog UTL_FILE.FILE_TYPE;
BEGIN
    Fplog := UTL_FILE.FOPEN(‘/u/tmp’,’test.txt’,’W’);     UTL_FILE.PUT_LINE(Fplog,’Hello World’);     UTL_FILE.FCLOSE(Fplog);
END test1;

Test2:

Lets say I want to read the file I just created and display on web.

CREATE OR REPLACE PROCEDURE test2 IS

    Fplog UTL_FILE.FILE_TYPE;
    V_line VARCHAR2(60);
BEGIN
    Fplog := UTL_FILE.FOPEN(‘/u/tmp’,’test.txt’,’R’);     UTL_FILE.GET_LINE(Fplog,V_line);
    UTL_FILE.FCLOSE(Fplog);

    htp.htmlOpen;
    htp.bodyOpen(‘’)
    htp.print(V_line);
    htp.bodyClose;
    htp.htmlClose;

END test2;

When I call test2 from a browser GET_LINE raises the exception UTL_FILE.READ_ERROR. I can display to standard out by replacing HTP calls with DBMS_OUTPUT calls by setting serveroutput on and running test2 from sqlplus command line.

I am thinking this is a web listener permissions problem.

Thanks in advance for any help.
Steve Thomas
s104skt_at_mail.va.gov Received on Sat Jan 10 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US