in reply to Re^2: Error with DBI and Strawberry Perl under 64 bit W7
in thread Error with DBI and Strawberry Perl under 64 bit W7
Nah, you don't need the concatenation operators. That's why I put the map in there. I think you're getting stuck on making the SQL concatenate the strings together, rather than letting perl do it for you.
Think of it this way, you get a list of artists to search for:
my @inc_artists = ( 'Watson', 'Cline', 'Horne' );
The first chunk of code would generate an SQL statement that looks like:
SELECT SongTitle, SongPath FROM Songs WHERE (Songs.Artist LIKE ?) OR (Songs.Artist LIKE ?) OR (Songs.Artist LIKE ?)
The map statement with the execute wraps your artist names with the '%' symbols you want, so they end up look like:
( '%Watson%', '%Cline%', '%Horne%' );
Finally, the execute statement would effectively have a statement like:
SELECT SongTitle, SongPath FROM Songs WHERE (Songs.Artist LIKE '%Watson%') OR (Songs.Artist LIKE '%Cline%') OR (Songs.Artist LIKE '%Horne%')
which is what I think you want to feed to SQLite.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Error with DBI and Strawberry Perl under 64 bit W7
by Mad_Mac (Beadle) on Mar 13, 2011 at 17:33 UTC |