Skip Menu |
 

This queue is for tickets about the DBD-ODBC CPAN distribution.

Report information
The Basics
Id: 75699
Status: resolved
Priority: 0/
Queue: DBD-ODBC

People
Owner: Nobody in particular
Requestors: Wayne.Bower [...] lsi.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



From Wayne.Bower [...] lsi.com Sun Mar 11 17: 30:18 2012
MIME-Version: 1.0
X-Spam-Status: No, score=-1.235 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, SPF_SOFTFAIL=0.665] autolearn=no
X-Spam-Flag: NO
Acceptlanguage: en-US
X-Virus-Checked: Checked by ClamAV on 16.mx.develooper.com
Content-Language: en-US
Content-Type: multipart/mixed; boundary="_004_70DBE4460F072F47B78C59D72821D37102CA246D94palmail02lsic_"
Message-ID: <70DBE4460F072F47B78C59D72821D37102CA246D94 [...] palmail02.lsi.com>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-MS-Tnef-Correlator:
X-Spam-Score: -1.235
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id C9BF92400D4 for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Sun, 11 Mar 2012 17:30:18 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x8-XbMt0MKIe for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Sun, 11 Mar 2012 17:30:18 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 513C32400BA for <bug-DBD-ODBC [...] rt.cpan.org>; Sun, 11 Mar 2012 17:30:17 -0400 (EDT)
Received: (qmail 9340 invoked by uid 103); 11 Mar 2012 21:30:16 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 11 Mar 2012 21:30:16 -0000
Received: from na3sys009aog126.obsmtp.com (HELO na3sys009aog126.obsmtp.com) (74.125.149.155) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Sun, 11 Mar 2012 14:30:13 -0700
Received: from paledge01.lsi.com ([192.19.193.42]) (using TLSv1) by na3sys009aob126.postini.com ([74.125.148.12]) with SMTP ID DSNKT10ZYSCxLRDdy6EeBe9bKa8tfKmmItvR [...] postini.com; Sun, 11 Mar 2012 14:30:12 PDT
Received: from PALCAS01.lsi.com (128.94.213.117) by PALEDGE01.lsi.com (192.19.193.42) with Microsoft SMTP Server (TLS) id 8.3.213.0; Sun, 11 Mar 2012 17:35:17 -0400
Received: from palmail02.lsi.com ([128.94.233.45]) by PALCAS01.lsi.com ([128.94.213.117]) with mapi; Sun, 11 Mar 2012 17:30:08 -0400
Delivered-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
Subject: DBI::SQL_DATETIME - Invalid data type (SQL-HY004)
Return-Path: <Wayne.Bower [...] lsi.com>
X-RT-Mail-Extension: dbd-odbc
X-Original-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
Thread-Index: Acz/ziE36gAhLey+QneBLXXYIG6mlg==
Date: Sun, 11 Mar 2012 17:30:07 -0400
X-Spam-Level:
X-MS-Has-Attach: yes
Thread-Topic: DBI::SQL_DATETIME - Invalid data type (SQL-HY004)
Accept-Language: en-US
To: "bug-DBD-ODBC [...] rt.cpan.org" <bug-DBD-ODBC [...] rt.cpan.org>
From: "Bower, Wayne (Wayne)" <Wayne.Bower [...] lsi.com>
Content-Length: 0
content-type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: us-ascii
Content-Length: 1105
While testing our code with DBD::ODBC 1.33 I found a case that is failing. 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. This is using perl 5.14.1, DBI 1.616, DBD::ODBC 1.33 with freeTDS 0.91 and unixODBC on Linux. 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. Thank you, Wayne Bower
Content-Description: test_sql_types.pl
content-type: application/octet-stream; name="test_sql_types.pl"
content-disposition: attachment; creation-date="Sun, 11 Mar 2012 21:29:38 GMT"; filename="test_sql_types.pl"; modification-date="Sun, 11 Mar 2012 21:18:08 GMT"; size="3013"
Content-Transfer-Encoding: base64
Content-Length: 3013
Download test_sql_types.pl
text/x-perl 2.9k

