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 > How to suppress comments in DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-28-03, 11:51
hemanth07 hemanth07 is offline
Registered User
 
Join Date: Sep 2003
Location: Texas
Posts: 5
How to suppress comments in DB2

Hi,

when i run db2 in unix i get the following comments, please suggest me how to suppress the comments.

If u see in the below statements after giving the command "db2", it has displayed the comments like "(c) Copyright IBM Corporation 1993,2002", is there a way to suppress those messages.

$ db2

(c) Copyright IBM Corporation 1993,2002
Command Line Processor for DB2 SDK 8.1.2

You can issue database manager commands and SQL statements from the command
prompt. For example:
db2 => connect to sample
db2 => bind sample.bnd

For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
? CATALOG DATABASE for help on the CATALOG DATABASE command
? CATALOG for help on all of the CATALOG commands.

To exit db2 interactive mode, type QUIT at the command prompt. Outside
interactive mode, all commands must be prefixed with 'db2'.
To list the current command option settings, type LIST COMMAND OPTIONS.

For more detailed help, refer to the Online Reference Manual.

db2 =>


Thanks somuch in advance
Hemanth
Reply With Quote
  #2 (permalink)  
Old 10-28-03, 13:34
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Re: How to suppress comments in DB2

Quote:
Originally posted by hemanth07
Hi,

when i run db2 in unix i get the following comments, please suggest me how to suppress the comments.

If u see in the below statements after giving the command "db2", it has displayed the comments like "(c) Copyright IBM Corporation 1993,2002", is there a way to suppress those messages.

$ db2

(c) Copyright IBM Corporation 1993,2002
Command Line Processor for DB2 SDK 8.1.2

You can try issuing:

$ db2 >/dev/null
Reply With Quote
  #3 (permalink)  
Old 10-28-03, 17:43
db2os390udbdba db2os390udbdba is offline
Registered User
 
Join Date: Oct 2003
Posts: 8
Re: How to suppress comments in DB2

user this option


db2 UPDATE COMMAND OPTIONS USING C OFF


that will supress comments SQL output


Let me know if any questions


--Raju
Reply With Quote
  #4 (permalink)  
Old 10-29-03, 02:15
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: How to suppress comments in DB2

There may not be any way to suppress the initial copyright information ...

If you have any problems because of this, please be specific why you want to suppress it

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #5 (permalink)  
Old 10-29-03, 10:27
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Re: How to suppress comments in DB2

Quote:
Originally posted by db2os390udbdba
user this option


db2 UPDATE COMMAND OPTIONS USING C OFF


that will supress comments SQL output


Let me know if any questions


--Raju
I think the "c" option turns off auto-commit.

Actually, I just checked and it's the "p" options that does the trick.

$ db2 -p-
Reply With Quote
  #6 (permalink)  
Old 10-29-03, 12:30
hemanth07 hemanth07 is offline
Registered User
 
Join Date: Sep 2003
Location: Texas
Posts: 5
Re: How to suppress comments in DB2

Here is the script which i'm using to get a value from the stored function and i want to do some manipulation in the unix

rs=`db2 -tc +pw <<!
values erd1dbo.getactdmdbo();
quit;
! > `
echo $rs

Output
--------

ERD1DBO DB20000I The QUIT command completed successfully.

as u see from the above output, the "P" option suppress the comments when the command "db2" is execured, but still in the above script the "quit" command displays "DB20000I The QUIT command completed successfully" into the screen. Is there a way to suppress that too.

Thanks
Hemanth



Quote:
Originally posted by n_i
I think the "c" option turns off auto-commit.

Actually, I just checked and it's the "p" options that does the trick.

$ db2 -p-
Reply With Quote
  #7 (permalink)  
Old 10-29-03, 18:01
koganti koganti is offline
Registered User
 
Join Date: Jul 2002
Location: ATL
Posts: 170
If you know what your unwanted output is then use grep -v command
Reply With Quote
  #8 (permalink)  
Old 10-29-03, 18:49
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally posted by koganti
If you know what your unwanted output is then use grep -v command
There's also an "o" option of the command line processor. And, while we are at it, instead of redirecting commands to the processor's standard input stream it is possible to tell it to execute commands from a file (with an "f" option), which would totally solve the original problem of unwanted copyright message...

Sometimes I wonder if I'm the only person in the world who reads product manuals...
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