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..
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'|);
$fs_name has spaces and single quotes.
And I am using selectall_arrayref instead of prepare and execute.. like this..
$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.
DBI reported string: "Server returned EXCEPTION: Failed to execute method CallMethod: DBD::ODBC::st execute failed: MicrosoftODBC SQL Server DriverSQL Server
Line 1: Incorrect syntax near 's'. (SQL-42000)