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

Home -> Community -> Usenet -> c.d.o.server -> utl_file does not create file

utl_file does not create file

From: <aowens2325_at_my-deja.com>
Date: 2000/07/27
Message-ID: <8lqdlu$a81$1@nnrp1.deja.com>#1/1

I cannot get the utl_file utility to create and write to the specified file. I am using the following code:

DECLARE myfile UTL_FILE.FILE_TYPE;

BEGIN
MYFILE:=UTL_FILE.FOPEN('C:\Temp','annScript.SQL','w'); UTL_FILE.PUT_LINE(myfile,')');
-- if (utl_file.is_open(MYFILE)) then

--UTL_FILE.FCLOSE(myfile);

EXCEPTION

  when utl_file.invalid_path then
      dbms_output.put_line('>>> Invalid path');
  when utl_file.invalid_filehandle then
      dbms_output.put_line('>>> Invalid file handle');
  when utl_file.invalid_mode then
      dbms_output.put_line('>>> Invalid mode');
  when utl_file.invalid_operation then
      dbms_output.put_line('>>> Invalid operation');
  when utl_file.write_error then
      dbms_output.put_line('>>> Write error');
  when utl_file.read_error then
      dbms_output.put_line('>>> Read error');
  when utl_file.internal_error then
      dbms_output.put_line('>>> Internal error');
  WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(SQLERRM);
    DBMS_OUTPUT.PUT_LINE(SQLCODE);
END;
I have added the file location C:\Temp to the utl_file_dir parameter of the Init.ora file. I get no exceptions but there is no file.

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Jul 27 2000 - 00:00:00 CDT

Original text of this message

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