George_Sherston has asked for the wisdom of the Perl Monks concerning the following question:
So my question is (A) can I force a hash slice to have an element for every key I feed it? or (B) is there some other cute way to do what I want? Thanks, all.my $placeholders = '?,' x @cols; chop $placeholders; my $cols = join ',', @cols; my $sth = $dbh->prepare("INSERT INTO venue ($cols) VALUES ($placeholde +rs)") or die $dbh->errstr; $sth->execute(@vals);
2001-12-11 Edit by Corion : Fixed a </CODE> tag
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash slice to get DB values - include undefined values?
by demerphq (Chancellor) on Dec 11, 2001 at 19:48 UTC | |
by George_Sherston (Vicar) on Dec 11, 2001 at 19:55 UTC | |
by demerphq (Chancellor) on Dec 11, 2001 at 20:00 UTC | |
|
Re: Hash slice to get DB values - include undefined values?
by mortis (Pilgrim) on Dec 11, 2001 at 19:49 UTC |