cancel
Showing results for 
Search instead for 
Did you mean: 

HANA ODBC issue from PHP - not all rows are retrieved when a specific column is selected

Former Member
0 Kudos

Hello,

I am using PHP and 32 bit ODBC to query Hana db. I have a strange behaviour. In Hana studio, a query returns 52 rows. When I run the same query from my PHP script, it retrieves zero rows. I tried to comment each column one by one in my sql and it retrieves well the 52 rows when I comment column named 'output'. When looking into this column values, I see some special Slovene characters used in user names. Is there a specific parameter which prevents to load these special characters ?

Any help is welcome.

Thanks.

Former Member
0 Kudos

Additionally, I am using:

- Windows server 2008 32 bit

- PHP 5.3.5

- Hana 1.00.122.08.1490178281

- Hana client IMDB_CLIENT100_120_54-10009665.SAR

Former Member

Hello,

I found the recommendation to use the following extension to the ODBC connection string:“CHAR_AS_UTF8=true”.

It solved my problem.

I hope it will also help others.

Cheers.

Eric.

0 Kudos

Hi Eric,

Could you please show us the example of the code in PHP on how to use the connection ODBC with the parameter CHAR_AS_UTF8=true please.

Thanks a lot.

Accepted Solutions (0)

Answers (1)

Answers (1)

lbreddemann
Active Contributor
0 Kudos

I discussed this issue in

https://stackoverflow.com/questions/38969669/why-does-sqlquery-from-sap-hana-using-rodbc-return-no-d...

The mentioned CHAR_AS_UTF8=true parameter needs to be set at the ODBC DSN, not in the client program code.