Reputation: 11
I have a simple PL/SQL code that fetches some data from my tables, computes some value and outputs it to my APEX UI.
Consider a simple code like : declare cr number; Begin select sum(testing) into cr from sample; htp.p(cr); end;
The output would be like "40" which should change to "new_value" after 2 minutes. I can't refresh/reload the entire page as there is a lot of code that should not be refreshed on the same page.How do I run the query again every 2 minutes or refresh the output on the screen in APEX? I considered a couple of options but nothing seems to work : 1. Introduce a loop and a sleep() but sleep() doesn't work for APEX. 2. Embed javascript (setInterval) in my PL/SQL code, which is again not getting parsed correctly. Is there a better way to do it?
Upvotes: 1
Views: 2192
Reputation: 60272
Another way is to set your page to Auto Refresh. Basically in your page header you have something like this:
<meta http-equiv="refresh" content="&F100_REFRESH_INTERVAL.">
And your application has an item F100_REFRESH_INTERVAL
which is defaulted to 120.
http://jeffkemponoracle.com/2006/10/25/apex-tip-page-auto-refresh/
Upvotes: 1
Reputation: 10541
You can use the Apex timer plugin to reload your page at set intervals. In the page load proces you can recalculate the values you need.
http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-plug-ins-182042.html
Upvotes: 1