Re: How to call stored procedure using DBIx?



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
.