Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: HELP w/ PL/SQL writing to a flat file.
djdrew wrote:
> I've gone through the documentation in the oracle programmer's reference
> and the O'Reilly books, but I can't seem to get PL/SQL to write to a
> flat file. Can anyone give me actual code that I may be able to use to
> perform this procedure?
You have two alternaternatives.
i.e.
set serveroutput on
spool file name
begin
dbms_output.put_line('This will output to a flat file'); end;
A limitation with this method is can be the size of the output buffer.
2) use utl_file;
i.e.
declare filhand utl_file.file_type; begin filhand := utl_file.fopen('dirname','filename','w'); utl_file.put_line(filhand,'This will output to a flat file'); end;
For this to work a line;
utl_file_dir=dirname
must have been place within your init.ora file.
Hope this helps,
Ian Received on Wed Nov 12 1997 - 00:00:00 CST
![]() |
![]() |