in reply to Re: DBI - I can't use bind variables with "like"?
in thread DBI - I can't use bind variables with "like"?

I don't see how the query plan would be any better with instr() instead of LIKE. Neither would be able to take advantage of any index (except maybe a complete scan of the index, which is not much better than a sequential scan of the table). Let me know if I'm mistaken :-)

Also, you can somewhat get around typing repeated placeholder arguments as long as the corresponding ?'s are consecutive by something like:$sth->execute( ($var) x 3 )

Update: Also, if the database doesn't determine the query plan at prepare() time, then it might be able to use an index on a 'LIKE ?' if the argument doesn't begin with a wild card (but that is not the case with the OP).