Bug #76531 [Com]: Can't get dateTime field with Sybase 16 ODBC driver
| From: | max at e-i dot com dot ru | Date: | Sat, 07 Aug 2021 08:43:57 +0000 |
| Subject: | Bug #76531 [Com]: Can't get dateTime field with Sybase 16 ODBC driver | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-235656@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76531&edit=1
ID: 76531
Comment by: max at e-i dot com dot ru
Reported by: t dot raab at sanitas dot at
Summary: Can't get dateTime field with Sybase 16 ODBC driver
Status: No Feedback
Type: Bug
Package: ODBC related
Operating System: Windows 7
PHP Version: 7.2.7
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
OK, I think we got it, and looks like it is NOT a PHP's odbc module issue as we believed first
too - sorry about that.
I'll leave what we found here in case someone else struggles with this issue. So, the
difference between PHP's PDO and odbc_ functions subset is in their DEFAULT CURSOR settings.
It's PDO::CURSOR_FWDONLY for PDO and SQL_CURSOR_STATIC for odbc_ ones. Set it to
SQL_CURSOR_FORWARD_ONLY for odbc_ and you'll get exactly the same behavior as you have with PDO
defaults: dateTimes are OK, but unable to scroll through the result in any direction, only way
forward. The choice is yours now..
Previous Comments:
------------------------------------------------------------------------
[2021-08-05 09:40:32] cmb@php.net
Sorry, this is not actionable, unless you
| provide a minimal reproduce script and an ODBC trace of running
| that script.
------------------------------------------------------------------------
[2021-08-05 06:01:19] max at e-i dot com dot ru
Hi, we are experiencing exactly the same problem on PHP 7.4 / RHEL.
$result = odbc_exec($conn, "select dateTimeField from aTable");
print_r(odbc_fetch_array($result));
always gets empty dateTimeField value. Everything's OK with PDO though, so we would agree on
that's a PHP odbc module issue.
------------------------------------------------------------------------
[2020-10-18 04:22:14] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
------------------------------------------------------------------------
[2020-10-05 09:43:13] cmb@php.net
If this is still an issue with any of the actively supported PHP
versions[1], please update the PHP version info, provide a minimal
reproduce script and an ODBC trace of running that script.
[1] <https://www.php.net/supported-versions.php>
------------------------------------------------------------------------
[2018-06-26 08:57:10] t dot raab at sanitas dot at
Description:
------------
Dear All,
as Sybase support was dropped in PHP version 7, we are migrating our legacy application to connect
to a SYBASE ASE database via ODBC. Our application is finally working quite well with ASE 15.5.
The problem is that sooner or later the database will be updated to Sybase ASE 16 and we found that
retrieving any dateTime field with the newer Sybase 16 ODBC driver returns an empty string.
We also found that connecting via pdo_odbc retrieves the dateTime fields correctly, so we believe
the error lies in PHP's odbc module. Unfortunately switching to PDO is not an option, as it is
not possible to retrieve the field data type via PDO.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76531&edit=1