Re: [sqlite] Problem with SELECT by rowid after INSERT

2019-04-12 Thread Jim Dossey
On Apr 12, 2019, at 3:27 PM, Keith Medcalf wrote: > > >> To be a little more specific, the problem happens when I try to do >> sqlite3_bind_int() on the prepared statement using the new rowid. It >> doesn't use the rowid it uses NULL. >> >> The prepared statement is "SELECT * FROM sessiond

Re: [sqlite] Problem with SELECT by rowid after INSERT

2019-04-12 Thread Jim Dossey
That was it. There was another SELECT going on that had not been finalized. Thank you Richard, Simon, and Graham for you help on this. > On Apr 12, 2019, at 2:36 PM, Richard Hipp wrote: > > On 4/12/19, Jim Dossey wrote: >> I'm doing the INSERT first, without a BEGIN ... COM

Re: [sqlite] Problem with SELECT by rowid after INSERT

2019-04-12 Thread Jim Dossey
to call any other functions after that to make the new row visible to other connections? > On Apr 12, 2019, at 2:15 PM, Richard Hipp wrote: > > On 4/12/19, Jim Dossey wrote: >> >> The problem is when I do an INSERT and then try to SELECT that record by >> rowid i

Re: [sqlite] Problem with SELECT by rowid after INSERT

2019-04-12 Thread Jim Dossey
stent and some not, and for the non existent rowid's sqlite3_bind_int() always inserts a NULL. > On Apr 12, 2019, at 1:38 PM, Simon Slavin wrote: > > On 12 Apr 2019, at 6:32pm, Jim Dossey wrote: > >> It's just when I use 2 different connections that the second connection doe

Re: [sqlite] Problem with SELECT by rowid after INSERT

2019-04-12 Thread Jim Dossey
the CLI on the database file and did a SELECT there and I know that the record exists and the rowid that I'm searching for does exist. But sqlite3_bind_int() inserts a NULL instead of the rowid. > On Apr 12, 2019, at 1:26 PM, Simon Slavin wrote: > > On 12 Apr 2019, at 6:23pm, Jim Doss

Re: [sqlite] Problem with SELECT by rowid after INSERT

2019-04-12 Thread Jim Dossey
ote: > > On 12 Apr 2019, at 4:40pm, Jim Dossey wrote: > >> Which is obtained by calling sqlite3_expanded_sql(). > > Was that a copy-paste error or do you actually want > > <https://sqlite.org/c3ref/last_insert_rowid.html> >

[sqlite] Problem with SELECT by rowid after INSERT

2019-04-12 Thread Jim Dossey
I have a table define like this: CREATE TABLE "sessiond" ( "journal" VARCHAR(4) DEFAULT '' NOT NULL, "session" VARCHAR(16) DEFAULT '' NOT NULL, "pid" INTEGER DEFAULT 0 NOT NULL, rowid INTEGER PRIMARY KEY ); In my application I open 2 connections to this table, one for reading and one for

[sqlite] Error in docs

2019-04-08 Thread Jim Dossey
I think I found an error in the documentation here: https://www.sqlite.org/datatype3.html#column_affinity_for_views_and_subqueries It defines the table and view: CREATE TABLE t1(a INT, b TEXT, c REAL); CREATE VIEW

Re: [sqlite] Regarding CoC

2018-10-22 Thread Jim Dossey
I think Donald Knuth would approve. On Mon, Oct 22, 2018 at 8:01 PM D Burgess wrote: > > The CoC is fine. Don't change it. > +1 > ___ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org >

[sqlite] WAL mode with readers and writers

2017-11-20 Thread Jim Dossey
Thanks to feedback from Simon Slavin, I now understand how data_version works and have it working in my code.  But in my testing, I tried another situation to see what would happen with locking in WAL mode.  I have a process that does the following pseudo-code with a table:

[sqlite] "PRAGMA data_version" documentation wrong

2017-11-20 Thread Jim Dossey
I think the documentation for "PRAGMA data_version" at https://www.sqlite.org/pragma.html is incorrect.  I've been testing this pragma and I've found that it only returns '1' for a standard database or '2' if the database is in WAL mode.  The documentation makes it sound like this value