DB::Object::ANY - ANY Operator Object
my $op = $dbh->ANY( 1, 2, 3 ); # will produce: ANY ( 1, 2, 3 ) "'something'" == $dbh->ANY( qw( some other words ) ); # 'something' ANY ( some, other, words ); "something" != $dbh->ANY( qw( some other words ) ); # 'something' NOT ANY ( some, other, words ); my $tbl = $dbh->my_table || die( $dbh->error ); $tbl->as( 't' ); my $sth = $tbl->select( 'DISTINCT field' ); my $sql = $tbl->fo->somefield == $dbh->ANY( $sth ); say $sql; # t.somefield ANY (SELECT DISTINCT t.field FROM my_table t)
This is the ANY object class inheriting from DB::Object::Operator
ANY
Takes a list of values that are saved in the newly created object returned.
Returns a string representation of this operator.
For example:
$dbh->ANY( qw( some other words ) ); # ANY ( some, other, words );
Returns ANY
In list context, returns an array of those values passed to "new" and in scalar context, it returns those value as array reference.
Objects for this class have their == and != operators overloaded.
==
!=
When overloading is called, it returns a new DB::Object::Expression that represents the formatted statement.
https://www.postgresql.org/docs/current/arrays.html#ARRAYS-SEARCHING
https://www.postgresql.org/docs/current/functions-comparisons.html#FUNCTIONS-COMPARISONS-IN-SCALAR
(There is no ANY operator in MySQL or SQLite)
Jacques Deguest <jack@deguest.jp>
Copyright (c) 2023 DEGUEST Pte. Ltd.
You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.
To install DB::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DB::Object
CPAN shell
perl -MCPAN -e shell install DB::Object
For more information on module installation, please visit the detailed CPAN module installation guide.