Ralf Junker wrote:
>> On a separate note, it is best for one to be able to name a table or column 
>> et al anything one wants, with all the choice of names as you can store in 
>> a text column for user data.  Reserved words aren't an issue as long as 
>> entity names are referred to with an unambiguously different syntax, such 
>> as quoted identifiers as SQL does support.  Then database users don't have 
>> to worry about implementation details and can name tables and columns 
>> whatever they want; saying they can't name their column "RowID" is a leaky 
>> abstraction. 
> 
> Sure we all dislike restrictions. Can you suggest an alternative to a single
  reserved name to represent the column which uniquely identifies a database
record under any and all circumstances?

Yes, change the interface to RowID into a routine call rather than a column 
name; eg use "RowID()" rather than "RowID".  Then when using it in a 
SELECT, you can say "RowID() as foo" in the select list where "foo" is 
different than a normal table field.  Such is how 'standard' SQL does it. 
Any manager app can read the database schema first and generate a name 
"foo" that is distinct.

-- Darren Duncan

P.S.  Alternately, you can eliminate RowID entirely as a user-visible 
concept, leaving it just to SQLite's internals.  And also disallow storing 
duplicate rows, so that the values of the row fields themselves will 
uniquely identify a database record under any and all circumstances.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to