Skip to Content.
Sympa Menu

freetds - Re: [freetds] DBI::SQL_DATETIME - Invalid data type (SQL-HY004)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Martin J. Evans" <martin.evans AT easysoft.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] DBI::SQL_DATETIME - Invalid data type (SQL-HY004)
  • Date: Mon, 19 Mar 2012 08:49:07 +0000

On 18/03/12 21:13, Bower, Wayne (Wayne) wrote:
I attached a test case showing a failure to recognize the DBI::SQL_DATETIME
type using perl 5.14.1, DBI 1.616, DBD::ODBC 1.33 with freeTDS 0.91 and
unixODBC on Linux.

The 1st attachment (test_sql_types.pl) is the script that demonstrates the
problem.

And the 2nd attachment (test_sql_types.log) is from
DBI_TRACE=15=test_sql_types_dbi.log ./test_sql_types.pl>test_sql_types.log
2>&1

And the 3rd attachment (test_sql_types_dbi.log) is the DBI_TRACE output.

The script creates a procedure with input parameters of different types and
executes it resulting in the following error:
DBD::ODBC::st bind_param failed: [FreeTDS][SQL Server]Invalid data type
(SQL-HY004)

If I specify DBI::SQL_DATETIME as the type it fails with this error, but if I
change the type to DBI::SQL_TIMESTAMP it works. It also works if I do not
specify the type. In fact we have changed to not specifying the type because
this seems to work well for any parameter type.

I'm not sure if you would consider this a bug or if I overlooked something in
the documentation about the SQL_DATETIME data type.

The DBD::ODBC developer already reviewed this and believes the issue to be
with FreeTDS if it is one.

That is not exactly what I said:

https://rt.cpan.org/Ticket/Display.html?id=75699

I actually pointed out it happens with the MS SQL Server ODBC driver too.

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com




Archive powered by MHonArc 2.6.24.

Top of Page