Grokbase
x

Re: [Dbix-class] How to search records with "IS NOT NULL"

View PostFlat  Thread  Threaded | < Prev - Next >
Fernan Aguero Re: [Dbix-class] How to search records with "IS NOT NULL"
| +1 vote
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
|  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

Thread : [Dbix-class] How to search records with "IS NOT NULL"
1)
Ramprabhu Kaliaperumal Hi All I want something like 'SELECT * FROM employee WHERE department IS NOT NULL' I tried...
2)
Matt S Trout SQL::Abstract and DBIx::Class both treat undef as NULL. Just pass => { '!=', undef } and it'll do...
3)
Fernan Aguero | Hi All | I want something like 'SELECT * FROM employee WHERE department IS NOT NULL' | I tried...
4)
Jason Thaxter Any suggestions on how to use the overlaps operator? Using Postgresql.. I read the SQL::Abstract...
spacer
View PostFlat  Thread  Threaded | < Prev - Next >