in reply to Re: 3 strings to join
in thread 3 strings to join

update: actually i guess Ovid's also assumes a where clause, but then again so did my original post :) but it can be easily adapted by simply using saying  else { $string = $a } at the end...

I do something very similar alot, but the problem is that this assumes there will be a where clause. I'm in a situation where there could be none or many. It's also not a whole list of things, just a few. I think Ovid's response is what I was looking for, but you have done this a bit nicer than i usually do so i'll take that too :)

-- I'm a solipsist, and so is everyone else. (think about it)

Replies are listed 'Best First'.
RE: RE: Re: 3 strings to join
by runrig (Abbot) on Sep 29, 2000 at 02:34 UTC
    If there a possibility of no where clause, then it becomes:
    my $sql = $a; ... $sql .= " where ".join(" and ", @where) if @where;
    And as for placeholders, the @args array will be empty, so there's no harm in including it in the execute.