Mutant has asked for the wisdom of the Perl Monks concerning the following question:

Maybe I'm missing something in the SQL::Abstract docs, but I can't seem to find a way of creating the following in a where clause:
col_name = function(?)
You can do this for the columns of an insert (from the docs: ["to_date(?,'MM/DD/YYYY')", "03/02/2003"]), but this doesn't work as part of the where clause.

I can hard code it as a string, but then I have to manually add the value to @bind array, which doesn't seem to be the right way to do things.

Anyone done this before?

Replies are listed 'Best First'.
Re: SQL::Abstract - where clause values that are functions
by mreece (Friar) on Sep 12, 2006 at 21:32 UTC
    i don't think it can be done with a placeholder without munging @bind on your own. the alternative is to do the quoting and interpolation yourself, and skip placeholders here.
      Adding stuff to @bind is not really an option, I don't think. The problem is the where clause could be built in any order, so you don't know where to put the value in @bind.

      I guess I'll use your second suggestion. Thanks.