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 > DB2 > Export in Fixed format.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-20-06, 09:54
udbraja udbraja is offline
Registered User
 
Join Date: Sep 2004
Posts: 111
Arrow Export in Fixed format.

Team,
DB2 V8.1 fp11 AIX

We are trying to figure out what is the best way to export data from a db2 table in a fixed format?

Previously we used to have ASC format of export.
Now looks like it has been removed from db2.

>db2 "export to B.asc of asc select * from employee"
SQL0104N An unexpected token "asc" was found following "OF". Expected tokens may include: "IXF". SQLSTATE=42601

Thanks,
R
Reply With Quote
  #2 (permalink)  
Old 04-20-06, 10:40
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
An option is to do

db2 -x "select * from t1" > file.asc

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 04-21-06, 03:20
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
format

asc is for windows only - you could use previous hint or delimited - del
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #4 (permalink)  
Old 04-21-06, 07:26
sinwar sinwar is offline
Registered User
 
Join Date: Oct 2005
Location: pune(india)
Posts: 24
Use

Export to file.csv of del select * from tablename
Reply With Quote
  #5 (permalink)  
Old 04-21-06, 14:37
udbraja udbraja is offline
Registered User
 
Join Date: Sep 2004
Posts: 111
>>>>>

File.csv.... and del .... does not work.

Select *... works for Fixed format.

Thanks Gang
-R
Reply With Quote
  #6 (permalink)  
Old 04-21-06, 14:39
udbraja udbraja is offline
Registered User
 
Join Date: Sep 2004
Posts: 111
Select * works if the rows are smaller size.

If the table has 96 columns and spread over unix limit of 258. Then we have a problem and we have to think about different approach.

Thanks Team
-R
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