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

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

From: Ccnet <vaggoscc_at_hol.gr>
Date: Sun, 24 Oct 2004 11:33:54 +0300
Message-ID: <clfp9p$qr5$1@newsmaster.public.dc.hol.net>


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 ?

SET HEADING OFF;
SET PAGESIZE 0;
SET LINESIZE 201;
SET TERM ON;
SET FEEDBACK OFF;
SET SPACE 0;
SPOOL C:\CUST.TXT
SELECT ' ',
SUBSTR(CUS.tracode,1,8),

SUBSTR(LEE.LEENAME,1,50),
RPAD(LEE.LEENAME,30,' '),
LPAD(LEE.LEENAME,30,'_'),
SUBSTR(LEE.LEEAFM,1,12), ' ',
SUBSTR(LEE.txocode,1,4),' ',
SUBSTR(ADR.adrstreet,1,26), ' ',
SUBSTR(ADR.ADRNUMBER,1,4), ' ',

SUBSTR(ADR.ADRZIPCODE,1,5),
SUBSTR(ADR.adrcity,1,20), SUBSTR(ADR.adrphone1,1,20) FROM CUS,LEE,ADR
WHERE CUS.LEEID=LEE.LEEID AND
CUS.adridmain=ADR.adrid;

SPOOL OFF; Received on Sun Oct 24 2004 - 03:33:54 CDT

Original text of this message

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