Skip to Main Content
  • Questions
  • How to check in apex, if there is new data

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Frederick.

Asked: November 29, 2016 - 7:58 pm UTC

Last updated: November 30, 2016 - 2:34 am UTC

Version: 5.0.4.00.12

Viewed 1000+ times

You Asked

Hello Tom,

I'm a bit new to apex and I wonder if there is a way to check in apex, if new data was inserted in my DATA table.
I want to fire a dynamic action that refreshes the region only when new data has arrived.

For now, this works for me:

setInterval("jQuery('#REGION_SENSORS').trigger('apexrefresh');", 10000);


But it always fires, no matter if new data arrived or not.

Greetings from Germany!

and Connor said...

Push notifications, ie, the client being told when something on the server has changed is not a trivial undertaking to do it "properly".

Dan McGhan has a demo of this using continuos query notification and node.js here

https://jsao.io/2015/02/real-time-data-with-node-js-socket-io-and-oracle-database/

but you'll see, there's a number of moving parts here.

It may well the case that you want to go for a simpler hybrid, depending your requirements. For example, you might populate a hidden item/region/etc with a simple query indicating that its "time to refresh" and populate the source of that using AQ etc.

Others welcome to add their input if they've tackled the issue.

Hope this helps.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library