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 > commenting multiple lines

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-17-05, 14:06
mohd mohd is offline
Registered User
 
Join Date: Jul 2003
Posts: 63
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
Reply With Quote
  #2 (permalink)  
Old 02-17-05, 15:08
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
  #3 (permalink)  
Old 02-17-05, 16:22
mohd mohd is offline
Registered User
 
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
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