MySQL Forums
Forum List  »  Stored Procedures

Re: Stored procedures utility library
Posted by: Roland Bouman
Date: November 21, 2005 08:32AM

COMMENT trouble:

No feature request (yet?) But then, how long should it a comment be?

I made myself a little utils database in which i store my stuff. This means I have to qualify my procedure calls, but I'm used to that. I'm used to working with oracle packages, so i am always calling a something.someproc(). It does not bother me anymore. In fact, if the names are well chosen, i feel it improves understandability of code.

Is there something against creating a separate database for a single set of related procedures? I guess It would simplify grants too. But yeah, you would get a lot of databases, all with no data, but only with procedures.

In addition to Giuseppes point, there's a slight problem writing procedures that are database independant. Suppose you're running a procedure, and you wnat to know the current database you'd just call....Yep, absolutely nothing at all. the built in functions DATABASE() and the synonym SCHEMA() always return the name of the database wherein the current procedure resides, NOT the current database of the session. (see and

On the other hand, I can live with very carefully specifying the database to which a call applies. Especially because you can use the SCHEMA() or DATABASE() function in the CALL on the command line, outside of the procedure:

mysql> call util.for_each(database(),'SELECT COUNT(*) FROM');

or someting like that.

BTW, any thoughts on the preferred method of installing stuff? The command line tool strips /* */ and -- comments out of procs (bad, bad bad)

Edited 1 time(s). Last edit at 11/21/2005 08:50AM by Roland Bouman.

Options: ReplyQuote

Written By
November 21, 2005 03:41AM
November 21, 2005 04:39AM
November 21, 2005 05:13AM
November 21, 2005 08:00AM
November 21, 2005 06:53AM
November 21, 2005 08:06AM
Re: Stored procedures utility library
November 21, 2005 08:32AM
November 23, 2005 11:24AM
December 03, 2005 08:37AM
November 28, 2005 02:26AM
November 29, 2005 04:28AM

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.