Documentation correction

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Documentation correction

Tom Bassel
Hi, I just wanted to point out a minor discrepancy in the docs below.

https://www.sqlite.org/lang_createtable.html#rowid

where it says:

If a table contains a user defined column named "rowid", "oid" or "_rowid_", then that name always refers the explicitly declared column and cannot be used to retrieve the integer rowid value.

Shouldn't it say at the end "unless that user defined column is an alias for the rowid."

For example, you can retrieve the integer rowid value from a user defined column named "rowid" if it defined as the integer primary key:

CREATE TABLE t(rowid integer primary key);
insert into t values(15);
select rowid, oid from t;

Results:
15|15

Thanks,
Tom
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Documentation correction

Don V Nielsen
On the heel of Tom's input is the fragment " then that name always refers
the explicitly declared column". Should that be " then that name always
refers *to* the explicitly declared column"?

On Mon, Apr 15, 2019 at 3:32 PM <[hidden email]> wrote:

> Hi, I just wanted to point out a minor discrepancy in the docs below.
>
> https://www.sqlite.org/lang_createtable.html#rowid
>
> where it says:
>
> If a table contains a user defined column named "rowid", "oid" or
> "_rowid_", then that name always refers the explicitly declared column and
> cannot be used to retrieve the integer rowid value.
>
> Shouldn't it say at the end "unless that user defined column is an alias
> for the rowid."
>
> For example, you can retrieve the integer rowid value from a user defined
> column named "rowid" if it defined as the integer primary key:
>
> CREATE TABLE t(rowid integer primary key);
> insert into t values(15);
> select rowid, oid from t;
>
> Results:
> 15|15
>
> Thanks,
> Tom
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users