in reply to Re^2: DBI binding field names as parameters
in thread DBI binding field names as parameters

You are essentially doing ...

select 2

... where you supply your own return value.

If you are going to investigate "eval" like SQL function, just prepare the query in the loop & be done with it.

Replies are listed 'Best First'.
Re^4: DBI binding field names as parameters
by sinterklaas (Initiate) on Jun 03, 2014 at 13:41 UTC
    Ok. I do see the point about how this is supplying its own return value. But in other situations where I have used this, this same code has always interpreted my params instead of 'treating them literally' (not sure if this is the right way to put it). However, could very well be a characteristic of the DB/driver, in which case I'm not sure I'm too interested to really get to the bottom of it... :) Same with "eval"; as you say; I'll just go for the solution that works for me and worry about effiency again when it really becomes a bottle neck. Thanks (again :) for taking the time to respond!

      I would be interested in knowing if & when you do find that parameterized column name query works with the posted code in OP.