Ggf. liegt es an dem Attribut "[NOT] DETERMNINISTIC" !

DETERMINISTIC
or NOT DETERMINISTIC Specifies whether the procedure returns the same results each time the procedure is called with the same IN and INOUT arguments.
NOT DETERMINISTIC The procedure may not return the same result each time the procedure is called with the same IN and INOUT arguments, even when the referenced data in the database has not changed.
DETERMINISTIC The procedure always returns the same results each time the procedure is called with the same IN and INOUT arguments, provided the referenced data in the database has not changed.