Re: Spool

From: Ed prochak <ed.prochak_at_magicinterface.com>
Date: 16 Dec 2003 10:37:07 -0800
Message-ID: <4b5394b2.0312161037.51ea1d19_at_posting.google.com>


jani.ahti_at_pp.nic.fi (Jani Ahti) wrote in message news:<a57b7fef.0312160051.7b5abbc3_at_posting.google.com>...
> In Oracle 7.0 (VMS) I have a Pl/Sql script, in which there is a cursor
> c that retrives CustNo field. For each CustNo I make a query inside
> the cursor and would need to spool each of these query results
> (several rows) to a different file. That is, Result of the query for
> CustNo AX would be placed in file R00001.DAT, CustNo BX in file
> R00002.DAT and so on.
>
> UTL_FILE can not be used.
>
> Maybe I should call a COM or SqlPlus file, where the spooling would
> happen, but I can't make it work..
>
> Jani

You have it reversed. You need a SqlPlus script to call you PL/SQL procedure. and then likely a DCL script arount that. Why? well using the DBMS_OUTPUT package has a limit on the output size (changeable, abut only to a MAX of one million bytes). And the DCL will be able to handle sending the output to the individual files.

HTH,
  Ed Received on Tue Dec 16 2003 - 19:37:07 CET

Original text of this message