I am running 21c on-prem with a JSON table with JSON data type. In the JSON document there is a dateofbirth field in a 14 digits number format (YYYYMMDDHH24MISS). I like to create a fast refresh materialized view and convert the number to a date without time on the fly. Is there a way to handle the conversion in the create mview statement? Below is my original script without date conversion. Thanks.
CREATE MATERIALIZED VIEW mv_test
BUILD IMMEDIATE REFRESH FAST ON COMMIT WITH PRIMARY KEY
AS SELECT t.id, jt.*
FROM test t,
json_table(t.json_document, '$' ERROR ON ERROR NULL ON EMPTY
COLUMNS (
order_id NUMBER PATH '$.orderid',
date_of_birth NUMBER PATH '$.dateofbirth'
)) jt;