How to display the status automatically/Refresh the field automatically after a JOB execution In Oracle Apex - oracle-apex

I am executing a job via oracle Apex by clicking a button which is taking some times. Currently i am displaying a field as "STARTED" when the job started, once the job finished its update as "FAIL/SUCCCES" in a table. Placed another button to check the value from table for the status.so need to keep on press the button to know the status.
Is there any possible to refresh the field automatically/wait till once the table value will update either "FAIL" or "SUCCES".

better you can change the status like processing
Use javascript and set the value like processing. once job completed automatically page will refresh and show the success message.

Related

Create a button that will update a database table in apex

I am trying to create a button that will update a database table. I am using Oracle Application Express (APEX) 20.2. What I have done so far is create a regular button and then create a process that contains my PL SQL code that would update the table. The process is attached to the button by specifying in the "Server-side Condition" attribute to execute the process when the button is pressed. This has not work and would appreciate anyone who has any knowledge of doing this.
So all in all I am just looking to run PL SQL code that will update a table when the button is pressed.
This is the button
APEX Button
This is the process
APEX Process
The process is attached to the button
APEX Process
After pressing the button, this is what I see in Debug mode in runtime
Debug mode
After I press the button the current page stays in loading mode
Loading mode
Error I get after waiting for the loading tab to finish
Error pic
I also tried using a dynamic action instead of a process but it did not work as well. Please see image of how I set the dynamic action.
Dynamic action
I think you are overcomplicating things.
Have you tried simply making a dynamic action that is triggered when the button is pressed.
Then you can have the action run PL/SQL code to do whatever you need.
If however what you are trying to do is update a table on the screen, then what you should try is making the button just submit the page. Then make a process with the editable region being the table you are working on, do the code in there. And in case you have other submits on the page that you dont want to trigger the code, just put in a button pressed condition in the process.
The problem that was causing my button not to work was that I had a session in TOAD open and I did not commit my current query in TOAD's editor. I had to commit my changes in TOAD so that TOAD would not lock the rows that the code of the button in my APEX app was using/accessing. I also want to point out that my button worked without having to attach a process to it, instead the button needed a dynamic action attached to it as #TineO suggested.

How can I implement a countdown for items in a todo list web app?

I have made a todo list webapp in Django. It is a simple CRUD web App. Now upon creation of an item for the todo list the user specifies a duration for which that item's status remains "to be completed". If the user fails to complete a task in the duration set for an item in the todo list, that item's status should automatically change to "not completed".
Should a scheduled job be used to poll the app and change the status accordingly? Wouldn't polling the app constantly be costly?
If someone could point me in the right direction I would be grateful.
You can set up a scheduled job to check on items. For example, on Heroku, setting up jobs does not cost anything.
Also, you can run a query when the user logged in to check on his specific items. So, you do not have to run a job for nothing (if no item status should be change); and you run a query only on items related to the user, not on the full database.

DynamoDB Dashboard can't Save/Update Item: ConditionalCheckFailedException

I need to update an item in a table, using the AWS Console DDB Dashboard. But when I go into "Edit item" and click "Save", I keep getting a ConditionalCheckFailedException error.
I assume this means the existing item has a ConditionExpression which my new data is somehow violating. But I can't figure out how to view that expression from the Dashboard so I can determine what the issue is.
How can I view the ConditionExpression for an Item in a Table, from the AWS Console DDB Dashboard?
I had the same problem and with the help of AWS support have solved it.
The issue arises because the DynamoDB console for the "Items" tab is a static display which takes a snapshot of all your items when it is first displayed. If you select an item and then return to the screen you still see the same snapshot - it is not updated.
When you try to update an item, the console sends the values of all the existing fields from the snapshot for this item and if any of these fields differ from their current values in DynamoDB then the update is rejected. So the "conditional expression" is referring to the requirements which the console is making for the update to be allowed.
So the workaround is to perform a browser window refresh on the item list before selecting the item you wish to edit and then hope you are fast enough with the edit to finish it before any external updates to the table change the data. Of course if you have a rapidly changing table then you will not be able to be quick enough and so the console is not the right tool for the job.

Oracle APEX : How to refresh the page after submit - before Branching

I have an APEX page, with a interactive report with Check boxes and a Button on top.
On click of button, It is performing some PLSQL process (on selected rows that are checked) and in a branch I'm invoking a Report Query which downloads a report in the pdf format.
But even after downloading the report, the report is not automatically getting refreshed.
Ideally I want to remove the processed rows from the report so as to avoid multiple processing by clicking the button continuously.
But since I have a branch that goes to download the report, it is not going to other branches that comes after in sequence to refresh the page.
Can anyone tell me how to refresh the page/or just that region after the processing? Thanks.

table updation after expiring oracle apex application session

How can I update my table after apex application session is expired?
I want to execute the following code automatically after current session is expired.
update users set logn='N' where u_name=app_user;
commit;
Is there anyway?
Nothing actually happens when an APEX session expires. However, if the user attempts to use the session again then a check will be made to see if it has expired. So there is no event on which you can hang your update.
What you could do is have a DBMS_SCHEDULER job that runs periodically and checks for each "logged in" user whether they have any unexpired APEX sessions; if not then set them to "not logged in". Something like:
update users u
set u.logn = 'N'
where u.logn = 'Y'
and not exists (select null
from apex_workspace_sessions aws
where aws.user_name = u.u_name
and aws.session_idle_timeout_on > sysdate
);
Trying to keep track of whether APEX users are "logged in" is rather futile really - they may have closed down their laptop without "logging out" and so will show up as "logged in" until their session expires and this job runs. Probably more useful info is to know the date and time they were last active, which you can get from APEX_WORKSPACE_ACTIVITY_LOG.