[quote]The rowid is always available as an undeclared column named ROWID, OID, or ROWID
as long as those names are not also used by explicitly declared columns.[/quote]
Note : the term “ALWAYS” assumes also the table was not created with the “WITHOUT ROWID” constraint
However, SQLite returns “ROWID” as the fieldname for all alias,
If user defined any one or more, then how can an app decide which is “real”… beside reading the field schema and checking them off a “list”
If the user went bat-sh*t crazy and defined ALL of them… oh well
And I’m not talking about “me” deterimining… I am talking about an app looking at ANY Sqlite database and figuriing it out.
create table xyz (rowid integer);
insert into xyz values(99);
select oid,_rowid_,rowid from xyz;
results
rowid=1 rowid=1 rowid=99
so which is which? since db.idxField(x).name is “ROWID” in all 3 cases
this DOES return the “right name”
select oid as oid,_rowid_ as _rowid_,rowid from xyz;
oid=1 rowid=1 rowid=99
but basically… Dr.Hipp did say “he screwed that up”
FYI… It seems that there are at least a few commerical SQLite Managers that CANNOT handle databases that
have tables created using the “WITHOUT ROWID” constraint
get “confused” if the table contains a user column named “rowid”
Both of which I am trying to avoid with my Tadpole application
so far it CAN handle “WITHOUT ROWID”, and Ive managed to minimize the affect of the 2nd situation
Also for those of you who haven’t read as much about SQLite as I seemed to be doing lately. There are indications that the ROWID column will remain for backwards compatiblitly… but MAY NOT BE THE DEFAULT in the future… (ie. Tables will automatically be created assuming “WITHOUT ROWID” constraint)…