Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Weird happenings inside the package

Weird happenings inside the package

From: Peasant <1_at_a.b>
Date: Thu, 16 Aug 2001 11:05:19 +0200
Message-ID: <fh2nntcaj4suib1cgci2rrh8p90f4ms7fp@4ax.com>


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 ?

--
Peasant
Received on Thu Aug 16 2001 - 04:05:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US