my $sql = qq{SELECT * FROM mytable WHERE mytableid = ?}; my $sth = $dbh->prepare ($sql); $sth->execute ($mytableid_value);