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
.



Relevant Pages

  • Re: What so special about PostgreSQL and other RDBMS?
    ... The main problem is not the right to the source code ... Who implemented ANSI PL/SQL for mysql before the mysql developers did? ... > abstraction layer that can use alternative database backends, ... It's not "low quality" as a rule, at least not as long as one reduces product ...
    (comp.lang.php)
  • Automatically migratring metadata between instances of SQL Server 2000
    ... straight from your source code. ... >(updated or new Stored Procedures and tables) from one ... >whether there is a good way of backing up the metadata ... how can I script the process of ...
    (microsoft.public.sqlserver.tools)
  • Re: How to call stored procedure using DBIx?
    ... The arbitrary-sql approach won't help since it writes sql statements in ... source code to act as stored procedures. ... Yet I don't know how to call my stored procedures directly using ...
    (comp.lang.perl.misc)
  • Re: free database server for desktop application with ado.net driv
    ... MySQL is widely known to be a GNU/linux-based project. ... compilation settings that ensues. ... > otherwise, we are discussing Windows. ... I am perfectly capable of writing AND compiling source code, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Help needed to apply Source Control to Stored Procedures
    ... Where is the source code for the stored procedures? ... VS.NET to a database server (via a database project)? ... to enable source control for stroed procedures is greyed out and I cannot ...
    (microsoft.public.vsnet.setup)