Adsense Ad

Thursday 29 August 2019

Oracle 12c new feature using WITH Clause

With Clause improvement:

In Oracle 12c, we can declare PL/SQL functions in the WITH Clause of a select statement and use it as an ordinary function. Using this construct results in better performance as compared with schema level functions.

Example:

SQL> WITH
FUNCTION f_test(n IN NUMBER) RETURN NUMBER IS
    BEGIN
     RETURN n+1;    END;
SELECT f_test(1)
FROM dual;

No comments: