I'm running 10g XE on Windows Vista and I was just playing around looking at v$sysstat. The following pl/sql code works fine when run as system (not as sysdba)
declare
function phys_reads RETURN NUMBER IS
phys number;
begin
select value into phys from v$sysstat where name = 'physical reads';
return phys;
end;
begin
dbms_output.put_line('phys = '||phys_reads);
end;
but if make phys_reads a stand alone procedure like this
create or replace
function phys_reads RETURN NUMBER IS
phys number;
begin
select value into phys from v$sysstat where name = 'physical reads';
return phys;
end;
I get
Error(4,35): PL/SQL: ORA-00942: table or view does not exist
Can anyone explain why this is?
Edited by: ow007829 on Aug 10, 2010 11:49 PM