I am trying to call a user defined stored procedure from a select statement and its giving me an error. However when I call a system procedure it works just fine. Is there a way to call a user defined procedure from a select statement. This is for mysql
SELECT ID, email FROM user PROCEDURE simpleproc();
give me an error ERROR 1106 (42000): Unknown procedure ‘simpleproc’
mysql> call simpleproc();
Query OK, 0 rows affected (0.21 sec)
where as
SELECT ID, email FROM user PROCEDURE ANALYSE();
works
You can call stored procedure from select statement,To call a procedure you must use following syntax:Such as, you can CALL following procedure:
as
Check this site for reference: http://net.tutsplus.com/tutorials/an-introduction-to-stored-procedures/