MySQL Forums
Forum List  »  Perl

Re: Perl calling MYSQL 5 stored procedure
Posted by: Daniel Nichter
Date: August 21, 2005 08:33PM

Thanks for the patch. Could you tell me about your setup because, although calling the SP w/ the patch works on my setup, it only works once. Doing something like:
$dbh = DBI->connect("DBI:mysql:;host=localhost;mysql_multi_results=1", foo, bar) or die;

$query = $dbh->prepare("CALL whatever (1, 2)");
$query->execute();
while(@rows = $query->fetchrow_array()) { ... }
$query->finish();

$query = $dbh->prepare("SELECT * FROM whatever;");
$query->execute();

The second execute() will die w/ the error message: DBD::mysql::st execute failed: Lost connection to MySQL server during query at ...

I'm using DBI 1.48 and have tried DBD-mysql 3.0002 and 2.9006. MySQL standard RPM 5.0.11 beta. The SP is a single SELECT statement like:
CREATE PROCEDURE whatever (d INT, id INT)
SELECT * FROM table WHERE ymd=d AND foo=id;

Options: ReplyQuote


Subject
Written By
Posted
Re: Perl calling MYSQL 5 stored procedure
August 21, 2005 08:33PM


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.