>> This should NOT happen as SQLite usually rejects duplicate rowids with a
>constraint error.
>
>For this table, the badly-named column "RowID" is actually a text field
>that's allowed to be null, not a primary key.
>
>-- Describe NDXPARAMVALUES_LOCALIZEDSTRING
>CREATE TABLE 'ndxParamValues_LocalizedString'
>(
>    'FamilyId' INTEGER NOT NULL ,
>    'ParamId' INTEGER NOT NULL ,
>    'RowID' TEXT COLLATE NOCASE,
>    'Index' INTEGER ,
>    'Value' INTEGER NOT NULL
>)

My oversight, sorry for that. I never questioned that SQLite would reject 
reserved word column names, but I now see that this is not so.

This alerts me to a potential danger for SQLite managers which must rely on 
some means to retrieve THE RowID which uniquely identifies a record for in-grid 
table editing. If the "RowID" name can be hijacked by other columns and given 
another purpose, it poses the danger that wrong wrong columns are updated and 
data is corrupted.

How can I access the "RowID" given the above table declaration? I know about 
the "OID" and "_ROWID_" synonyms, but searching the documentation I find that 
they, too, can be used by other columns.

I can therefore not see any non-ambiguous, reserved column name or API call to 
retrieve the implicit RowID value in such cases, especially if no primary key 
has been set like in the above schema.

Any thoughts, especially from the SQLite developers?

Thanks, Ralf  

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to