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 -> Re: UTL_FIle fopen problem

Re: UTL_FIle fopen problem

From: steve <E_at_E.COM>
Date: 2000/09/21
Message-ID: <1ehbl1h.fgks1f6ausieN%E@E.COM>#1/1

UTL_FILE_DIR = * Wow that is very dangerous, I hope it is not a production database.

  1. Restart the database, since the init.ora will not work until the startup.
  2. check if the UTL package is installed and valid.
  3. i'm not familiar with NT, but I do use netware. Netware declares the server drives as "sys:" & "vol1:", but under windows you map them to say "G:" & "Z:"
  4. 'c:\temp' it does exist on the SERVER right? ( cannot do it to the workstation
  5. does the nt o/s call the drive "c:" at the CONSOLE or does it have a special name for the drive.
  6. you cannot use utl_file in SQL it must be a stored procedure/package
  7. you cannot read/write a line longer than 1022 bytes.
    • this is part of my init.ora******* #BELOW 4 LINES TO GIVE ORACLE READ/WRITE ACCES TO THE novell GROUPWISE UTL_FILE_DIR =SYS:\DOMAIN\WPGATE\API\ATT_OUT UTL_FILE_DIR =SYS:\DOMAIN\WPGATE\API\API_OUT UTL_FILE_DIR =SYS:\DOMAIN\WPGATE\API\ATT_IN UTL_FILE_DIR =SYS:\DOMAIN\WPGATE\API\API_IN
also I found I had to RTRIM the strings passed to file.open ?!? also try making the 'r' into 'R'

<amparomp_at_my-deja.com> wrote:

> I´m trying to open a file with utl_file but it
> appears the excception "Invalid Operation". IT is
> supposed because the operative system
> permissions. I don´t know why because I´m a user
> that has permissions in NT to read/write files.
> I already put the line: UTL_FILE_DIR = * in the
> INIT.ORA file. I don´t know what else I can do?
> If you have any ideas I´ll appreciate. This is
> part of the code I´ve.
>
> 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');
>
> 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 Thu Sep 21 2000 - 00:00:00 CDT

Original text of this message

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