[Dbix-class] [newbie]How to call stored procedure?(doc already
read)
Tony Winslow
tonywinslow1986 at gmail.com
Fri Dec 28 14:55:42 GMT 2007
Jason Kohles wrote:
> 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).
>
I've read it a great many times!
But I can't figure out a way to do it.
Would you please make it more detailed?
More information about the DBIx-Class
mailing list