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: Writing to a text file from PL/SQL

Re: Writing to a text file from PL/SQL

From: Tim Cross <tcross_at_nospam.une.edu.au>
Date: 23 Jul 2002 10:51:33 +1000
Message-ID: <87r8hv6zca.fsf@blind-bat.une.edu.au>


Álvaro Palma Aste <queria_direccion_at_el.perla.invalid> writes:

> Andrew Hardy escribió:
> >Jasna,
>
> >> I'm trying to retrive data from an Oracle table into a text file by the
> >sql
> >> procedure wich is atached to this mail but I get following declaration
> >> mistakes:
> >>
>
> Or you can do it using dbms_output instructions. You only have to
> put the lines:
>
>

True, but don't forget DBMS_OUTPUT has some major restrictions -

  1. Lines cannot be longer than 255 charcters
  2. The total amount of data cannot exceed 1Mb
  3. Nothing is output until after the script/block has executed and if there is an exception, you may not see any data at all, plus you must use the size option to the set serveroutput or DBMS_OUTPUT.ENAMBLE() procedure to set it to the maximum 1Mb size.

From memory, I think DBMS_OUTPUT may also trim leading/trailing white space - so any formatting may get modified/lost - not sure about this though, I just recall something I encountered where the output was modified by DBMS_OUTPUT.

I think DBMS_OUTPUT is really only useful as a debugging tool and you are much better off using UTL_FILE.

Tim

-- 
Tim Cross					E-Mail: tcross_at_pobox.une.edu.au
Analyst/Programmer                               Phone: 6773 3210
Applications Group			        Mobile: 0412 969193
University of New England
---
find / -iname microsoft -exec rm -rf {} \;
Received on Mon Jul 22 2002 - 19:51:33 CDT

Original text of this message

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