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: How Create a text File from multiple tablew with specify format ?

Re: How Create a text File from multiple tablew with specify format ?

From: HansF <news.hans_at_telus.net>
Date: Sun, 24 Oct 2004 09:34:41 GMT
Message-ID: <RGKed.41148$_u6.34118@edtnps89>


Ccnet wrote:

> I want to create a ascii file from multiple tables with specific format .
> What is missing or is wrong in the following code and in the output file
> the fields
> have the original legnth from the database and not the legnth wich say the
> substr ?
>

If I've understood your question: check out the SQLPLus 'COLUMN' command, and remember to alias your columns

COLUMN abc FORMAT A8
COLUMN def FORMAT A50

SELECT ' ',
SUBSTR(CUS.tracode,1,8) abc,
SUBSTR(LEE.LEENAME,1,50) def,
. . .

Also, and assuming you are using Oracle9i Release 2, I suggest you check chapter 7 of the SQLPLus Reference manual for more hints, especially if I've misunderstood the question!

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/toc.htm

(or go to http://docs.oracle.com or http://tahiti.oracle.com)

/Hans Received on Sun Oct 24 2004 - 04:34:41 CDT

Original text of this message

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