Hi,
I want to call MySQL stored procedure in perl. I have tried like this:
use DBI;
my $create_procedure = qq{
CREATE PROCEDURE simpleproc ()
BEGIN
SELECT 'helloworld' As Messgae;
END
};
$dbh->do($create_procedure);
$sql = "CALL simpleproc()";
my $sth = $dbh->prepare($sql);
$sth->execute();
I am getting an error which i am not able to debug. I am not sure if i need to specify delimiter.
DBD::mysql::st execute failed: PROCEDURE test.simpleproc can't return a result s
et in the given context at try.pl line 24.
The output should be like this:
+--------------+
| Message |
+--------------+
| Hello world! |
+--------------+
1 row in set (0.00 sec)
How can i get the above output in Perl?
Help is very much appreciated.
Thanks