Gadfly question
matthew
matthew at newsgroups.com
Tue May 20 20:05:16 EDT 2003
Hi,
I've installed and been playing around quickly with Gadfly. I'm abit
mystified as to why the field order appears different in the tuple
returned from fetchall() from the table definition. I'm a pyhobbyist so
I'm no expert but this anomaly seems odd. Am I missing anything obvious?
Thanks Matthew.
>>> cursor.execute("CREATE TABLE Directory (Name VARCHAR, Phone
VARCHAR, FAX VARCHAR, Nickname VARCHAR)")
>>> cursor.execute("INSERT INTO Directory (Name, Nickname, Phone, FAX)
VALUES ('Freddie Fred', 'Fred Freddie', '<none>', '<none>')")
>>> cursor.execute("INSERT INTO Directory VALUES ('Matthew', 'my phone
no', 'my fax number', 'my nickname')")
>>> cursor.execute("SELECT * FROM Directory")
>>> for entry in cursor.fetchall():
... print entry
...
('<none>', '<none>', 'Fred Freddie', 'Freddie Fred')
('my phone no', 'my fax number', 'my nickname', 'Matthew')
>>>
ie: Table defined as Name,Phone, FAX, Nickname
output tuple gives fields as Phone, FAX, Nickname, Name
Shouldn't they be identical?
More information about the Python-list
mailing list