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 > Exporting positionally

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-01-04, 09:53
Tank Tank is offline
Registered User
 
Join Date: Feb 2004
Location: Copenhagen
Posts: 220
Question Exporting positionally

AIX 5.2 DB2 8.1.4

I'm trying to export data from my DB2 table
to an ascii file - but in the guide these is no
positional export - only delimiter - which
is not satisfactory for my needs.

Has anyone encountered the samme difficulties?

- And how did you conquer them?

Cheers
__________________
Kristian K. Hansen
Project Supervisor
National Board of Health
Reply With Quote
  #2 (permalink)  
Old 06-01-04, 10:08
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Code:
export to  file.asc of del
select substr(col1, 1, 10) || substr(char(col2),1,5)) || .... from table
Basically, you generate the entire output line with SQL. The only thing you'll need to do after the export would be to strip double quotes that DB2 uses to enclose the output string.
Reply With Quote
  #3 (permalink)  
Old 06-01-04, 10:35
Tank Tank is offline
Registered User
 
Join Date: Feb 2004
Location: Copenhagen
Posts: 220
Smile Great

Thank you fella

Works like a charm!!

Cheers
__________________
Kristian K. Hansen
Project Supervisor
National Board of Health
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