Re: Creating Tab-Delimited Output from Tables

From: Adrian Klingel <klingela_at_NOSPAMnt.com>
Date: Fri, 10 Jul 1998 10:27:51 -0500
Message-ID: <35A632F7.1E79978A_at_NOSPAMnt.com>


rthorne,

Look up the SQL functions LPAD and RPAD. You can accomplish what you want with these.

Adrian

rthorne_at_my-dejanews.com wrote:

> Personal Oracle 8 allows you to "Export to file": create a tab-delimited file
> that contains all rows and columns of a
> table. I need to same capability from the command line, and can't figure out
> how to get it.
>
> I've tried playing with sqlplus, which *almost* does what I want:
>
> set colsep X'09';
> SET NEWPAGE 0;
> SET SPACE 0;
> SET LINESIZE 1000;
> SET PAGESIZE 0;
> SET ECHO OFF;
> SET FEEDBACK OFF;
> SET HEADING OFF;
> spool tstout.txt;
> select * from my_table;
> exit;
> /
>
> The problem is that Oracle is padding all of my fields to their full defined
> length, rather than the actual length of the
> varchar2 fields.
>
> Is there any way to get sqlplus to stop padding the fields? Or is there a
> better tool to use to get the effect I want?
>
> Thanks!
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
Received on Fri Jul 10 1998 - 17:27:51 CEST

Original text of this message