0
나는 SQL 쿼리에 변수로 테이블 이름을 전달하고 SQLAlchemy의 커서를 실행하려고 :SqlAlchem y의 mysql을 매개 변수화 된 쿼리
from sqlalchemy.sql import text
cur = DB_ENGINE.connect()
p = cur.execute(text('select * from :table'), {'table':'person'}).fetchall()
print p
나는이 오류 메시지가 있어요 :
ProgrammingError: (_mysql_exceptions.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''person'' at line 1") [SQL: u'select * from %s'] [parameters: ('person',)]
나 잘못 했니?
감사합니다. –