Re: creating tables needed for a query on-demand
"Andy Chambers" <achambers.home-gM/[email protected]>
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
> I've tried using an authorizer to do this, but the authorizer never sees
> the requested table's name, and thus can't do anything about it (at
> least not that I can see).
How about putting the query inside a try .. except block?
try:
cursor.execute("select * from foo")
except OperationalError:
cursor.execute("create table foo (bar text);")
cursor.execute("select * from foo")
Regards,
Andy