8/29/1999, James W. Blackwell wrote:
Is there a simple way to select a row from a table and have
variables of the names of the columns populated automagically
without having to do a fetchrow_array with all of the variables listed
before it.
In a related question, is there a way to do the opposite and have all
fields updated with the values held in the variable that represents
the column?
>Am I making any sense? Maybe someone could point me
>somewhere on the web where I could find more info on this?
It's all in 'perldoc DBI'.
I find the following sufficient for the kind of thing you want:
$hash_ref = $sth->fetchrow_hashref;
but there are also the following:
$rc = $sth->bind_col($col_num, \$col_variable);
$rc = $sth->bind_columns(\%attr, @list_of_refs_to_vars_to_bind);
$rv = $sth->bind_param($param_num, $bind_value);
$rv = $sth->bind_param($param_num, $bind_value, $bind_type);
$rv = $sth->bind_param($param_num, $bind_value, \%attr);
rkm
http://cyberjournal.org/quay_largo/