Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: SQLite and large number of parameters

by moritz (Cardinal)
on Dec 10, 2012 at 11:53 UTC ( #1008090=note: print w/replies, xml ) Need Help??


in reply to SQLite and large number of parameters

Not sure if it's faster, but you could always try not using placeholders:

my $sql = sprintf q[ SELECT * FROM my_table WHERE col_1 IN (%s) AND col_2 IN (%s) ], join(', ', @$set_1), join(', ', @$set_2);

If you can't be sure that they are all integers, be sure to map then through $dbh->quote first.

Replies are listed 'Best First'.
Re^2: SQLite and large number of parameters
by menth0l (Monk) on Dec 10, 2012 at 13:40 UTC
    Thanks for suggestion, I will try that.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1008090]
help
Chatterbox?
thezip is randomly reminded of Hugo's_house_of_ho rrors
[LanX]: such much?

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (14)
As of 2017-03-24 18:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (305 votes). Check out past polls.