cancel
Showing results for 
Search instead for 
Did you mean: 

PHP7 ODBC extension does not function properly with SAP 16 ODBC Driver

0 Kudos

Hello everyone,

Our application is PHP-based (version 7.2). Unfortunately, since version 7, the PHP have dropped the native Sybase database driver, so our App uses now the ODBC extension. That's why I have also asked this question: https://answers.sap.com/questions/558574/support-for-sap-ase-extenion-module-for-php.html

While the ODBC driver of Sybase version 15.5 seems to work reasonably well, the ODBC driver delivered with SAP version 16 makes troubles. We cannot retrieve any database field of type: datetime, big- and smalldatetime. What we are receiving is an empty string.

Are there any similar cases or workarounds reported?

Many thanks.

Accepted Solutions (1)

Accepted Solutions (1)

ryan_hansen
Employee
Employee
0 Kudos

KBA# 2670776

This is an issue with cursors between PHP and SAP ODBC Driver.

You can modify the php.ini file:
odbc.default_cursortype = SQL_CURSOR_STATIC

or

ODBC dsn > general tab > check use cursors

Regards,
Ryan

Answers (1)

Answers (1)

ryan_hansen
Employee
Employee
0 Kudos

Hi,

I haven't seen an issue with the ODBC driver with these fields.
Could be the translator between our driver and the php module.

I would run an ODBC trace to make sure the data is coming back correctly.

Windows you can turn this on in the Data source administrator trace tab.

Linux/Unix using unixODBC:

cat odbcinst.ini
[ODBC] Trace = yes
TraceFile = /sybase/ase/syb16sp03pl04/DataAccess/ODBC/sql.log
[Adaptive Server Enterprise] Driver = /sybase/ase/syb16sp03pl04/DataAccess64/ODBC/lib/libsybdrvodb.so
FileUsage = -1
UsageCount = 7


If you want to send me a simple sample and the ODBC translator for php7 I can try to find something.
Ryan.Hansen@sap.com

Regards,
Ryan