Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    Copenhagen
    Posts
    220

    Question Unanswered: 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

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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.

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •