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

    Unanswered: CLP - cannot change DB2OPTIONS

    I am runnig db2 9.7 on Vista

    I want to send the output of a query from the CLP to a file in a specific directory

    However if I put a backslash in the file redirect i get an error
    example: select * from table1>C:mydir\output.txt

    Also I do not seem to be able to set the DB2OPTIONS on

    example: -r (save output to a report file) is set to off - i cannot set it on
    what command do i need to use to change the default

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


  3. #3
    Join Date
    Jan 2007
    Jena, Germany
    Use a forward slash. That's the path separator on unix systems, and Windows understands that as well.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  4. #4
    Join Date
    Nov 2009

    Thanks for the Help - i worked out what I needed to do - answer below

    On the CLP command line

    to get output to file from windows vista
    !db2 connect to stage1 user blue using xxxx;
    !db2 select * from stag1.grade > "l:boots\testx.txt"

  5. #5
    Join Date
    Jun 2003
    Toronto, Canada
    Provided Answers: 1
    I think Howardw tries to redirect query output from within CLP, so no amount of slashes will help.

    @Howardw, this can be done from the command line:

    db2 "select * from table1">C:\mydir\output.txt


    db2 -r C:\mydir\output.txt "select * from table1"
    "It does not work" is not a valid problem statement.

Posting Permissions

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