Re: UTL_FILE question

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Mon, 22 Oct 2001 11:10:20 +0200
Message-ID: <tt7omve49jgf3_at_corp.supernews.com>


Actually if you would have read the page a little better there is your answer

Included in Oracle 7.3 is an UTL_FILE package that can read and write operating system files. The directory you intend writing to has to be in your INIT.ORA file (see UTL_FILE_DIR=... parameter). Before Oracle 7.3 the only means of writing a file was to use DBMS_OUTPUT with the SQL*Plus SPOOL command

Regards,

Sybrand Bakker
Senior Oracle DBA

"Olaf F. Normann" <olafn_at_runit.no> wrote in message news:1003738464.664390_at_halvan.trd.sintef.no...
> Hello all Oracle experts!
> I try to use the UTL_FILE packages, but when I execute
> the following script, I get trapped in the exeption regardless of which
> path I enter (I got the script from http://www.orafaq.com/faqplsql.htm).
>
> Do I need to enter anything in the "INIT.ORA" file? If so, how is
> the format?
>
> Please help!!
>
> Best regards
> Olaf F. Normann
>
> --snipp----snipp----snipp----snipp----snipp----snipp--
>
> DECLARE
> fileHandler UTL_FILE.FILE_TYPE;
> BEGIN
> fileHandler := UTL_FILE.FOPEN('f:\oracle', 'myfile', 'w');
> UTL_FILE.PUTF(fileHandler, 'Look ma, I''m writing to a file!!!\n');
> UTL_FILE.FCLOSE(fileHandler);
> EXCEPTION
> WHEN utl_file.invalid_path THEN
> raise_application_error(-20000, 'FEIL: Invalid path for file or path not
in
> INIT.ORA.');
> END;
>
>
Received on Mon Oct 22 2001 - 11:10:20 CEST

Original text of this message