Not working user function in CTE query

trilobit

Member
Hi developers,

next query works from Oracle 12.2 in sqlplus , SQL developer and sqlcl but not in PL/SQL developer Version 15.0.4.2064 (64 bit).

SQL>

WITH
FUNCTION f_test RETURN NUMBER IS
BEGIN
RETURN 1;
END;
cte_test ( id ) AS (
SELECT 1 FROM DUAL
)
SELECT f_test(),
c.*
FROM cte_test c;

ORA-00933: SQL command not properly ended

I tried it in SQL window and Command window with same result.
Why ?
 
The "with function" query must be terminated with a / instead of a ; in PL/SQL Developer:

Code:
WITH
    FUNCTION f_test RETURN NUMBER IS
    BEGIN
        RETURN 1;
    END;
cte_test ( id ) AS (
  SELECT 1 FROM DUAL
)
SELECT f_test(),
       c.*
FROM   cte_test c
/
 
Back
Top