[Dbix-class] How to search records with "IS NOT NULL"
Fernan Aguero
fernan at iib.unsam.edu.ar
Tue Jul 24 18:42:42 GMT 2007
| Hi All
|
| I want something like 'SELECT * FROM employee WHERE department IS NOT NULL'
|
| I tried $schema->resultset('employee')->search({ department => {"IS" => "NOT
| NULL"}});
|
| But it is not working...
|
| Any help?
|
$rs->search( { department => { '!=', undef } } );
or
my $sql = 'IS NOT NULL';
$rs->search( { department => \$sql } )
Read the docs for SQL::Abstract
http://search.cpan.org/~nwiger/SQL-Abstract-1.22/lib/SQL/Abstract.pm
Fernan
More information about the Dbix-class
mailing list