http://www.perlmonks.org?node_id=646655


in reply to DBI query where table name is a variable

I would set the query up in a scalar first, then pass it to DBI:
my $sql = "select confidence_str from $table where probeset_id = ?"; if (!$dbh->prepare($sql)) { warn "error parsing SQL: $sql\n". $dbh->errstr; return; } if (!$dbh->execute($param)) { warn "error executing SQL: $sql\nparam $param\n". $dbh->errstr; return; }
or something like it.

rdfield