my $sth = $dbh->prepare_cached( "SELECT bar2 FROM foo WHERE bar1 = ?" ); $sth->bind_param( 1, 2, SQL_INTEGER ); $sth->execute();