如何修复“此错误的背景,网址为:http://sqlalche.me/e/e3q8”?

时间:2019-04-18 09:09:11

标签: sql python-3.x database

我已经使用Python编写了以下代码

from sqlalchemy import Table,create_engine,String,Float,Integer,Column,MetaData 
engine = create_engine('sqlite:///college.db',echo = True)
meta = MetaData() 
Players = Table('Players',meta,
                Column('name',String),
                Column('number',Integer),
                Column('Speed',Float))
meta.create_all(engine) 
conn = engine.connect() 
from sqlalchemy.sql.expression import update  
up = update(Players).where(Players.name == 'Rolnando').values(name = 'Messi') 
s = Players.select() conn.execute(s)

但是我遇到了以下异常

  

文件   “ C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ sqlalchemy \ engine \ default.py”,   do_execute中的509行       cursor.execute(语句,参数)sqlalchemy.exc.OperationalError:(sqlite3.OperationalError)否这样   列:Players.number [SQL:'SELECT“ Players” .name,“ Pla   yers“ .number,” Players“。” Speed“ \ nFROM” Players“'](此背景   错误:http://sqlalche.me/e/e3q8

为什么会收到此错误以及如何解决?

0 个答案:

没有答案