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 > MySQL > about how to comment out lines in user-defined functions

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-28-08, 09:16
cy163 cy163 is offline
Registered User
 
Join Date: Apr 2007
Posts: 127
about how to comment out lines in user-defined functions

Hello ALL,


I am using MySQL 5.0.26. If I comment a single line using '//' in a user-defined function, there will be error message occurring when using 'source' to 'install' the function. The error message occurs also when the '/*' and '*/' span more than one code lines.

Why
Reply With Quote
  #2 (permalink)  
Old 11-28-08, 09:37
cy163 cy163 is offline
Registered User
 
Join Date: Apr 2007
Posts: 127
in the function, I have 'delimiter //' in the first line. i think this is the reason when using '//' as commenting-out leading symbol cause failure.

However, why '/*' and '*/' cannot be used to comment out multiple lines?
Reply With Quote
  #3 (permalink)  
Old 11-28-08, 09:47
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
offhand I'd guess because MySQL has chosen to implemnent // as thge comment symbol. after all the commentis being used in MySQL's SQL rahther than C, C++, JAVA or any of the C wannabee's

soem SQL's use --, some {, some ' each to their own...
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #4 (permalink)  
Old 11-28-08, 09:50
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
Quote:
Originally Posted by healdem
soem SQL's use --
That's the ANSI Standard for single line comments in SQL ....
Reply With Quote
  #5 (permalink)  
Old 11-28-08, 14:22
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Quote:
Originally Posted by cy163
Why
dunno... please show it
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
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