Задать вопрос
@mandico

Как исправить ошибку с исправление данных?

Выдает такую ошибку, когда пытаюсь обновить данные в SQl
код могу предоставить

Traceback (most recent call last):
  File "C:\Users\Bekzod\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 388, in _process_polling_updates
    for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
  File "C:\Users\Bekzod\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 225, in process_updates
    return await asyncio.gather(*tasks)
  File "C:\Users\Bekzod\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify
    response = await handler_obj.handler(*args, **partial_data)
  File "C:\Users\Bekzod\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 246, in process_update
    return await self.message_handlers.notify(update.message)
  File "C:\Users\Bekzod\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify
    response = await handler_obj.handler(*args, **partial_data)
  File "d:\Programming\Python\C8\bot.py", line 46, in enter_update_treshka
    user = db.select_user(id=message.from_user.id)
  File "d:\Programming\Python\C8\sqlite.py", line 65, in select_user
    return self.execute(sql, parameters, fetchone=True)
  File "d:\Programming\Python\C8\sqlite.py", line 21, in execute
    cursor.execute(sql, parameters)
sqlite3.OperationalError: near "=": syntax error
  • Вопрос задан
  • 146 просмотров
Подписаться 1 Простой 3 комментария
Решения вопроса 1
Wispik
@Wispik
в format_args добавь print(sql) и посмотри, какой запрос формируется во время ошибки
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
@mandico Автор вопроса
Вот что выдает
D:\Programming>C:/Users/Bekzod/AppData/Local/Programs/Python/Python39/python.exe d:/Programming/Python/C8/bot.py
INFO:aiogram:Bot: dadabaevbot [@dadabaevbot]
WARNING:aiogram:Updates were skipped successfully.
INFO:aiogram.dispatcher.dispatcher:Start polling.
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-18' coro=<Dispatcher._process_polling_updates() done, defined at C:\Users\Bekzod\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\dispatcher\dispatcher.py:380> exception=OperationalError('no such table: Users')>
Traceback (most recent call last):
  File "C:\Users\Bekzod\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 388, in _process_polling_updates     
    for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
  File "C:\Users\Bekzod\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 225, in process_updates
    return await asyncio.gather(*tasks)
  File "C:\Users\Bekzod\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify
    response = await handler_obj.handler(*args, **partial_data)
  File "C:\Users\Bekzod\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 246, in process_update
    return await self.message_handlers.notify(update.message)
  File "C:\Users\Bekzod\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify
    response = await handler_obj.handler(*args, **partial_data)
  File "d:\Programming\Python\C8\bot.py", line 45, in enter_update_treshka
    db.update_treshka(treshka=treshka, id=message.from_user.id)
  File "d:\Programming\Python\C8\sqlite.py", line 77, in update_treshka
    return self.execute(sql, parameters=(treshka, id), commit=True)
  File "d:\Programming\Python\C8\sqlite.py", line 21, in execute
    cursor.execute(sql, parameters)
sqlite3.OperationalError: no such table: Users
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы