prashantktyagi has asked for the wisdom of the Perl Monks concerning the following question:
I have a generic question. I am getting error while executing a query containing spaces and single quote. I know binding value and quote function is the solution, but I want any solution in my current script.My code is like this..
$fs_name has spaces and single quotes. And I am using selectall_arrayref instead of prepare and execute.. like this..my $result = $self->get_db->query(qq|select top 1 comp,ugp,compc_rg fr +om fs_info $SQL_SELECT_HINT where fs='$fs_name'|);
$ret = $dbh->selectall_arrayref($pq); $pq-> query passed by $self->get_db->query()..
Any help how to do in this scenario. I am getting below error.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: single quote and spaces in where clause of sql query
by davido (Cardinal) on Jun 07, 2012 at 06:22 UTC |