Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #36861
| References | <a8e71415-57fc-4284-82fe-fae0a6670a67@googlegroups.com> <mailman.540.1358260620.2939.python-list@python.org> <2fce91ea-374c-4f55-9e53-fe4032c2f5fd@googlegroups.com> |
|---|---|
| Date | 2013-01-15 17:13 +0000 |
| Subject | Re: sqlite3 puzzle |
| From | Rob Day <robert.day@merton.oxon.org> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.544.1358269996.2939.python-list@python.org> (permalink) |
On 15 January 2013 15:51, llanitedave <llanitedave@veawb.coop> wrote:
> Thanks for the suggestion, Rob, but that didn't make any difference. I've never had an issue with putting the execute object into a variable and calling "fetch" on that variable.
>
> I can accept reality if it turns out that foreign keys simply isn't enabled on the Python distribution of sqlite, although I don't know why that should be the case. I'm just curious as to why it worked at first and then stopped working.
Well - you might be able to accept that, but I'm not sure I can! If it
was working before, it must be compiled in, and so it must be possible
to make it work again.
http://www.sqlite.org/foreignkeys.html#fk_enable seems to suggest that
"PRAGMA foreign_keys = ON" never returns anything, and it's only
"PRAGMA foreign_keys" which returns 0, 1 or None (when unsupported).
With that in mind, does the following code work?
# open database file
self.geologger_db = sqlite3.connect('geologger.mgc')
self.db_cursor = self.geologger_db.cursor()
self.db_cursor.execute("PRAGMA foreign_keys = ON")
self.db_cursor.execute("PRAGMA foreign_keys")
print self.db_cursor.fetchone()
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
sqlite3 puzzle llanitedave <llanitedave@veawb.coop> - 2013-01-14 23:09 -0800
Re: sqlite3 puzzle Rob Day <robert.day@merton.oxon.org> - 2013-01-15 14:36 +0000
Re: sqlite3 puzzle llanitedave <llanitedave@veawb.coop> - 2013-01-15 07:51 -0800
Re: sqlite3 puzzle Rob Day <robert.day@merton.oxon.org> - 2013-01-15 17:13 +0000
Re: sqlite3 puzzle llanitedave <llanitedave@veawb.coop> - 2013-01-15 12:29 -0800
Re: sqlite3 puzzle Rob Day <robert.day@merton.oxon.org> - 2013-01-15 22:27 +0000
Re: sqlite3 puzzle llanitedave <llanitedave@veawb.coop> - 2013-01-15 14:46 -0800
Re: sqlite3 puzzle llanitedave <llanitedave@veawb.coop> - 2013-01-15 14:46 -0800
Re: sqlite3 puzzle llanitedave <llanitedave@veawb.coop> - 2013-01-15 12:29 -0800
Re: sqlite3 puzzle llanitedave <llanitedave@veawb.coop> - 2013-01-15 07:51 -0800
Re: sqlite3 puzzle inq1ltd <inq1ltd@inqvista.com> - 2013-01-15 11:54 -0500
csiph-web