'Apex Report to load last 30 min of data
I am trying to have an APEX report show only responses submitted in the last 30 minutes. Is it possible to do this with the where clause? Getting stuck with all of this errors shown below:
Here is my current code:
select SCRAP_DATE,
PAINT_SHOP,
MODEL,
COLOR,
SCRAP_OWNER,
DEPARTMENT_CODE,
REASON_FOR_SCRAP,
SCRAP_TYPE,
BODY_TYPE,
DETAILS,
COMMENTS,
SUBMITTED_DATETIME
from SCRAP_BODY_SYSTEM
SQL> select sysdate,
2 sysdate - interval '30' minute half_an_hour_ago
3 from dual;
SYSDATE HALF_AN_HOUR_AGO
---------------- ----------------
04.05.2022 14:37 04.05.2022 14:07
SQL>
SQL> select sysdate, current_timestamp from dual;
SYSDATE CURRENT_TIMESTAMP
------------------- -------------------------------
05.05.2022 07:48:19 05.05.22 07:48:19,200858 +02:00
SQL>
where submitted_datetime >= sysdate - interval '30' minute
Solution 1:[1]
You really shouldn't copy/paste my SQL*Plus session (from your previous question) into Apex (including the SQL> prompt) and expect it to work.
Code that might work is
select SCRAP_DATE,
PAINT_SHOP,
MODEL,
COLOR,
SCRAP_OWNER,
DEPARTMENT_CODE,
REASON_FOR_SCRAP,
SCRAP_TYPE,
BODY_TYPE,
DETAILS,
COMMENTS,
SUBMITTED_DATETIME
from SCRAP_BODY_SYSTEM
where submitted_datetime >= sysdate - interval '30' minute;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Littlefoot |