Message body is not shown because sender requested not to inline it.

Content-Description: test_sql_types.log
content-type: application/octet-stream; name="test_sql_types.log"
content-disposition: attachment; creation-date="Sun, 11 Mar 2012 21:29:55 GMT"; filename="test_sql_types.log"; modification-date="Sun, 11 Mar 2012 21:17:03 GMT"; size="3190"
Content-Transfer-Encoding: base64
Content-Length: 3190
Download test_sql_types.log
application/octet-stream 3.1k

Message body not shown because it is not plain text.

Content-Description: test_sql_types_dbi.log
content-type: application/octet-stream; name="test_sql_types_dbi.log"
content-disposition: attachment; creation-date="Sun, 11 Mar 2012 21:30:03 GMT"; filename="test_sql_types_dbi.log"; modification-date="Sun, 11 Mar 2012 21:17:03 GMT"; size="34497"
Content-Transfer-Encoding: base64
Content-Length: 34497
Download test_sql_types_dbi.log
application/octet-stream 33.6k

Message body not shown because it is not plain text.

MIME-Version: 1.0
In-Reply-To: <70DBE4460F072F47B78C59D72821D37102CA246D94 [...] palmail02.lsi.com>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <70DBE4460F072F47B78C59D72821D37102CA246D94 [...] palmail02.lsi.com>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-12231-1331580122-325.75699-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 2149
On Sun Mar 11 17:30:19 2012, Wayne.Bower@lsi.com wrote: Show quoted text
> While testing our code with DBD::ODBC 1.33 I found a case that is > failing. > > 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. > > This is using perl 5.14.1, DBI 1.616, DBD::ODBC 1.33 with freeTDS 0.91 > and unixODBC on Linux. > > 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. > > Thank you, > Wayne Bower
freeTDS is throwing this out as: DBD::ODBC::st bind_param failed: [unixODBC][FreeTDS][SQL Server]Invalid data type (SQL-HY004) at rt_75699.pl line 91. I'm not definitely saying it is wrong but it fails with other SQL Server ODBC drivers too. MS SQL Server is funny with datetime types and it does not surprise me a timestamp works. When I ran this against the MS SQL Server driver on Windows I got: exec TMP_SP_Test_ODBC using SQL_DATETIME causes Invalid data type (SQL-HY004) DBD::ODBC::st bind_param failed: [Microsoft][ODBC SQL Server Driver]Optional fe ture not implemented (SQL-HYC00) at rt_75699.pl line 91. Issuing rollback() due to DESTROY without explicit disconnect() of DBD::ODBC::d handle asus2 at rt_75699.pl line 91. I don't see any error in DBD::ODBC here. It is a straight forward call to SQLBindParameter which is failing. Martin -- Martin J. Evans Wetherby, UK
From Wayne.Bower [...] lsi.com Wed Mar 14 11: 33:19 2012
MIME-Version: 1.0
X-Spam-Status: No, score=-1.235 tagged_above=-99.9 required=10 tests=[AWL=0.000, BAYES_00=-1.9, SPF_SOFTFAIL=0.665] autolearn=no
In-Reply-To: <rt-3.8.HEAD-12231-1331580123-1548.75699-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
Acceptlanguage: en-US
References: <RT-Ticket-75699 [...] rt.cpan.org> <70DBE4460F072F47B78C59D72821D37102CA246D94 [...] palmail02.lsi.com> <rt-3.8.HEAD-12231-1331580123-1548.75699-6-0 [...] rt.cpan.org>
Content-Language: en-US
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <70DBE4460F072F47B78C59D72821D37102CA247079 [...] palmail02.lsi.com>
Content-Type: text/plain; charset="utf-8"
X-MS-Tnef-Correlator:
X-RT-Original-Encoding: utf-8
X-Spam-Score: -1.235
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 1FD9A2400A4 for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Wed, 14 Mar 2012 11:33:19 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zE8yUzgTItJ5 for <cpan-bug+DBD-ODBC [...] hipster.bestpractical.com>; Wed, 14 Mar 2012 11:33:17 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 9EDAB240031 for <bug-DBD-ODBC [...] rt.cpan.org>; Wed, 14 Mar 2012 11:33:17 -0400 (EDT)
Received: (qmail 17720 invoked by uid 103); 14 Mar 2012 15:33:16 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 14 Mar 2012 15:33:16 -0000
Received: from na3sys009aog116.obsmtp.com (HELO na3sys009aog116.obsmtp.com) (74.125.149.240) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Wed, 14 Mar 2012 08:33:09 -0700
Received: from paledge01.lsi.com ([192.19.193.42]) (using TLSv1) by na3sys009aob116.postini.com ([74.125.148.12]) with SMTP ID DSNKT2C6MO5W9hrenvTBOMaipafqJkHhoRp2 [...] postini.com; Wed, 14 Mar 2012 08:33:09 PDT
Received: from PALHUB01.lsi.com (128.94.213.114) by PALEDGE01.lsi.com (192.19.193.42) with Microsoft SMTP Server (TLS) id 8.3.213.0; Wed, 14 Mar 2012 11:38:06 -0400
Received: from palmail02.lsi.com ([128.94.233.45]) by PALHUB01.lsi.com ([128.94.213.114]) with mapi; Wed, 14 Mar 2012 11:33:02 -0400
Delivered-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
Subject: RE: [rt.cpan.org #75699] DBI::SQL_DATETIME - Invalid data type (SQL-HY004)
Return-Path: <Wayne.Bower [...] lsi.com>
Thread-Index: Ac0AhWmaDGwbiugxQaGwfHYZOkCJUQBcMLxA
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+DBD-ODBC [...] hipster.bestpractical.com
X-RT-Mail-Extension: dbd-odbc
Date: Wed, 14 Mar 2012 11:33:02 -0400
X-Spam-Level:
Thread-Topic: [rt.cpan.org #75699] DBI::SQL_DATETIME - Invalid data type (SQL-HY004)
X-MS-Has-Attach:
To: "bug-DBD-ODBC [...] rt.cpan.org" <bug-DBD-ODBC [...] rt.cpan.org>
Accept-Language: en-US
Content-Transfer-Encoding: base64
From: "Bower, Wayne (Wayne)" <Wayne.Bower [...] lsi.com>
RT-Message-ID: <rt-3.8.HEAD-10809-1331739199-987.75699-0-0 [...] rt.cpan.org>
Content-Length: 1386
Download (untitled) / with headers
text/plain 1.3k
<URL: https://rt.cpan.org/Ticket/Display.html?id=75699 > On Mon Mar 12 15:22:05 2012, Martin J Evans via RT bug-DBD-ODBC@rt.cpan.org wrote: Show quoted text
> freeTDS is throwing this out as: > > DBD::ODBC::st bind_param failed: [unixODBC][FreeTDS][SQL Server]Invalid > data type (SQL-HY004) at rt_75699.pl line 91. > > I'm not definitely saying it is wrong but it fails with other SQL Server > ODBC drivers too. > > MS SQL Server is funny with datetime types and it does not surprise me a > timestamp works. > > When I ran this against the MS SQL Server driver on Windows I got: > > exec TMP_SP_Test_ODBC using SQL_DATETIME causes Invalid data type > (SQL-HY004) > DBD::ODBC::st bind_param failed: [Microsoft][ODBC SQL Server > Driver]Optional fe > ture not implemented (SQL-HYC00) at rt_75699.pl line 91. > Issuing rollback() due to DESTROY without explicit disconnect() of > DBD::ODBC::d > handle asus2 at rt_75699.pl line 91. > > I don't see any error in DBD::ODBC here. It is a straight forward call > to SQLBindParameter which is failing.
Interesting that the MS SQL Server driver on Windows doesn't handle properly either, so not sure if I'll bother posting to FreeTDS list. I will work around this by not specifying DBI::SQL_TIMESTAMP or not specifying the type, which seems to work well in all of the cases I've tried thus far. Thank you, Wayne Bower


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.