Re: DBI/SQL question
- From: "J. Gleixner" <glex_no-spam@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 15 Mar 2006 10:08:30 -0600
Robert Hicks wrote:
I have a large array of numbers that I need to use in an update SQL
statement using a "like" clause.
my @nums = ( 123 456 789 ); # it is much larger
foreach my $num (@nums) {
$dbh->do(q{update table_name set item_desc1 = item_desc2 where
equip like # I draw a blank here
}
I am not sure how to use the $num in a like since a like is '%' and it
I do '%$num' that won't be interpolated.
The '%' isn't the issue.
Use qq instead of q. Check the documentation in: perldoc perlop
This should help you see the difference.
my $num = 22;
print q{ equip like '%$num' }, "\n";
print qq{ equip like '%$num' }, "\n";
.
- References:
- DBI/SQL question
- From: Robert Hicks
- DBI/SQL question
- Prev by Date: Re: GD::copyResampled problem on activestate perl
- Next by Date: Re: Perl translation needed for simple bat file
- Previous by thread: Re: DBI/SQL question
- Index(es):
Relevant Pages
|