<div dir="ltr">In the package which has the source I&#39;ve defined the columns and defined an inflate_result method which blesses $self to a subclass of the package based on a type column<div><br></div><div>Currently I&#39;ve just been using a complex SQL of a union of multiple SELECTs.  However, I would like to create a temporary table or two and so I wanted to put everything into a stored proc.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 10, 2014 at 2:07 PM, Peter Rabbitson <span dir="ltr">&lt;<a href="mailto:rabbit+dbic@rabbit.us" target="_blank">rabbit+dbic@rabbit.us</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Jun 10, 2014 at 07:18:29AM -0400, Mitchell Elutovich wrote:<br>
&gt; For a customer result source, I know we can do something such as:<br>
&gt;<br>
&gt; $new_source-&gt;name( \&lt;&lt;SQL );<br>
&gt;   ( SELECT u.* FROM user u<br>
&gt;   INNER JOIN user_friends f ON <a href="http://u.id" target="_blank">u.id</a> = f.user_id<br>
&gt;   WHERE f.friend_user_id = ?<br>
&gt;   UNION<br>
&gt;   SELECT u.* FROM user u<br>
&gt;   INNER JOIN user_friends f ON <a href="http://u.id" target="_blank">u.id</a> = f.friend_user_id<br>
&gt;   WHERE f.user_id = ? )<br>
&gt;   SQL<br>
&gt;<br>
&gt; is there any restrictions on the SQL; is it possible to have the SQL just<br>
&gt; be a call to a stored procedure?<br>
<br>
</div></div>Is there a reason you want to put the sproc behind a source? Why not<br>
simply do<br>
<br>
my @results = $schema-&gt;storage-&gt;dbh_do(sub {<br>
  $_[1]-&gt;selectall_arrayref(... sproc here ... )<br>
} );<br>
<br>
Cheers<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
List: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class</a><br>
IRC: <a href="http://irc.perl.org#dbix-class" target="_blank">irc.perl.org#dbix-class</a><br>
SVN: <a href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/" target="_blank">http://dev.catalyst.perl.org/repos/bast/DBIx-Class/</a><br>
Searchable Archive: <a href="http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk" target="_blank">http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk</a><br>
</div></div></blockquote></div><br></div>