With Clause improvement:
Example:
SQL> WITH
FUNCTION f_test(n IN NUMBER) RETURN NUMBER IS
BEGIN RETURN n+1; END;
SELECT f_test(1)
FROM dual;
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:
Post a Comment