Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2003
    Location
    Texas
    Posts
    5

    Unanswered: 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

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: How to suppress comments in DB2

    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
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    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

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    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.

  5. #5
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: How to suppress comments in DB2

    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-
    ---
    "It does not work" is not a valid problem statement.

  6. #6
    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



    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-

  7. #7
    Join Date
    Jul 2002
    Location
    ATL
    Posts
    170
    If you know what your unwanted output is then use grep -v command

  8. #8
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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...
    ---
    "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
  •