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: PL/SQL How to output to file - beginner

Re: PL/SQL How to output to file - beginner

From: Ian Cary <cary_at_gatwick.geco-prakla.slb.com>
Date: 1997/12/04
Message-ID: <3486C00F.A662F1A1@gatwick.geco-prakla.slb.com>#1/1

Me wrote:

> I'm a beginner using PL/SQL and I can't figure out how to print
> output from the database to a file.

You can either use

spool outfile

begin
dbms_output.put_line('Output');
end;

or

declare
 filhand utl_file.file_type;
begin
  filhand := utl_file.fopen('<out_dir>','outfile','w');   utl_file.put(filhand,'Output');
  utl_file.fclose(filhand);
end;

For this method to work the init.ora parameter

utl_file_dir=<out_dir>

needs to be set.

Regards,

Ian Received on Thu Dec 04 1997 - 00:00:00 CST

Original text of this message

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