cancel
Showing results for 
Search instead for 
Did you mean: 

hdbcli>2.5 cannot bind parameters by name (Python)

michael_hadorn7
Discoverer
0 Kudos

Hi there

Since the hdbcli>=2.5 it's not possible to bind parameters by name.

In version hdbcli==2.4.202 it's still working.

With unnamed params it's working (using of ?).

I'm using conda with python 3.8 on windows.

I tested the behaviour with:

  • 2.5.111
  • 2.6.64


Minimal example:

from hdbcli import dbapi

conn = dbapi.connect(...)
cursor = conn.cursor()

sql = 'SELECT count(*) FROM sys.tables where table_name like :xx'
params = {
    'xx': '%'
}

cursor.execute(sql, params)
for row in cursor:
    print(row)

Error message:

SystemError: d:\bld\python-split_1602094606092\work\objects\dictobject.c:2469: bad argument to internal function

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "S:/cdwh-prefect/test.py", line 12, in <module>
    cursor.execute(sql, params)
SystemError: <built-in method parsenamedquery of pyhdbcli.Cursor object at 0x0000026BB89892F0> returned a result with an error set<br>

Accepted Solutions (0)

Answers (2)

Answers (2)

michael_hadorn7
Discoverer
0 Kudos

Hi

Thanks for your answer.

Where was this information posted already? (I searched a lot for this error)

Do i looked on the wrong place?

Regards

Michael

Kai_Mueller
Advisor
Advisor
0 Kudos

Hi,

I quickly verified our issue and it's reproducible. However, colleagues already reported the issue and it's expected to be fixed in the upcoming 2.7 version of the SAP HANA clients. It's planned to be release end of January.

Best regards, Kai