Say I have a function :
create or replace function test_function return integer as PRAGMA AUTONOMOUS_TRANSACTION; t_test integer :=1; begin update test1 set id = id+1 ; // table test1 has, for simplicity sake, just 1 column,id commit; return (t_test); end;
There are at least two ways I can execute it (so function successfully updates
SELECT test_function FROM dual;
SELECT 1 FROM dual WHERE test_fucntion =1;
Which one is the right ?
Also, I can do
SELECT 1 FROM dual
INNER JOIN (SELECT test_function FROM dual)a ON (1=1)
which doesn't show an error, but also doesn't update the table.
I'm really curious if it's intended behavior; I don't see why update fails...
I'm using Oracle 10 if it matters.