Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Former Member

    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.

  • 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.

  • Get RSS Feed

1 Answer

  • Feb 26 at 11:26 PM

    I discussed this issue in

    https://stackoverflow.com/questions/38969669/why-does-sqlquery-from-sap-hana-using-rodbc-return-no-data-if-request-18-or-more/

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

    Add comment
    10|10000 characters needed characters exceeded