Re: Stored procedures utility library
There is one more thing that we should take into account when talking about general purpose stored routines, i.e. to which database such routines should be linked.
Unfortunately, in MySQL SP language, each routine belongs to a database, and although you can invoke a routine with the db_name.routine_name syntax, each action performed by the routine itself is intended for the default database, unless the programmer is very careful to specify database name and table name for each operation.
For instance, if I have a for_each stored procedure that will execute one query for each table, I would like to use it from any database. To do so, I need to store the routine in a free-for-all database, and invoke it from the database where I want it to work, taking great care at qualifying my intended command with db name and table names.
Alternatively, I can store the routine in each database I am using, and this is a sort of inconvenience when I need to update
the routine, for I need to update it everywhere.
I had a chat about this limitation with some MySQL developers in Frankfurt, during the open source database conference early this month, but nobody sees this situation improving anytime soon.
This is more food for thought. General purpose routines are not to be attached to a single database, so this problem is quite real for almost every routine in my collection as of today.
ciao
Giuseppe
Subject
Views
Written By
Posted
5928
November 21, 2005 03:41AM
2790
November 21, 2005 04:39AM
2527
November 21, 2005 05:13AM
2691
November 21, 2005 08:00AM
2851
November 21, 2005 06:53AM
Re: Stored procedures utility library
2757
November 21, 2005 08:06AM
2560
November 21, 2005 08:32AM
7941
November 23, 2005 11:24AM
2623
November 29, 2005 10:36PM
2674
December 03, 2005 08:37AM
2549
November 28, 2005 02:26AM
2646
November 29, 2005 04:28AM