[Dbix-class] Arbitrary SQL + ResultSet
Ash Berlin
ash_cpan at firemirror.com
Thu Jun 19 23:07:45 BST 2008
On 19 Jun 2008, at 22:32, Jeremy Koch wrote:
>
> I am having trouble getting the results of a fairly complex query
> returned in
> a D::C::ResultSet object. Following the example found in the
> D::C::Manual:Cookbook
> "Arbitrary SQL through a custom ResultSource" doesn't work out for
> my query.
>
> Relevent query snippit:
>
> WHERE
> username NOT IN( ? )
>
> Perl snippit:
>
> my $attr = { bind => [ qw(joeuser doeuser moeuser) ] };
> my $rs = $dbic->resultset('ExportCustomer')->search( {}, $attr );
>
> The placeholder expects a single value but I need to pass in an
> unknown number of
> values. How can I express this?
>
> -Jeremy
>
$rs->search( {username => { -not_in => \@usernames } } )
More information about the DBIx-Class
mailing list