Subject: | Allow SQLDescribeParam to be disabled in DBD::ODBC |
Date: | Wed, 11 May 2011 16:09:41 -0400 |
To: | bug-DBD-ODBC [...] rt.cpan.org |
From: | "Peter C. Norton" <pedrinho [...] gmail.com> |
While transitioning from the FreeTDS odbc driver to the easysoft odbc
sql server driver, we discovered that some date/datetime strings that
are legal SQL formats are not also legal ODBC formats, and are
therefore causing errors.
Our current code (lots of it) relies on dates like '20100101' to be
inferred as YYYYMMDD and if it's passed to SQL Server as a string then
the server will DTRT (perhaps dependent on locale, I'm not sure). This
works
for Sybase and SQL Server with FreeTDS.
However, when using the easysoft driver and DBD::ODBC, the migration
processes runs into a kink: '20100101' can't be converted in the driver into
a date type, and the query fails when using prepared statements.
To disable this, I've added an option, "odbc_force_default_bind_type" that
will
disable imp_dbh->odbc_sqldescribeparam_supported. For our purposes,
I've only allowed this to be disabled and not have it re-enabled. If this
has
a place in the upstream driver let me know and I'll send you the patch.
Thanks,
-Peter