my $pr1 = qq{select customer_name from customer where id = $emp_id }; my $sth1 = $dbh->prepare($pr1); $sth1->execute(); $cust_id; $sth1->bind_columns( undef, \$cust_id );