MySQL Forums
Forum List  »  Stored Procedures

Re: Where can I see list of SPs also where have my comments gone?
Posted by: Andrew Gilfrin
Date: October 25, 2005 02:36AM

Hi David,

Sorry I got a bit confused when answering your question. I need to make the distinction between in-line comments (which is what you are refering to) and MySQL's comments system.

Unfortunately in-line comments are removed from the code when it's loaded into the system, this isn't very usefull. As you say I think you need to basically create procedural scripts which contain the comments and then load those into the database. Then if you need to edit the procedure do this in the file and upload again. This might not be you way of working so you need to make a decision on what's best for you.

As for the MySQL Comments system, there is the facility to add some comment text at the top of your procedure. These can be added like so.

create function helloworld() returns varchar(20)
comment ´This is a function to return the string helloworld´
return "Hello World";

And then displayed using the show function/procedure start command.

mysql> show function status;
+-------+------------+........+--------------------------------------------------------+
| Db | Name | | Comment |
+-------+------------+........+--------------------------------------------------------+
| pers | helloworld |.........| This is a function to return the string helloworld |
+-------+------------+........+--------------------------------------------------------+
1 rows in set (0.02 sec)

Andrew Gilfrin
------------------
http://gilfster.blogspot.com
My MySQL related Blog

http://www.mysqldevelopment.com
MySQL Stored Procedure,Trigger, View.... (Just about most things these days) Information

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.