On Mon, Mar 10, 2003 at 03:47:31PM -0800, Jeff Zucker wrote:
> Paul Boutros wrote:
>
> >my $sql = qq{
> > INSERT INTO table
> > ( ${\comma_separated_values(@col)} )
> > VALUES ( ${\comma_separated_placeholders(@col)} )
> >};
> >
>
> I'm not sure I like this, but if it is to be used, a better name might
> be "comma_list" which is the BNF short notation for all comma separated
> lists in SQL (e.g. select lists, value lists, etc.). Also, no reason to
> have two routines or to call them twice -- have the first set an
> attribute and then later read it. For example the call to
> $dbh->comma_list() would both return a comma separated list of the
> column names and set $dbh->{placeholders} to a string of comma separated
> placeholder marks which could be used later without a second call to a
> method:
>
> my $sql = qq{
> INSERT INTO table
> ( $dbh->comma_list(@col) )
> VALUES ( $dbh->{placeholders} )
> };
Method calls don't interpolate, and I'm really not keen on relying
on the order they are called.
Tim.