Re: A Descending Auto Increment Key

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A Descending Auto Increment Key

Don V Nielsen
On the heel of this is a grammatical error: "declared type "INTEGER"
includes an "PRIMARY KEY DESC" clause". It should read "includes a
"primary...".

On Wed, Jul 19, 2017 at 11:03 PM, Keith Medcalf <[hidden email]> wrote:

>
> AUTOINCREMENT can only be used with INTEGER PRIMAY KEY columns in a rowid
> table definition to declare an alias for the rowid.  Such columns must not
> have the DESC ordering (the rowid is ascending).  If it does, then "PRIMARY
> KEY" is syntactic sugar for "UNIQUE" (ie, creating a unique index) and the
> AUTOINCREMENT keyword cannot be applied.
>
> -----Original Message-----
> From: sqlite-users [mailto:[hidden email]]
> On Behalf Of sanhua.zh
> Sent: Wednesday, 19 July, 2017 20:07
> To: sqlite-users
> Subject: [sqlite] A Descending Auto Increment Key
>
> When I call `CREATE TABLE test(i INTEGER PRIMARY KEY DESC AUTO
> INCREMENT)`, SQLite comes to an error "AUTOINCREMENT is only allowed on an
> INTEGER PRIMARY KEY".
>
>
> But as the document http://www.sqlite.org/lang_createtable.htmlsays, in
> the column-constraint, it shows that `PRIMARY DESC AUTOINCREMENT` is a
> valid syntax.
>
>
> Why the original SQL failed? Is that really not supported?
> _______________________________________________
> 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
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...