On Nov 20, 2004, at 02:14, Darren Duncan wrote:

At 1:59 AM +0100 11/20/04, Tito Ciuro wrote:
When I create an 'address' table, I pass this string to SQLite:

1) CREATE TABLE address(ROWID INTEGER PRIMARY KEY,First QLString,Last QLString,ZIP QLString,Country QLString);

And SQLite returns a series of data, from which you can see:

4) CREATE TABLE address(Last QLString,ROWID INTEGER PRIMARY KEY,First QLString,ZIP QLString,Country QLString);

Clearly not what I passed in statement #1. You also see this table called 'address_mem_2', which is fine:

'ROWID' is a special word in SQLite, and implicitly exists for all tables as its primary key, or as an alias to such. SQLite probably stripped it out of your explicit declaration because it was redundant.

Well, it didn't really stripped it. It seems to have reordered the columns. Also, in version 2 (I don't know if it's still the case), if you omitted the ROWID in the CREATE TABLE statement, this column would still be created, but if would be invisible. In other words, you would not be able to access ROWID's value.


What you should do to fix the problem is use a different column name for your explicitly defined primary key.

I'll give it a try. Thanks.

On a separate matter, what is a 'QLString'? I've never heard of that SQL data type before.

It's my own datatype I use in QuickLite: (http://www.webbotech.com)

Regards,

-- Tito



Reply via email to