Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: DBI recipes

by polettix (Vicar)
on Aug 26, 2006 at 00:01 UTC ( [id://569756]=note: print w/replies, xml ) Need Help??


in reply to DBI recipes

Regarding the automatic construction of the placeholder list when dealing with insertions:
# ... my @fields = (qw(id name salary)); my $fieldlist = join ", ", @fields; my $field_placeholders = join ", ", map {'?'} @fields;
I personally prefer to avoid the map and play with the repetition operator:
my field_placeholders = join ', ', ('?') x @fields;
But I don't really know if this operator was available back in 2003 :)

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://569756]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-25 10:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found