Reseting total_changes() to 0

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Reseting total_changes() to 0

jose isaias cabrera

Greetings!

Can total_chages() be set to zero or reset?

thanks.
josé

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Reseting total_changes() to 0

Richard Hipp-3
On Fri, Aug 29, 2014 at 12:33 AM, jose isaias cabrera <
[hidden email]> wrote:

>
> Greetings!
>
> Can total_chages() be set to zero or reset?
>


No.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Reseting total_changes() to 0

jose isaias cabrera
"Richard Hipp" wrote..
> On Fri, Aug 29, 2014 at 12:33 AM, jose isaias cabrera <
> [hidden email]> wrote:
>
>> Can total_chages() be set to zero or reset?
>>
>
>
> No.

Thanks. Maybe is my lack of SQL knowledge, but I am finding myself having to
calculate and keep track of changes by setting variables and subtracting
them from the total_changes() function.  I would think that it would be so
much easier if something like this would work,

total_changes(0);

Then, the total_changes() would reset to 0 and the next changes would be
just the changes that happened last.  Anyway, thanks for SQLite.  I love it
and it has made our system pretty powerful.  People keep asking how did do
that?  I say, "SQLite."  Thanks.

josé

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Reseting total_changes() to 0

Simon Slavin-3

On 29 Aug 2014, at 9:20pm, jose isaias cabrera <[hidden email]> wrote:

> Maybe is my lack of SQL knowledge, but I am finding myself having to calculate and keep track of changes

Why is the number of changes useful for you to know ?  It's not the sort of thing that's useful in pure data manipulation.

The ability to track changes is most useful in a multi-user or multi-program system, where one program caches some data.  The program can keep a copy of total_changes() with the cache, and as long as total_changes() doesn't change, it knows its cache still holds accurate data.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Reseting total_changes() to 0

jose isaias cabrera

"Simon Slavin" wrote...

> On 29 Aug 2014, at 9:20pm, jose isaias cabrera <[hidden email]>
> wrote:
>
>> Maybe is my lack of SQL knowledge, but I am finding myself having to
>> calculate and keep track of changes
>
> Why is the number of changes useful for you to know ?  It's not the sort
> of thing that's useful in pure data manipulation.
>
> The ability to track changes is most useful in a multi-user or
> multi-program system, where one program caches some data.  The program can
> keep a copy of total_changes() with the cache, and as long as
> total_changes() doesn't change, it knows its cache still holds accurate
> data.

Thanks for your response, Simon. It's a long story, but your description is
somewhat how I am using it: to keep track of changes on two systems and
updating one system with the data of the other and making sure that they
amount of changes are the same.  The application is a multiple user
environment and application.  And, to make it complicated, we are moving
from one server to another, so there are two instances of the application
per user on two environment keeping track of the same data on two different
SharedDBs. In the end, there will only be one server, but until we close all
of the projects in the old server, the data from the old server is is being
pushed nightly to the new server.  So, total_changes() has been my friend
since the end of July.  I know that disconnecting the DBs and connecting
would reset the function, but, imho, it would be nice to have that simple
extra reset for situations like this.  Thanks for this wonderful tool.

josé

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users