rdrunner, that approach MIGHT work, but does not address the case when one user ADDS a records, and another user DELETES a record, thus leaving the record COUNT the same????
Arthur Wood
Main Topics
Browse All TopicsI have an application which uploads data to an Oracle table at regular periods. Another application queries this table every 10 seconds to see if new data has arrived.
This seems very inefficient to me. What is the simplest way to let the second app know that the table contains new data without actually querying the database.
regards Gerry
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I think emoreau is on the right track, but instead of writing to a file, I would write to an audit table. Then you can pretty much keep your existing code and just query the audit table periodically instead of the full table. You won't have to try to write code to read a file that is probably on a different machine, and most likely a different OS as well. You could keep a handful of things in the audit table at almost no cost such as the last person to change a record, the time it was done and the action. All things that might be useful, but are expensive to dig out of a big table.
-Wes
Maybe I should explain some more. The table I'm querying has a small number of records (always the same number). My concern is not the efficiency of the query, but the efficiency of querying the database so frequently (or does this matter). I could setup the uploading PC to send a message to any client PCs which are monitoring the table, that new data is available. In this way they would only query the DB when they receive the new data notification. Is this the best/ only method or is there some better way to tell the querying clients that the data is new.
regards Gerry
I'm not a experts of Oracle, but can give you some solution you can simulate:
in DB2 Database, have a Date Type Called TimeStamp it's detail to microsecond, and "Current TimeStamp" can get current datetime with microsecond.
1.In table, add a field Name=LastUpdateTS DateType=TimeStamp
2.Every time update any data in Table, must set LastUpdateTS = Current TimeStamp
3.In Watch application ("queries this table every 10 seconds")
A)first time, select all record in table, and get max(LastUpdateTS) to a variable(example: sLastUpdateTS)
B)every timer, Use Search-condition LastUpdate > sLastUpdateTS to get new data in table. if have record return, update sLastUpdateTS with maximal LastUpdateTS value again
Business Accounts
Answer for Membership
by: rdrunnerPosted on 2002-12-03 at 04:27:08ID: 7524875
Instead of doing a refresh on your RS how about doing a
select count(*) from yourtable (this is quite fast)
and only requerry if the number changed?