Hi ,
I have read the following statement (correct option for the question)in 1z0-147 questions.
The question is :: WHEN USING A PACKAGED FUNCTION IN A QUERY which of the following is true ::
The packaged function cannot execute DML statements against the table that is being queried
I tried the following to understand the above statement
create or replace package test_pk is
function fn_test(i number) return number ;
end;
create or replace package body test_pk is
function fn_test (i number) return number is
j number:=1;
begin
insert into a values(200,300);
commit;
return j;
end;
end test_pk;
Upon executing the above function in the select statement
select TEST_PK.FN_TEST(1) from dual
I got the error saying that Can't perform DML Inside SElect
Is this example for the above statement is TRUE ????
Could you please explain me if my example is wrong
Thanks
Edited by: Smile on Nov 22, 2012 9:47 AM