Re: Flat file, non-fixed column dump of SELECT?

From: Simon Hedges <shedges_at_hhhh.freeserve.co.uk>
Date: Mon, 25 Oct 1999 13:51:54 +0100
Message-ID: <7v1jg2$ecd$1_at_news6.svr.pol.co.uk>


Mike Accetta <mja_at_cs.cmu.edu> wrote in message news:7v0iq0$g0p$1_at_goldenapple.srv.cs.cmu.edu...
> Is there any existing Oracle tool that can be used to dump the
> columns returned from a select statement into an file formatted as
> unpadded lines of variable length fields separated by a distinguished
> character like '|'?
>
> SQL Plus comes close with the options indicated in the manual for
> making a flat file dump, but I can't find anything to stop padding of
> either the columns or the line to fixed widths.

Using SQL*Plus you need to change your select statement. If, for example you have a table YOURTABLE with two columns: COLUMNA and COLUMNB,
you would need to use sql as follows:

[Quoted] SELECT     COLUMNA||','||COLUMNB
FROM        YOURTABLE;

This should do it. Don't forget to TO_CHAR any number or date columns.

Simon Hedges
Gloucester
UK Received on Mon Oct 25 1999 - 14:51:54 CEST

Original text of this message