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 -> PL/SQL and writing files

PL/SQL and writing files

From: Bryan J. Gentile <bgentile_at_bdsinc.com>
Date: 1997/10/28
Message-ID: <3456896C.19F680D2@bdsinc.com>#1/1

I am having trouble writing a log file to a server using PL/SQL. The following is my code for my stored procedure:

IS

file_handle UTL_FILE.FILE_TYPE;
time_stamp varchar2(20);

BEGIN
 DBMS_OUTPUT.PUT_LINE('About to open log file...');  file_handle := UTL_FILE.FOPEN('/log/', 'SPErrors.log', 'A');

 SELECT TO_CHAR(sysdate, 'MMDDYY HH:MI')

    INTO time_stamp
    FROM dual;

 UTL_FILE.PUT_LINE(file_handle, time_stamp || ' [Procedure: write_log]
--> This is a test to log info to a file.');
 UTL_FILE.NEW_LINE(file_handle);
 DBMS_OUTPUT.PUT_LINE('Message logged...');  UTL_FILE.FCLOSE(file_handle);

 DBMS_OUTPUT.PUT_LINE('Closing LogFile...');    EXCEPTION
 WHEN UTL_FILE.INVALID_OPERATION THEN
    DBMS_OUTPUT.PUT_LINE('Error with UTL_FILE');     UTL_FILE.FCLOSE(file_handle);
END; Everytime I run it in SQL-PLUS, I get the following error:

ERROR at line 1:

ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.UTL_FILE", line 82
ORA-06512: at "SYS.UTL_FILE", line 120
ORA-06512: at "WWW_USER.WRITE_LOG", line 8
ORA-06512: at line 1

What does this mean, and how can I fix this?

Please respond via email because I cannot check the newsgroup too many times during the day.

--
************************************
  Bryan J. Gentile
  Consultant
  Business Data Services, Inc.
  Glastonbury, CT  06033
  Phone: (860)633-3693 (ext. 3025)
  Vmail: (ext. 6030)
************************************
Received on Tue Oct 28 1997 - 00:00:00 CST

Original text of this message

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