Найти - Пользователи
Полная версия: Вопрос по sqlite3
Начало » Python для новичков » Вопрос по sqlite3
1
ayb
Здравствуйте. Есть функция
def update_unit(name, expiredate, new_quantity):
    connection = sqlite3.connect('aybdb-edb')
    cursor = connection.cursor()
    cursor.execute('UPDATE main SET quantity=:new_quantity WHERE name=:name and expiredate=:expiredate', {'new_quantity': new_quantity, 'name': name, 'expiredate': expiredate})
    connection.commit()
    connection.close()

При выполнение получаю ошибку - sqlite3.InterfaceError: Error binding parameter :name - probably unsupported type.

В таблице все поля TEXT
py.user.next
def update_unit(name, expiredate, new_quantity):
    print(type(name))
    ...
ayb
Спасибо, вопрос решен
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB