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 -> Re: package UTL_FILE

Re: package UTL_FILE

From: Reinhard Wahl <wahl_at_zv.fhg.de>
Date: Tue, 05 Jan 1999 11:47:24 +0100
Message-ID: <3691EDBC.5309A318@zv.fhg.de>


Hi Flavio,
because this Server Release is not available for Win95, I think, I expect that you are running Client-Server-architecture. And so the answer is easy: you cannot have output via UTL_FILE on the client. So you have to find the right directory and syntax for writing to a file on the server.
Hope this helps

        Reinhard
Corrado Fantuz schrieb:
>
> Hi,
> i am running Win95 and working with Oracle7 Server Release 7.3.4.0.0.
> I'm trying to read a file TEXT with package UTL_FILE:
> *******************************************************************
> /*---------------------------------------------------------------------------------------
>
> prova lettura file
> ---------------------------------------------------------------------------------------*/
>
> CREATE OR REPLACE PROCEDURE prova
> ( ppath in varchar2,
> pfile in varchar2)
> IS
>
> num_err number;
>
> mfile UTL_FILE.FILE_TYPE;
> mriga varchar2(80);
>
> --ROUTINE
> procedure chiudi as
> begin
> IF UTL_FILE.is_open(mfile) THEN
> UTL_FILE.fclose(mfile);
> END IF;
> end;
>
> BEGIN
> delete from ts40_log_err;
> commit;
>
> mfile:=UTL_FILE.fopen(ppath,pfile,'r');
>
> UTL_FILE.get_line(mfile,mriga);
>
> INSERT INTO ts40_log_err
> VALUES ( 0, 0, 'letta : ' || mriga);
>
> chiudi;
>
> EXCEPTION
> WHEN UTL_FILE.INVALID_PATH THEN
> chiudi;
> INSERT INTO ts40_log_err
> VALUES ( 0, 0, 'Prova errore : path errato ' || ppath || ' ' ||
> pfile );
> COMMIT;
>
> WHEN UTL_FILE.INVALID_MODE THEN
> chiudi;
> INSERT INTO ts40_log_err
> VALUES ( 0, 0, 'Prova errore : modalità errata' );
> COMMIT;
>
> WHEN UTL_FILE.INVALID_OPERATION THEN
> chiudi;
> INSERT INTO ts40_log_err
> VALUES ( 0, 0, 'Prova errore : operazione errata' );
> COMMIT;
>
> WHEN OTHERS THEN
> chiudi;
> num_err := SQLCODE;
> INSERT INTO ts40_log_err
> VALUES ( 0, 0, 'Prova errore : ' || num_err);
> COMMIT;
>
> END;
> /
> *************************************************************************
>
> I call this procedure with command "exec
> prova('T:','DATAINIZ.xxx');" but i have a "UTL_FILE.INVALID_PATH" error.
>
> - is the name path correct ??? (i.e. disk:\path1\path2..)
> - what is the name of the initialization file on client ( using the
> UTL_FILE_DIR parameter )????
>
> Thanks in advance.
> Flavio
>
> :


E-Mail_at_work: mailto:wahl_at_zv.fhg.de
E-Mail_at_home: mailto:ReinhardWahl_at_online.de
----------------------------------------------------
Website http://www.online.de/homepages/ReinhardWahl

    Hiermit widerspreche ich der Nutzung oder    Uebermittlung meiner Daten fuer Werbezwecke    oder fuer die Markt- oder Meinungsforschung   gemaess Par. 28 Abs. 3 Bundesdatenschutzgesetz.



Please do not use my E-Mail address for advertising!
Received on Tue Jan 05 1999 - 04:47:24 CST

Original text of this message

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