On Dec 28, 2007, at 3:59 AM, Tony Winslow wrote:
Hi, all!
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?
From DBIx::Class::Manual::Cookbook:
Arbitrary SQL through a custom ResultSource
Sometimes you have to run arbitrary SQL because your query is
too
complex (e.g. it contains Unions, Sub-Selects, Stored
Procedures, etc.)
or has to be optimized for your database in a special way, but
you
still want to get the results as a DBIx::Class::ResultSet. The
recommended way to accomplish this is by defining a separate
ResultSource for your query. You can then inject complete SQL
statements using a scalar reference (this is a feature of
SQL::Abstract).
--
Jason Kohles, RHCA RHCDS RHCE
[EMAIL PROTECTED] - http://www.jasonkohles.com/
"A witty saying proves nothing." -- Voltaire
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]