I am using the dynamic SQL from:
https://stackoverflow.com/a/36333897/5021320
to create a table and some partitions based on time of the day.
On a Oracle 11g DB is working OK, but on a Oracle 10g I am getting the following error:
ORA-00923: FROM keyword not found where expected
Trying to run the following query alene, also is giving me the error:
select listagg('PARTITION TABLE_NAME_' || to_char(sysdate + (level-1)/24, 'yyyymmddHH24') ||
' VALUES LESS THAN (TIMESTAMP''' || to_char(sysdate + (level)/24, 'yyyy-mm-dd HH24') || ':00:00''), ')
within group (order by level)
from dual
connect by level <= 24;
Why is this happening?
You can try something like this.