作者:stone | 来源:互联网 | 2023-05-16 17:44
Ihavequestionaboutpythonandsqlite3.IwanttodropatablefromwithinPython.Thecommand我对p
I have question about python and sqlite3. I want to drop a table from within Python. The command
我对python和sqlite3有疑问。我想从Python中删除一个表。命令
cur.execute('drop table if exists tab1')
Does not work.
不起作用。
cur.executescript('drop table if exists tab1;')
does the job.
做的工作。
The execute method allows the creation of tables. However, it won't drop them? Is there a reason for this?
execute方法允许创建表。但是,它不会掉落吗?是否有一个原因?
1 个解决方案