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
You can call stored procedure from select statement,To call a procedure you must use following syntax:
CALL stored_procedure_name (param1, param2, ....)
Such as, you can CALL following procedure:
DELIMITER //
CREATE PROCEDURE `procedure1`(IN var1 INT)
BEGIN
SELECT var1 + 2 AS result;
END//
as
CALL procedure1(10);
Check this site for reference: http://net.tutsplus.com/tutorials/an-introduction-to-stored-procedures/