Subject: | DBIx::Class::Storage::DBI pod |
Date: | Sat, 22 Sep 2018 13:33:32 +0100 |
To: | bug-DBIx-Class [...] rt.cpan.org |
From: | Steve Rogerson <steve [...] yewtc.demon.co.uk> |
The documentation for quote_char says ...
for SQL Server you should use |quote_char => [qw/[ ]/]|
|[I guess the "SQL Server" means Microsoft SQL Server".]
|
|I dont think is correct. I've been using MSSQL through ODBC and the above and
I have a problem. The MSSQL database that I have no control over has a column
name with a single quote in it "edets no PR's" to be precise. The space and
the mixed case are ok, but when trying to retrieve data with that column
results in ....|
|
|
|Can't bind unknown placeholder '1' at
/usr/share/perl5/vendor_perl/DBIx/Class/Storage/DBI.pm line 1891. at
/usr/share/perl5/vendor_perl/DBIx/Class/Schema.pm line 1118.
|
|[The error shown I'm pretty sure as a minor screw up of the error returned by
DBI which is something like '1 placeholder found when 0 are expected' ].|
|What's happening is the ODBC is trying to quote the column name, but it know
nothing about the quote char (which I think is only used by SQL::Abstract). It
uses the result of
|
|$dbh->get_info(29) #SQL_IDENTIFIER_QUOTE_CHAR
|
|[well that's not strictly true, but that's a matter for DBD::ODBC]|
|Anyway the effect of the single quote is to screw up the parsing of the sql
string, losing the "= ?" into the column def.|
|As in this case the SQL_IDENTIFIER_QUOTE_CHAR is double quotes ("), and this
works I suspect that this should be used.|
|
|
|Steve
|
||
||
||