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 -> Re: utl_file directory

Re: utl_file directory

From: Rolf Unger <rolf.unger_at_ctilabs.de>
Date: 2 Apr 2002 13:53:55 -0800
Message-ID: <32fe19ad.0204021353.2e639925@posting.google.com>


"Valda" <andrea.valdameri_at_libero.it> wrote in message news:<6HDp8.100776$1S3.3170034_at_twister1.libero.it>...
> Anyone knows where can i set the directory where write my utl_file created
> by script sql, with the oracle8i on W2000 server?
>
> Thanks

Hi,
in the init<sid>.ora file of your database instance you have to add a key

utl_file_dir = c:\my\directory

to allow the database to write into that directory on the host machine with the database running.

Of course you have to specify the same path in the 'location' parameter of fopen() in your PL/SQL-Block:

  utl_file.fopen(location => 'c:\my\directory', ...

With this method you can only write into files on the server side. I'm not sure if this is what you want as you mention 'script sql'. If this means that you need the data/file on the client machine, where you execute the script, then you're better of if you use the SPOOL command of SQL*Plus to open the file, dbms_output.put_line() to write
and SPOOL OFF to close the file.

Hope this helps,

Rolf. Received on Tue Apr 02 2002 - 15:53:55 CST

Original text of this message

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