Re: How to call stored procedure using DBIx?



On Dec 28, 10:51 am, Tony Winslow <tonywinslow1...@xxxxxxxxx> wrote:
smallpond wrote:
On Dec 28, 9:58 am, Tony Winslow <tonywinslow1...@xxxxxxxxx> wrote:
Peter Scott wrote:
On Fri, 28 Dec 2007 21:19:06 +0800, Tony Winslow wrote:
I've stored procedures defined in my database schema, and I need to call
them in my code.
The arbitrary-sql approach won't help since it writes sql statements in
source code to act as stored procedures. So could I do that in DBIx?
DBIx::What? In DBI, with a DBD::Oracle driver, I call stored procedures
with a database handle thus:
$dbh->do( "Begin somepackage.someprocedure; End;" );
It's picky about the semicolons.
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.

DBI is the generic database interface. To connect to MySQL you
need the DBD::mysql module.
http://search.cpan.org/~capttofu/DBD-mysql-4.006/lib/DBD/mysql.pm

--S

Of course, I've installed it.
I can connect to MySQL using DBIx::Class, and it runs smoothly.
Yet I don't know how to call my stored procedures directly using
the the API provided by DBIx::Class rather than that of DBI.

Oh. I found this:
http://www.perlmonks.org/?node_id=625709
.



Relevant Pages