[Dbix-class] custom result source calling a stored procedure

Sheeju Alex sheejuec7 at gmail.com
Wed Jun 11 02:02:25 GMT 2014


The best way to execute your stored proc is to get the database handle and
call stored proc, for more details see here

https://metacpan.org/pod/DBIx%3a%3aClass%3a%3aStorage%3a%3aDBI#dbh_do


Best Regards,
Sheeju Alex


On Tue, Jun 10, 2014 at 10:13 PM, Mitchell Elutovich <melutovich at gmail.com>
wrote:

> Will misunderstood my question instead of the SELECT ...
>
> can I do something like?
>
> $new_source->name( \<<SQL );
> call mystoredproc(?);
> SQL
>
>
>
>
> On Tue, Jun 10, 2014 at 7:59 AM, Will Crawford <billcrawford1970 at gmail.com
> > wrote:
>
>> $users->search (
>>  [
>>   { 'user_friends.user_id' => $id },
>>   { 'user_friends.friend_user_id' => $id }
>>  ], {
>>   join => 'user_friends'
>>  }
>> )->all
>>
>>
>>
>> On 10 June 2014 12:18, Mitchell Elutovich <melutovich at gmail.com> wrote:
>> > For a customer result source, I know we can do something such as:
>> >
>> > $new_source->name( \<<SQL );
>> >   ( SELECT u.* FROM user u
>> >   INNER JOIN user_friends f ON u.id = f.user_id
>> >   WHERE f.friend_user_id = ?
>> >   UNION
>> >   SELECT u.* FROM user u
>> >   INNER JOIN user_friends f ON u.id = f.friend_user_id
>> >   WHERE f.user_id = ? )
>> >   SQL
>> >
>> > is there any restrictions on the SQL; is it possible to have the SQL
>> just be
>> > a call to a stored procedure?
>> >
>> > _______________________________________________
>> > 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/dbix-class@lists.scsys.co.uk
>>
>> _______________________________________________
>> 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/dbix-class@lists.scsys.co.uk
>>
>
>
> _______________________________________________
> 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/dbix-class@lists.scsys.co.uk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20140611/c074fb3f/attachment-0001.htm>


More information about the DBIx-Class mailing list