Hi All,
I just came across an interesting question. In the following function UPDATE statement is used, even though the function is created RESULT_CACHE. It seems illogical. I am just wondering, is it possible?
If so, why RESULT_CACHE is used? Because it means "do not execute the function, look the hash table for the result and return result to the user" if there is UPDATE statement, so doesn't that mean it has to execute for each call and using with RESULT_CACHE and UPDATE/DELETE/MERGE is illogical or wrong?
Thanks for your help.
CREATE OR REPLACE FUNCTION plch_get_data (id_in IN INTEGER)
RETURN VARCHAR2
RESULT_CACHE
IS
BEGIN
DBMS_OUTPUT.put_line ('Executed');
UPDATE plch_data
SET nm = UPPER (nm)
WHERE id = id_in;
COMMIT;
RETURN 'UPPER';
END;
/