| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Weird happenings inside the package
I created package BOB as :
create or replace package bob as
procedure getcount(v_tabname in varchar2);
end;
/
create or replace package body bob is
procedure getcount(v_tabname in varchar2) as
h_count number;
begin
select count(*) into h_count
from all_tables where table_name=UPPER(v_tabname);
dbms_output.put_line(h_count);
end
end bob;
/
create public synonym bob for bob;
grant execute on bob to public;
If I execute the package using the login that created it (SYSTEM) then it returns the correct value. If, however, I connect as another user (that does have select rights on ALL_TABLES) the procedure returns zero, but running the select statement that sets h_count returns the correct value. Why ?
-- PeasantReceived on Thu Aug 16 2001 - 04:05:19 CDT
![]() |
![]() |