in reply to Re: Passing a value into a WHERE clause
in thread Passing a value into a WHERE clause

In a way it seems as though using a variable in the creation a sql-DBI prepare statement such as in the example in this thread is an oxymoron. Can you get away with not incuring the overhead of re-executing the execution plan each time even though you are changing your actual sql statement via a variable which alters the statement itself?

No. When you change the statement, you need to re-prepare, and hence replace.

What you can do is cache statement handles based on what field name you've decided to plug in to the query. In theory, you then bite off the overhead of preparing (and query planning) only once per statement.

  • Comment on Re: Re: Passing a value into a WHERE clause