Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Posts
    24

    Question Unanswered: How do i put comment in DB2 UDB 7.2

    Hi there,

    I have many SQL script for future reference, but wish to put every detail comment to each part of the SQL passes,

    --- put comment here !
    select *
    from tableA
    join
    tableB
    on tableA.student_ID = tableB.student_ID

    what is the symbol need to be used?

    i know DB2400 is using /* bla bla bla */ but not sure in DB2 UDB 7.2
    Hello

  2. #2
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    Command is put with two '--'.
    Sample:
    Code:
    -- put comment here ! 
    select * 
    from tableA 
    join 
    tableB
    on tableA.student_ID = tableB.student_ID
    But your command should also work, because '---' it also beggins with '--'.

    Hope this helps,
    Grofaty
    Last edited by grofaty; 02-25-05 at 04:43.

  3. #3
    Join Date
    Mar 2004
    Posts
    24
    HI Grofaty,

    i had try to put '--' put in return me this error

    "<eb1>SQL0198N The statement string of the PREPARE or EXECUTE IMMEDIATE statement is blank or empty. SQLSTATE=42617

    State:42617,Native:-198,Origin:[IBM][CLI Driver][DB2/6000]</eb1>"
    Hello

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    Where is your script saved? In file? Where are you trying to execute command? What is your OS? os/400 and database as/400?

  5. #5
    Join Date
    Mar 2004
    Posts
    24
    my script is save on my local machine, i am query from my machine to the database server in windows 2000 server DB2 UDB 7.2 and my machine os is Win 2K pro
    Hello

  6. #6
    Join Date
    Feb 2002
    Posts
    6
    Assuming your script is saved in a file called sql.clp, you can run the script from command line by doing 'db2 -vf sql.clp'. As mentioned the prefix '--' is used for comments. How are you executing the script ?

    -- comment here
    select *
    from tableA
    join
    tableB
    on tableA.student_ID = tableB.student_ID

Posting Permissions

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