Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: beginner - unload tables with fix length?

Re: beginner - unload tables with fix length?

From: wysza <awysza_at_yahoo.com>
Date: Fri, 09 Feb 2001 02:21:25 GMT
Message-ID: <FuIg6.2296$R45.642349@typhoon2.ba-dsg.net>

sql>col id format 99999999
sql>col name format a30
sql>set linesize 200  <-- size of the line, so that one record fits in one
line
sql>set pagesize 2000 <-- number of records in a table so that you don't see header every xx lines
sql>spool filename
sql>select * from emp;

        ID NAME

-------- -------------------------------
          1 miller
          2 smith

sql>spool off

It goes like this:
col COL_NAME format [if the col_type is number then here goes digits, if the col_type is string then here goes aX, where X=width]

hth
wysza

"Christof Müller" <christof.mueller_at_andaro.com> wrote in message news:3A834E69.47DA4CAE_at_andaro.com...
> Here my example:
> create emp (id number(12), name varchar2(30))
>
> I would like to extract the table and the only way I currently know is:
> spool xxx
> Select id||';'||name||';' from emp;
> spool off
>
> The result is:
> miller;1
> smith;2
>
> But I wouldn't like to have ';' separated fields but fix length (length
> of
> column definitions:
> miller 1
> smith 2
> Can anybody tell me how to deal with the problem?????
>
Received on Thu Feb 08 2001 - 20:21:25 CST

Original text of this message

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