Re: [sqlite] sqlite_sequence table
See my previous e-mail: I was querying temp.sqlite_sequence when I thought I was querying main.sqlite_sequence. Will On 11/16/10 2:22 PM, "Richard Hipp" wrote: On Tue, Nov 16, 2010 at 4:31 PM, Duquette, William H (316H) < william.h.duque...@jpl.nasa.gov> wrote: > Yes. I've done a couple of inserts into the table, interspersed with > queries to the > sqlite_sequence table; they show the sqlite_sequence table as being empty. > Test case: CREATE TABLE t1(x INTEGER PRIMARY KEY AUTOINCREMENT, y); SELECT 111, * FROM sqlite_sequence; INSERT INTO t1 VALUES(10,11); SELECT 222, * FROM sqlite_sequence; The result comes back: 222|t1|10 What are your inputs and outputs? > > Will > > > On 11/16/10 1:29 PM, "Gerry Snyder" wrote: > > On 11/16/2010 2:14 PM, Duquette, William H (316H) wrote: > > Howdy! > > > > According to the docs on sqlite.org, a table with "INTEGER PRIMARY KEY > AUTOINCREMENT" gets an entry in the sqlite_sequence table. I've got some > code that contains such a table; but if I query the sqlite_sequence table I > don't see it being updated; it's always empty. Anyone have any idea what's > going on? > > > > Have you put anything in the table that is > > INTEGER PRIMARY KEY AUTOINCREMENT > > so there is a sequence number to store in sqlite_sequence? > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > -- > Will Duquette -- william.h.duque...@jpl.nasa.gov > Athena Development Lead -- Jet Propulsion Laboratory > "It's amazing what you can do with the right tools." > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Will Duquette -- william.h.duque...@jpl.nasa.gov Athena Development Lead -- Jet Propulsion Laboratory "It's amazing what you can do with the right tools." ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite_sequence table
On Tue, Nov 16, 2010 at 4:31 PM, Duquette, William H (316H) < william.h.duque...@jpl.nasa.gov> wrote: > Yes. I've done a couple of inserts into the table, interspersed with > queries to the > sqlite_sequence table; they show the sqlite_sequence table as being empty. > Test case: CREATE TABLE t1(x INTEGER PRIMARY KEY AUTOINCREMENT, y); SELECT 111, * FROM sqlite_sequence; INSERT INTO t1 VALUES(10,11); SELECT 222, * FROM sqlite_sequence; The result comes back: 222|t1|10 What are your inputs and outputs? > > Will > > > On 11/16/10 1:29 PM, "Gerry Snyder" wrote: > > On 11/16/2010 2:14 PM, Duquette, William H (316H) wrote: > > Howdy! > > > > According to the docs on sqlite.org, a table with "INTEGER PRIMARY KEY > AUTOINCREMENT" gets an entry in the sqlite_sequence table. I've got some > code that contains such a table; but if I query the sqlite_sequence table I > don't see it being updated; it's always empty. Anyone have any idea what's > going on? > > > > Have you put anything in the table that is > > INTEGER PRIMARY KEY AUTOINCREMENT > > so there is a sequence number to store in sqlite_sequence? > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > -- > Will Duquette -- william.h.duque...@jpl.nasa.gov > Athena Development Lead -- Jet Propulsion Laboratory > "It's amazing what you can do with the right tools." > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite_sequence table
Aha! I've got AUTOINCREMENT keys in both regular and temporary tables. This results in two sqlite_sequence tables, one in sqlite_master and one in sqlite_temp_master. And evidently, if I have a permanent and a temporary table with the same name, a query that doesn't specify gets the temporary table. If I do "SELECT * FROM main.sqlite_sequence" I see what I'm looking for. Will On 11/16/10 1:31 PM, "Will Duquette" wrote: Yes. I've done a couple of inserts into the table, interspersed with queries to the sqlite_sequence table; they show the sqlite_sequence table as being empty. Will On 11/16/10 1:29 PM, "Gerry Snyder" wrote: On 11/16/2010 2:14 PM, Duquette, William H (316H) wrote: > Howdy! > > According to the docs on sqlite.org, a table with "INTEGER PRIMARY KEY > AUTOINCREMENT" gets an entry in the sqlite_sequence table. I've got some > code that contains such a table; but if I query the sqlite_sequence table I > don't see it being updated; it's always empty. Anyone have any idea what's > going on? > Have you put anything in the table that is INTEGER PRIMARY KEY AUTOINCREMENT so there is a sequence number to store in sqlite_sequence? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users -- Will Duquette -- william.h.duque...@jpl.nasa.gov Athena Development Lead -- Jet Propulsion Laboratory "It's amazing what you can do with the right tools." ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users -- Will Duquette -- william.h.duque...@jpl.nasa.gov Athena Development Lead -- Jet Propulsion Laboratory "It's amazing what you can do with the right tools." ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite_sequence table
Yes. I've done a couple of inserts into the table, interspersed with queries to the sqlite_sequence table; they show the sqlite_sequence table as being empty. Will On 11/16/10 1:29 PM, "Gerry Snyder" wrote: On 11/16/2010 2:14 PM, Duquette, William H (316H) wrote: > Howdy! > > According to the docs on sqlite.org, a table with "INTEGER PRIMARY KEY > AUTOINCREMENT" gets an entry in the sqlite_sequence table. I've got some > code that contains such a table; but if I query the sqlite_sequence table I > don't see it being updated; it's always empty. Anyone have any idea what's > going on? > Have you put anything in the table that is INTEGER PRIMARY KEY AUTOINCREMENT so there is a sequence number to store in sqlite_sequence? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users -- Will Duquette -- william.h.duque...@jpl.nasa.gov Athena Development Lead -- Jet Propulsion Laboratory "It's amazing what you can do with the right tools." ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite_sequence table
On 11/16/2010 2:14 PM, Duquette, William H (316H) wrote: > Howdy! > > According to the docs on sqlite.org, a table with "INTEGER PRIMARY KEY > AUTOINCREMENT" gets an entry in the sqlite_sequence table. I've got some > code that contains such a table; but if I query the sqlite_sequence table I > don't see it being updated; it's always empty. Anyone have any idea what's > going on? > Have you put anything in the table that is INTEGER PRIMARY KEY AUTOINCREMENT so there is a sequence number to store in sqlite_sequence? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users