I am trying to perform some column binding by reading the column names
of a table and binding to variables that coincide with those column
names.

Example:

-----------

$sth = $dbh->prepare( "SELECT * FROM Table" );
$sth->execute();
my $count = 1;
foreach my $bcs (@{$sth->{NAME}})
 {
        $sth->bind_col( $count, \$$bcs);
        $count++;
 }

-----------

The above works fine, however the following fails.

-----------

$sth = $dbh->prepare( "SELECT * FROM Table" );
$sth->execute();
my $BCS = '\$'.join(',\$',@{$sth->{NAME}});
$sth->bind_columns($BCS);

-----------

Can bind_columns be used in this way?

Troy

Reply via email to