Re: [newbie]How to call stored procedure using DBIx?




Quoth Tony Winslow <tonywinslow1986@xxxxxxxxx>:
Peter Scott wrote:
On Fri, 28 Dec 2007 22:58:25 +0800, Tony Winslow wrote:
The env: Catalyst, DBIx::Class, MySQL
If I can get a $dbh from what I already have from DBIx::Class, the
problem can be solved. Yet I can figure out a way to get it.

See DBIx::Class::Storage::DBI:

$schema->storage->dbh

I tried it and got the following error:

DBI Exception: DBD::mysql::st execute failed: OUT or INOUT argument 1
for routine MyWikiDB.countRevs is not a variable or NEW pseudo-variable
<snip>

Part of my codes:
my $dbh = $c->model('MyWikiDB')->schema->storage->dbh;
my $sth = $dbh->prepare("CALL countRevs(?)");
my $cnt;
$sth->bind_param(1, \$cnt);

Use ->bind_param_inout instead.

Ben

.