Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Posts
    63

    Unanswered: commenting multiple lines

    Hi

    I have sql file to create multiple tables, i want to comment some of them
    spanning multiple lines.

    what is the special character used to comment multiple lines.
    like we use for oracle

    /* these are commented
    lines and will be ignored
    */
    I am running this script file from command window but when i use /* and */ it is executing all the stmts.
    Thx
    Mohd

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    A '--' at the beginning of the line is used as the comment for SQL within SQL scripts..

    In SQL PL you can use /* and */

    Cheers
    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Jul 2003
    Posts
    63
    Hi satyaram
    Thx for the reply

    for single line comment -- is working fine,
    But for multiple lines if i use /* and */ its not getting commented and executing the lines.

    is there any thing i am missing.

    just to make it more clear here it goes

    I have a sample.out file containing these stmts

    Drop table abc;
    drop table xyz;

    /*
    Drop table pqr;
    drop table fgh;
    */
    Drop table stu;

    when i execute this file from command window like
    c:\> db2 -tvf sample.out

    its is executing all the statements.

    Thx
    Mohd

Posting Permissions

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