Re: [sqlite] sqlite3_set_last_insert_rowid

2018-01-30 Thread J Decker
Probably best reserved for initialization of a shard of a database where
you can set next to last of a prior .db.


On Tue, Jan 30, 2018 at 9:14 AM, petern  wrote:

> For one, within a function that does an INSERT, set_last_insert_rowid makes
> it possible to "pop" last_insert_rowid.
> Consider a function which INSERT's into the model and then INSERT's a log
> table row.  The caller probably isn't interested in the log rowid.
>
> A better question to ask is always why an orthogonal or inverse operation
> is missing rather than why it is present.
> https://en.wikipedia.org/wiki/Orthogonality_(programming)
>
> Peter
>
> On Tue, Jan 30, 2018 at 7:03 AM, Bart Smissaert 
> wrote:
>
> > Just wonder what the possible use for this is.
> >
> > RBS
> > ___
> > sqlite-users mailing list
> > sqlite-users@mailinglists.sqlite.org
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_set_last_insert_rowid

2018-01-30 Thread Darrol Thompson
I don't need this program so delete this.

Sent from Yahoo Mail on Android 
 
  On Tue, Jan 30, 2018 at 11:15 AM, petern wrote:  
 For one, within a function that does an INSERT, set_last_insert_rowid makes
it possible to "pop" last_insert_rowid.
Consider a function which INSERT's into the model and then INSERT's a log
table row.  The caller probably isn't interested in the log rowid.

A better question to ask is always why an orthogonal or inverse operation
is missing rather than why it is present.
https://en.wikipedia.org/wiki/Orthogonality_(programming)

Peter

On Tue, Jan 30, 2018 at 7:03 AM, Bart Smissaert 
wrote:

> Just wonder what the possible use for this is.
>
> RBS
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
  
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_set_last_insert_rowid

2018-01-30 Thread petern
For one, within a function that does an INSERT, set_last_insert_rowid makes
it possible to "pop" last_insert_rowid.
Consider a function which INSERT's into the model and then INSERT's a log
table row.  The caller probably isn't interested in the log rowid.

A better question to ask is always why an orthogonal or inverse operation
is missing rather than why it is present.
https://en.wikipedia.org/wiki/Orthogonality_(programming)

Peter

On Tue, Jan 30, 2018 at 7:03 AM, Bart Smissaert 
wrote:

> Just wonder what the possible use for this is.
>
> RBS
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3_set_last_insert_rowid

2018-01-30 Thread Bart Smissaert
Just wonder what the possible use for this is.

RBS
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_set_last_insert_rowid()

2017-03-06 Thread Simon Slavin

On 6 Mar 2017, at 10:01pm, Richard Hipp  wrote:

> On 3/6/17, Simon Slavin  wrote:
>> 
>> This means that each TRIGGER is its own little story, right ?  Triggers can
>> make their own inserts.  Which may themselves have triggers.  SQLite
>> maintains a happy stack of values for last_insert_rowid(), pushing and
>> popping them each time you enter or exit a trigger ?
> 
> Correct

Thank you.  I wrote one piece of code which assumed this but wasn’t sure 
whether it was certain in future versions.  What you wrote assures me that I 
can assume future versions of SQLite3 will work the same way.

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_set_last_insert_rowid()

2017-03-06 Thread Richard Hipp
On 3/6/17, Simon Slavin  wrote:
>
> This means that each TRIGGER is its own little story, right ?  Triggers can
> make their own inserts.  Which may themselves have triggers.  SQLite
> maintains a happy stack of values for last_insert_rowid(), pushing and
> popping them each time you enter or exit a trigger ?

Correct
-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3_set_last_insert_rowid()

2017-03-06 Thread Simon Slavin

On 6 Mar 2017, at 9:30pm, Richard Hipp  wrote:

>https://www.sqlite.org/draft/releaselog/3_18_0.html   <--- Change log

The mention of sqlite3_set_last_insert_rowid() reminds me of a question I have:

Here’s the documentation for last_insert_rowid():

"If an INSERT occurs within a trigger or within a virtual table method, then 
this routine will return the rowid of the inserted row as long as the trigger 
or virtual table method is running. But once the trigger or virtual table 
method ends, the value returned by this routine reverts to what it was before 
the trigger or virtual table method began."

This means that each TRIGGER is its own little story, right ?  Triggers can 
make their own inserts.  Which may themselves have triggers.  SQLite maintains 
a happy stack of values for last_insert_rowid(), pushing and popping them each 
time you enter or exit a trigger ?

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users