Re: export to ascii file
Date: 1997/04/01
Message-ID: <33413EC1.260D_at_sea.ericsson.se>#1/1
Raul Sanchez wrote:
>
> Hi,
>
> I would like to know how or where I might find information on how
> to export a table to an ascii file in ORACLE (for example, in SYBASE
> I would use the following:
>
[Quoted] [Quoted] [Quoted] [Quoted] [Quoted] [Quoted]
> bcp databaseName..tableName out dataFile -c .....
>
> In order words, what is the equivalent to this statement above
> in ORACLE. Thanx for you kind help in advance.
>
> --Raul
hi,
the spool statements are OK but the "LINESIZE" option must be as long as the sum of the length of the columns of the table or the sum of the length of the columns you want to spool out
otherways you would get "n" lines instead of one per record
another option is you can concatenate the columns
separated by a character of your choice the benefit is you save
space on the filesystem -
here you also must take care of the LINESIZE option
for example
select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
select deptno||';'||dname||';'||loc||';' from dept;
10;ACCOUNTING;NEW YORK;
try this ways and compare the sizes of the two outputfiles
good luck
guenter Received on Tue Apr 01 1997 - 00:00:00 CEST
