Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2007
    Posts
    130

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

  2. #2
    Join Date
    Apr 2007
    Posts
    130
    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?

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    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 on the Tiger 800 or the Norton

  4. #4
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by healdem
    soem SQL's use --
    That's the ANSI Standard for single line comments in SQL ....

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by cy163
    Why
    dunno... please show it
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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