in reply to DBI question with placeholders and IN
Unless you have a fixed (or a small) 'N', it may not be worth using prepare_cached. You would have to have a '?' for every value, and use an array of values in the 'execute' like this:
For a large 'N' (or if this code is only executed once) don't use prepare_cached, and just 'prepare' every time....where some column in (" . join(',',('?') x @values) . ")" ... $sth->execute(@values) # one value for every '?' above
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: DBI question with placeholders and IN
by dragonchild (Archbishop) on Oct 01, 2002 at 14:01 UTC | |
by runrig (Abbot) on Oct 01, 2002 at 16:07 UTC | |
by dragonchild (Archbishop) on Oct 02, 2002 at 16:36 UTC | |
by runrig (Abbot) on Oct 02, 2002 at 19:22 UTC |