Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2004
    Posts
    111

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

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

  3. #3
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11

    format

    asc is for windows only - you could use previous hint or delimited - del
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  4. #4
    Join Date
    Oct 2005
    Location
    pune(india)
    Posts
    24
    Use

    Export to file.csv of del select * from tablename

  5. #5
    Join Date
    Sep 2004
    Posts
    111
    >>>>>

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

    Select *... works for Fixed format.

    Thanks Gang
    -R

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

Posting Permissions

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