Csaba wrote:
> 
>> BTW, the autoincrement keyword must appear after the integer primary key
>> phrase, not in the middle as you have show it.
> 
> This was an interesting note.  I am using the SQLite that came with my
> PHP v. 5.2.6 (built Feb 13, 2008), which is SQLite 2.8.17.
> Turns out that the AUTOINCREMENT key was accepted in the position
> as I had stated and was autoincrementing just fine.  However, it
> turned out that I got the same autoincrementing functionality when
> I removed the AUTOINCREMENT keyword!  No surprise that I couldn't
> find a structural difference between the two in this version of SQLite.
> 

The autoincrement keyword has only been used in SQLite since version 
3.1.0. For a very long time SQLite has supported special functionality 
for an "integer primary key" column as an alias of the table's btree 
key. This column will also increment by default, but behaves differently 
than an autoincrement column in the face of deletes.
See http://www.sqlite.org/lang_createtable.html and 
http://www.sqlite.org/autoinc.html for more details.


> 
> Useful example, thanks.  PHP provides a way to ask sqlite
> to carry out a direct command (via http://php.net/sqlite_exec )
> but they did not provide for retrieving any data from this
> function.  In light of this, is there any way to direct output from
> an sqlite command into a table?
> 

Not in SQL as far as I know, but I don't know what the PHP wrapper does 
with pragma commands.

> Though the sqlite_sequence table seems not to exist in
> my version of SQLite, should you be able to see it in yours
> by querying the sqlite_master table ala:
> SELECT * FROM sqlite_master WHERE type='table';
> I ask this because sqlite_master itself is not listed in sqlite_master
> 

Yes, the sqlite_sequence table is listed in the sqlite_master table.

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

Reply via email to