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: file handling in pl/sql

Re: file handling in pl/sql

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Mon, 23 Jan 2006 19:41:52 +0100
Message-ID: <sf8at197ch59nbfe5gpc6nudnjoj42gvef@4ax.com>


On 23 Jan 2006 09:52:49 -0800, "Amrutha" <amrutha_at_gmail.com> wrote:

>Hi,
>I would like to run a bunch of queries and redirect the output to a
>file. The queries would be run against an Oracle database. I know I can
>create a simple procedure/package to do this, but not clear how to get
>the output redirected to a file.
>Could someone help?
>thanks,
>Amrutha

Evidently this depends on the tool being used. Sql*plus supports redirection and you can spool to a file in various formats.
Documented in the sql*plus reference manual. If would not see why you would create a procedure/package if a simple sql script would work as well.
In procedures/packages you can use
dbms_output
or better utl_file (no size limitations). As these packages are documented, and you don't specify your version I will not detail how to set this up.

--
Sybrand Bakker, Senior Oracle DBA
Received on Mon Jan 23 2006 - 12:41:52 CST

Original text of this message

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