MySQL Forums
Forum List  »  Stored Procedures

Re: Get the schema name from inside a stored-procedure
Posted by: harry sheng
Date: July 20, 2014 05:45PM

I intend to call the stored procedure on MySQL startup to manage table data, but the databases I have are not pre-determined.

I think the real issue I have is that I need to access the information_schema.routines to find out in what databases I have created the stored procedure and then call the procedure against the database it is created in.

So I have to construct dynamic 'USE {database}' statement to change the current database before calling the procedure; but the dynamic USE statement is not allowed in MySQL.

As a workaround, I can pass in the database name to the procedure. It works, but just want to check if there's better ways to do it.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Get the schema name from inside a stored-procedure
1915
July 20, 2014 05:45PM


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.