Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    2

    Question Unanswered: Turn off headers and spooling output

    Hi,

    We are using DB2 Universal Database Ver 7 Fix Pack 10.

    1. How can I turn off the headers in a SELECT query? That is, running something like this, from the command line-

    db2 connect
    db2 "SET HEADER OFF" (What's the equivalent command?)
    db2 "SELECT COLUMN1, COLUMN2 FROM TABLE"

    2. How can I spool the output of a SELECT query? That is, running something like this, from the command line-

    db2 connect
    db2 "SPOOL output.log" (What's the equivalent command?)
    db2 "SELECT COLUMN1, COLUMN2 FROM TABLE"

    Thanks.

    -UDB developer

  2. #2
    Join Date
    Dec 2002
    Posts
    134

    Re: Turn off headers and spooling output

    Check the command options of the db2 processor (db2 list command options). In particular -x and r or z. Those parameters can be preset via DB2OPTIONS variable

    To supress the header
    db2 -x "values 10"

  3. #3
    Join Date
    Oct 2003
    Posts
    2

    Thumbs up

    The following command options did the trick -

    db2 -x -z output.log "SELECT COLUMN1, COLUMN2 FROM TABLE"

    Thank you!

Posting Permissions

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