[Tutor] flask/sqlite3 problem - 'OperationalError: no such table'?
Alan Gauld
alan.gauld at btinternet.com
Wed Sep 18 23:34:12 CEST 2013
On 18/09/13 18:13, Timo wrote:
>> You are trying to execute on the database rather
>> than on a cursor. You need to create a cursor
>> first to hold your results.
>>
>> Something like;
>>
>> cur = g.db.cursor()
>> cur.execute(.....)
> Not really.
>
> sqlite3.connect() returns a sqlite3.Connection object which has a
> execute method. It will create a cursor object for you.
Interesting.
I didn't know that, I've always created a separate cursor
explicitly. But that's probably because I'm used to
Oracle which requires me to do that from C++
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos
More information about the Tutor
mailing list