Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
Fixed parameters tuple access with unicode index (#98)
Browse files Browse the repository at this point in the history
On executing context for a prepared statement which calls parameterized
functions, stored procedures, etc. HANA returns parametermetadata
containing the parameters name as id. On execution cursor.py used this
id for index access to the parameters tuple. Now an enumeration is used
to get the position of the current parameter/parametermetadata and for
access to the parameters tuple.
  • Loading branch information
spartan057 authored and jarus committed Feb 16, 2018
1 parent 618c674 commit e33f4b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyhdb/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __next__(self):
if len(parameters) != len(self._params_metadata):
raise ProgrammingError("Prepared statement parameters expected %d supplied %d." %
(len(self._params_metadata), len(parameters)))
row_params = [self.ParamTuple(p.id, p.datatype, p.length, parameters[p.id]) for p in self._params_metadata]
row_params = [self.ParamTuple(p.id, p.datatype, p.length, parameters[i]) for i, p in enumerate(self._params_metadata)]
self._iter_row_count += 1
return row_params

Expand Down

0 comments on commit e33f4b8

Please sign in to comment.