views:

158

answers:

1

From a stored procedure or function in a given MySQL database, is it possible to reference a stored procedure or function in another MySQL database, as follows?

SELECT 
    some_table.field1,
    some_table.field2,
    another_database.STORED_PROCEDURE(arg), 
    ...
FROM ...
WHERE ...
+2  A: 

Yes, you can, just prefix them with the database name.

BTW: What you're showing is a stored function. For stored procedures you must use CALL and they can't return a value.

Jaka Jančar