Does anyone know why this simple INSERT using 12c FUNCTION for WITH clause is not working ?
If I remove INSERT select works:
WITH
FUNCTION t_fun(n INTEGER) return varchar2 IS
BEGIN
return '2';
END;
tt as ( select 1 t from dual)
select t from tt;
it's working.
desc TEST
Name Null Type
---- ---- -----------
T1 VARCHAR2(5)
However when I add an insert I'm getting this error:
insert into test
WITH
FUNCTION t_fun(n INTEGER) return varchar2 IS
BEGIN
return '2';
END;
tt as ( select 1 t from dual)
select t from tt;
ORA-00942: table or view does not exist
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Error at Line: 53 Column: 15
Thank you,
Alex