Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2009

    Unanswered: CLP - cannot get the select query to write to a file

    Using db2 9.7 on windows vista

    I have tried numerous ways to get the SQL output to a file

    on db2 prompt=>!db2 select * from table >l:db2\sql.txt

    in the file sql.txt i get
    SQL1024N A database connection does not exist. SQLSTATE=08003

    I have run the connect to database command and got the database connect information details

    if i do
    select * from table >l:db2\sql.txt

    then the CLP gives the mesage "the command was processed as an sql statement etc"

    What do i need to do to get the CLP to send the SQL output to the file ?

    I would like to see the table data in the file from the select statement


  2. #2
    Join Date
    Jan 2003
    Provided Answers: 5
    Look at the "UPDATE COMMAND OPTIONS" CLP command in the manual.


  3. #3
    Join Date
    Apr 2006
    Provided Answers: 11
    do not use the command prompt - use command window - there all rerout can be used
    > outfile
    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

Posting Permissions

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