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: formatting output with SQL*Plus

Re: formatting output with SQL*Plus

From: Colum Mylod <cmylod_at_despammed.com>
Date: Wed, 08 Dec 2004 18:15:20 +0000
Message-ID: <8rger01lprhigt9nv59qsc7t0c0u8v1nf2@4ax.com>


On Wed, 08 Dec 2004 18:08:49 +0100, Thomas Kellerer <NNGNVRDSJEBN_at_spammotel.com> wrote:

>Hello,
>
>I'm hitting the old problem that I need to spool data into a text file, but
>SQL*Plus insists on padding the fields to the length of the column definition.

There is a way which I've used to make the dbms_metadata.get_ddl package spool out a decent usable (as DDL SQL) piece of code, this might help you. Look for the put_line PL./SQL procedure which has a "compress" 2nd argument to squeeze out the irritating space-to-EOL chars.

I got this from http://adp-gmbh.ch/ora/misc/oru_10028.html

It's all clean readable code. You can modify this package, then select your stuff into a varchar2, then put_line(that varchar2, boolean) where boolean is TRUE for that "compression", which you can readily fix to your taste. Does require some PL/SQLing but that's Just Another Language really :-)

HTH

-- 
New anti-spam address cmylod at despammed dot com
Received on Wed Dec 08 2004 - 12:15:20 CST

Original text of this message

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