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

Home -> Community -> Usenet -> c.d.o.tools -> UTL_FILE fopen problem!!!!!

UTL_FILE fopen problem!!!!!

From: <amparomp_at_my-deja.com>
Date: Tue, 19 Sep 2000 21:23:07 GMT
Message-ID: <8q8lf3$iic$1@nnrp1.deja.com>

I´m having problems opening a file using UTL_FILE package. I add the line UTL_FILE_DIR = * to the init.ora

When I´m trying to open the file, the exception "Invalid_operation" appeared. It seems that I don´t have permissions to read/write files but with the user I´m using on the net has it in NT. The path is with the same case sensitive as I have it..
What Can I do?? I´ll appreciate if someone could help me. Thanks This is the code I´m using:

DECLARE

p_FileDir 		varchar2(20);
p_FileName 		varchar2(20);
v_FileHandle	        UTL_FILE.FILE_TYPE;
v_NewLine		varchar2(24);
v_VAC			varchar2(3);
v_Desc		        varchar2(23);
v_Filler		varchar2(1);

BEGIN

  p_FileName := 'cmwvacd.dat';
  p_FileDir := 'c:\Temp';
  v_FileHandle := UTL_FILE.FOPEN(p_filedir, p_fileName, 'r');
  LOOP
    BEGIN
      UTL_FILE.GET_LINE(V_FileHandle, v_newLine);
      EXCEPTION
        WHEN NO_DATA_FOUND THEN
          EXIT;
      END;
      v_VAC := SUBSTR(v_NewLine, 1, 3);
      v_Desc := SUBSTR(v_NewLine, 4, 23);
      v_Filler := SUBSTR(v_NewLine, 24, 24);

      INSERT INTO NADA_ACCESORY_TYPES (NAAT_DESCRIPTION, NAAT_VAC)
VALUES
                                    (v_desc, v_VAC);
    END LOOP;
  UTL_FILE.FCLOSE(v_FileHandle);
  COMMIT;
  EXCEPTION
  WHEN UTL_FILE.INVALID_OPERATION THEN
    UTL_FILE.FCLOSE(v_FileHandle);
    RAISE_APPLICATION_ERROR(-20051, 'Load Accesory types: Invalid Operation');
  when utl_file.invalid_filehandle then
    utl_file.fclose(v_filehandle);
    raise_application_error(-20052, 'load accesory types: Invalid FileHandle');
  when utl_file.read_error then
    utl_file.fclose(v_filehandle);
raise_application_error(-20053, 'Read error');   WHEN OTHERS THEN
    UTL_FILE.FCLOSE(v_FileHandle);
    RAISE;
END; Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Sep 19 2000 - 16:23:07 CDT

Original text of this message

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