If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > spool file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-28-10, 09:23
hasya05 hasya05 is offline
Registered User
 
Join Date: Jan 2010
Posts: 23
spool file

Hi all

i am using spool file option like below
spool c:\tmp_vehdetl
set heading off
set pages 0
select VDPOLN||'|'||VDRENN||'|'||VDSEQN||'|'||VDVEHN||'|' ||VDVRSQ||'|'||VDVHYR||'|'||VDMAKC||'|'||VDMODC||' |'||VDSMDC||'|'||VDBDCD||'|'||VDTYPE||'|'||VDVINN| |'|'||VDSYMB||'|'||VDPSYM||'|'||VDRTER||'|'||VDISC D||'|'||VDSYDM||'|'||VDDRVN||'|'||VDWTCL||'|'||VDV USE||'|'||VDVUBC||'|'||VDRDUS||'|'||DUMMYDRV||'|'| |VDAMIL FROM TMP_VEHDETL;
SPOOL OFF;

for that i am getting file like below


8054897|0|0|5|5|1981|PORSCH|928 |----- |ACOUPE|V|WP0JA0928BS820582 |
99|0|999||N|0||P||0||500

8054898|0|0|1|1|1975|CHEVRO|IMPALA |----- |A4DRSD|V|1L69H5J206 |
99|0|0||T|0||P||0||500

8054899|0|0|1|1|2008|HYUNDA|VERACRUZG |LS/SE/LIMI|M4DR4W|V|KM8NU73C08 |
99|0|0||T|0||P||0||40000

8054899|0|0|2|2|2005|CHRYSL|PT CRUISER|----- |CNVT |V|3C3EY55E25T290644 |
99|0|0||N|0||P||0||45000

8054900|0|0|1|1|2008|MITSUB|OUTLANDER |XLS |M4DR4W|V|JA4MT41X78Z001871 |
99|0|0||N|0||P||0||50000

8054900|0|0|2|2|2005|TOYOTA|COROLLA |CE/LE |A4DRSD|V|JTDBR32E05 |
99|0|0||N|0||P||0||60000

8054901|0|0|1|1|2002|INFINI|QX4 |----- |M4DR2W|V|JNRDR09X02 |
99|0|0||N|0||P||0||5000

8054902|0|0|1|1|1998|HONDA |CIVIC |EX |ACOUPE|V|1HGEJ8247WL |
99|0|0||N|0||P||0||7000



i am getting gaps between one record to other and also i am getting some gaps between columns
how to get data with out any gaps ,i mean no gap between each record and column and also i wanted to get the data one record with 24 columns in one line like that


please advise me...

Thanks in advance!!
Reply With Quote
  #2 (permalink)  
Old 01-28-10, 09:46
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,448
Try "set linesize 1024", or whatever number is suitable in your situation.
Reply With Quote
  #3 (permalink)  
Old 01-28-10, 09:47
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,455
Cool User gaps

You do have extra spaces in your delimiters, try this to avoid gaps:
Code:
spool c:\tmp_vehdetl
set heading off pages 0 lin 1024 trims on
SELECT VDPOLN||'|'||VDRENN||'|'||VDSEQN||'|'||VDVEHN||'|'||VDVRSQ||'|'
     ||VDVHYR||'|'||VDMAKC||'|'||VDMODC||'|'||VDSMDC||'|'||VDBDCD||'|'
     ||VDTYPE||'|'||VDVINN||'|'||VDSYMB||'|'||VDPSYM||'|'||VDRTER||'|'
     ||VDISCD||'|'||VDSYDM||'|'||VDDRVN||'|'||VDWTCL||'|'||VDVUSE||'|'
     ||VDVUBC||'|'||VDRDUS||'|'||DUMMYDRV||'|'||VDAMIL
  FROM TMP_VEHDETL;
SPOOL OFF;

PS: apart from N_I's suggestion.
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Last edited by LKBrwn_DBA; 01-28-10 at 09:50. Reason: Adding n_i's suggestion
Reply With Quote
  #4 (permalink)  
Old 01-28-10, 10:49
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,448
rtrim() on each selected character column may also be in order.
Reply With Quote
  #5 (permalink)  
Old 02-02-10, 09:41
hasya05 hasya05 is offline
Registered User
 
Join Date: Jan 2010
Posts: 23
Thanks it woeked!!!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On