Howto compare database query results

bjf

Member
Licensed User
Longtime User
Hello.
I've created an app that pulls data from oracle database tables (lists outages from an electricity distribution management system).

What i now would like to do is create a service module for this, witch checks for new outages since the last time that the database has been checked.

Pretty much like that function that compares rss-files witch are on here somewhere.

Anyone with a suggestion how i can save the previous data map/rows?

I'm using httputils and JSON parser.
 

bjf

Member
Licensed User
Longtime User
There are several possible solutions. The simplest one is to store the last successful time in a file and then fetch only entries newer than this time (assuming that there is an entry time field).

That´s pretty much exactly the way i was thinking about going :)
Exept i'm using the newest "outage ID" instead of a time.

i saw this thread:
http://www.b4x.com/forum/basic4android-getting-started-tutorials/6690-text-files.html#post38928

And i'm using the "SaveString" example to save the id to a file.
Had some problems reading back from the file though, but i hope i can solve that.

Any idea of how i could check for changes?
Meaning:
sometimes the outage is registred and sometime later a "description"-field is updated.
In this case it would of course not work to check for new outages since the id alredy been dowloaded.
But i would still like to get an update about the changed description/status

Can i save the whole map and compare it ore something like that?

Best regards
Björn
 
Last edited:
Upvote 0

bjf

Member
Licensed User
Longtime User
Thank you, that would certainly be one possibility.

A related question regarding my app:
If there is changes in the database i'm using a notification to tell the user this.

As far as i can work out, when you click the notification you can tell it to access the main module, but is it possible to open a specific panel?

My outage check is just one of the "components" in my app.
 
Upvote 0
Top