If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Turn off headers and spooling output

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-10-03, 16:39
udb_devl udb_devl is offline
Registered User
 
Join Date: Oct 2003
Posts: 2
Question 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
Reply With Quote
  #2 (permalink)  
Old 10-10-03, 16:46
chuzhoi chuzhoi is offline
Registered User
 
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"
Reply With Quote
  #3 (permalink)  
Old 10-10-03, 17:04
udb_devl udb_devl is offline
Registered User
 
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!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On