MySQL Forums
Forum List  »  Stored Procedures

Get the schema name from inside a stored-procedure
Posted by: harry sheng
Date: July 18, 2014 11:39AM

Hi,

Is it possible to get the schema name in which the stored procedure is defined from inside the stored procedure body, so that I call the stored procedure with different "current schema" but the operation is always limited to the schema the stored procedure is defined in.

e.g.

schema1 table1 and procedure1 defined in schema1 update table1.
table1 and procedure1 are CLONE-d to schema2 and schema3.

If I login as root and with schema2 to be the current database, if I call schema1.procedure1(), I want table1 in schema1 to be updated, not table1 in schema2. If I call schema3.procedure1(), I want table1 in schema3 to be updated, not table1 in schema1, neither table1 in schema2.

Thanks

Options: ReplyQuote


Subject
Views
Written By
Posted
Get the schema name from inside a stored-procedure
4647
July 18, 2014 11:39AM


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.