【发布时间】:2012-02-05 05:06:24
【问题描述】:
我基本上是在尝试创建一个新数据库并根据以下内容输入数据库值:
def createindextables(self):
self.con.execute('create table urllist(url)')
self.con.execute('create table worldlist(word)')
self.con.execute('create table wordlocation(urlid,wordid,location)')
self.con.execute('create table link(fromid integer,toid integer)')
self.con.execute('create table linkwords(wordid,linkid)')
self.con.execute('create index wordidx on wordlist(word)')
self.con.execute('create index urlidx on urllist(url)')
self.con.execute('create index wordurlidx on wordlocation(wordid)')
self.con.execute('create index urltoidx on link(toid)')
self.con.execute('create index urlfromidx on link(fromid)')
self.dbcommit()
但是在运行时出现“sqlite3.OperationalError: no such table: main.wordlist Error”。我不确定为什么它无法检测到搜索数据库。它至少应该从实时编译器运行。我不知道为什么它不能正常工作。有人可以帮忙吗?
【问题讨论】:
标签: python