ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rishi007bansod <rishi007ban...@gmail.com>
Subject Error while passing arraylist as argument to INSERT data into Ignite cache using pyodbc
Date Sat, 20 May 2017 20:32:21 GMT
I have written following code to insert data into Ingite cache from python
using ODBC driver. In this want to pass arraylist of strings(id_list) as
argument. My list contains variable number of elements that is why I need to
pass it as argument to query.

cursor = connection.cursor()
select_string= "INSERT INTO Person (_key, id,  firstName, lastName, salary)
VALUES (322, ? , 'abcd', 'dhsagd', 1000)"

id_list = ['test1', 'test2', 'test3', 'test4']
cursor.execute(select_string, id_list)

But when I pass list of strings as parameter to query I am getting following

Traceback (most recent call last):
  File "pythonOdbclist.py", line 13, in <module>
    cursor.execute(select_string, id_list)
pyodbc.ProgrammingError: ('The SQL contains 0 parameter markers, but 4
parameters were supplied', 'HY000')

View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Error-while-passing-arraylist-as-argument-to-INSERT-data-into-Ignite-cache-using-pyodbc-tp13049.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message