die $db_handle->errstr; my $sth = $dbh->prepare('SELECT * FROM table WHERE column LIKE ("%"?"%") LIMIT 1') or $error = "$db_handle->errstr"); my $rv = $sth -> execute($column_value); #### if ($error) {do something}