olivierp has asked for the wisdom of the Perl Monks concerning the following question:
When this runs, $field_one gets clobbered by the contents of $field_three, as if $sth->fetchwere returning a hash,my $sql =<<'EOFSQL'; SELECT LOWER(field_one), field_two, UPPER(field_three) FROM sample_table (NOLOCK) WHERE field_one = ? EOFSQL my $sth = $dbh->prepare($sql) or die; my ($field_one, $field_two, $field_three); for my $test_value (@test_values) { $sth->bind_param(1, $test_value); $sth->execute; $sth->bind_columns(\$field_one, \$field_two, \$field_three); while ($sth->fetch) { print join "-", ($field_one, $field_two, $field_three); } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: DBD: bind_column behviour with multiple "unnamed" columns
by gmax (Abbot) on Aug 06, 2004 at 13:36 UTC | |
Re: DBD: bind_column behviour with multiple "unnamed" columns
by Grygonos (Chaplain) on Aug 06, 2004 at 12:46 UTC |