D
David K. Wall
I've been playing with SQL::Abstract, but I can't seem to get it to
generate the SQL I want. I want the following, with wildcards around
the placeholder:
WHERE ( DB_FIELD LIKE "%?%" )
OR ( DB_FIELD LIKE "%?%" )
OR ( DB_FIELD LIKE "%?%" )
The closest I've been able to get to it is this:
use SQL::Abstract;
my $test = SQL::Abstract->new( cmp => 'like' );
my ($stmt, @bind) = $test->where(
{ DB_FIELD => [qw(word1 word2 word3)] }
);
print $stmt;
which produces (formatted for usenet)
WHERE ( ( ( DB_FIELD LIKE ? )
OR ( DB_FIELD LIKE ? )
OR ( DB_FIELD LIKE ? ) ) )
I don't care about the extra parentheses one way or another.
Any ideas?
generate the SQL I want. I want the following, with wildcards around
the placeholder:
WHERE ( DB_FIELD LIKE "%?%" )
OR ( DB_FIELD LIKE "%?%" )
OR ( DB_FIELD LIKE "%?%" )
The closest I've been able to get to it is this:
use SQL::Abstract;
my $test = SQL::Abstract->new( cmp => 'like' );
my ($stmt, @bind) = $test->where(
{ DB_FIELD => [qw(word1 word2 word3)] }
);
print $stmt;
which produces (formatted for usenet)
WHERE ( ( ( DB_FIELD LIKE ? )
OR ( DB_FIELD LIKE ? )
OR ( DB_FIELD LIKE ? ) ) )
I don't care about the extra parentheses one way or another.
Any ideas?