ALTER SESSION SET plsql_optimize_level = 3
Statement processed.
ALTER SESSION SET plsql_warnings='enable:all'
Statement processed.
CREATE OR REPLACE PROCEDURE show_inlining
AUTHID DEFINER
IS
FUNCTION f1 (p NUMBER) RETURN PLS_INTEGER
IS
BEGIN
RETURN p * 10;
END;
FUNCTION f2 (p BOOLEAN) RETURN PLS_INTEGER
IS
BEGIN
RETURN CASE WHEN p THEN 10 ELSE 100 END;
END;
FUNCTION f3 (p PLS_INTEGER) RETURN PLS_INTEGER
IS
BEGIN
RETURN p * 10;
END;
BEGIN
DBMS_OUTPUT.put_line ('f1 called: ' || f1 (1));
PRAGMA INLINE (f2, 'YES');
DBMS_OUTPUT.put_line ('f2 called: ' || TO_CHAR (f2 (TRUE) + f2 (FALSE)));
PRAGMA INLINE (f3, 'NO');
DBMS_OUTPUT.put_line ('f3 called: ' || f3 (55));
END;
Warning: PROCEDURE SHOW_INLINING Line/Col: 4/4 PLW-06027: procedure "F1" is removed after inlining Line/Col: 10/4 PLW-06027: procedure "F2" is removed after inlining Line/Col: 22/4 PLW-06005: inlining of call of procedure 'F1' was done Line/Col: 25/4 PLW-06005: inlining of call of procedure 'F2' was done Line/Col: 25/4 PLW-06004: inlining of call of procedure 'F2' requested Line/Col: 25/4 PLW-06005: inlining of call of procedure 'F2' was done Line/Col: 25/52 PLW-06004: inlining of call of procedure 'F2' requested Line/Col: 28/4 PLW-06008: call of procedure 'F3' will not be inlinedMore Details: https://docs.oracle.com/error-help/db/ora-20001
BEGIN
show_inlining;
END;
Statement processed.
f1 called: 10
f2 called: 110
f3 called: 550