I'm trying to use Oracle's Function Result Cache on 11.2.0, so I did the following test:
CREATE OR REPLACE FUNCTION get_test_value
RETURN NUMBER
RESULT_CACHE
AS
BEGIN
dbms_output.put_line( 'Called' );
RETURN 0;
END;
SELECT get_test_value FROM dual;
My example prints Called
every time, though.
I also tried some other examples found online, but the cache is not used.
I tried ALTER SYSTEM SET result_cache_max_size = 10485760;
Still doesn't work.
I tried ALTER SESSION SET result_cache_mode=FORCE;
(which should not be necessary) - didn't help.
SELECT dbms_result_cache.status FROM dual;
always returns DISABLED
.
What am I doing wrong?