On Wed May 11 16:09:51 2011, pedrinho@gmail.com wrote:
Show quoted text> 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
Show quoted text> 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
I understand the issue you are describing and to some extent I can see
why you have ended up with the solution you have picked. I've personally
never come across the problem the way around you describe as normally it
is a problem NOT supporting SQLDescribeParam. I appreciate if you've got
a lot of code which is written to a driver which does not support
SQLDescribeParam and so it would be annoying to change it but by
disabling SQLDescribeParam you are inevitably going to hit another issue
in the future e.g., I sincerely hope you have not got any varchar(max)
columns or you are in a world of pain. Just so you realise the implications.
I have no problem with adding a flag to disable SQLDescribeParam and I
don't need any patch from you to do it. Are you offering the patch on
the basis that you'd like this added to DBD::ODBC for the future (as a
supported feature) or are you offering this idea on the basis that you
think it might be useful for others. It is a slim difference I agree,
but if you are happy as you are and don't think it would benefit others
I'd leave it. If you'd like it as a supported feature I'll add it so
long as you are prepared to test it.
Martin
--
Martin J. Evans
Wetherby, UK