in reply to Re: inserting in a database
in thread inserting in a database

Just be sure to do a $identifier[$eu] = $dbh->quote( $identifier[$eu] ); before you prepare ;)

Replies are listed 'Best First'.
3Re: inserting in a database
by jeffa (Bishop) on Nov 25, 2003 at 13:20 UTC
    ... or use place holders instead:
    my $sth = $dbh->prepare(" INSERT INTO dd VALUES(?,?) "); $sth->execute($identifier[$eu],'Feature');
    and let the module do intelligent quoting and provide statement caching for you (like hmerrill provided). Kudos to Taulmarill, however, for using
    for my $eu (0..$#identifier) {
    instead of
    for (my $eu = 0; $eu <= (scalar(@identifier)); $eu++) {

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)