The DETERMINISTIC keyword is a promise that a function returns the same result for the same input values.
Oracle trusts this declaration and does not verify that the implementation satisfies it.
An incorrect declaration can therefore allow queries to use stale or incorrect results.
This rule reports deterministic functions whose implementation contains clear evidence of a dependency on changing time, session or sequence state, reads mutable database data, or performs a side effect. The analysis is intentionally conservative and does not prove that an unreported function is deterministic. It does not infer impurity from calls to user-defined routines, unresolved package or global state, or NLS-sensitive expressions. For package functions, the declaration must be DETERMINISTIC in the matched package specification.
CREATE FUNCTION current_value RETURN DATE DETERMINISTIC IS BEGIN RETURN SYSDATE; END;
CREATE FUNCTION double_value(p_value NUMBER) RETURN NUMBER DETERMINISTIC IS BEGIN RETURN p_value * 2; END;