Home » SQL & PL/SQL » SQL & PL/SQL » role in annonymus PL SQL block vs Database Procedure (oracle 9i)
role in annonymus PL SQL block vs Database Procedure [message #285798] Wed, 05 December 2007 12:26 Go to next message
mithsingh
Messages: 1
Registered: December 2007
Junior Member
Hi,

Here is the a sample code
declare
m_count number;
begin
select count(1) into
m_count
from dba_view;
end;

if I try to run this as annonymous pl/sql block it runs fine but when I try to run it as database procedure it gives error saying ' Invalid object dba_view not found'. What is the reason? I guess it has to do something to do with role which, by default, gets disabled while executing a database procedure, but I am not sure .
Can anyone throw some light .

Regards
Re: role in annonymus PL SQL block vs Database Procedure [message #285799 is a reply to message #285798] Wed, 05 December 2007 12:29 Go to previous message
BlackSwan
Messages: 25043
Registered: January 2009
Location: SoCal
Senior Member
Privs acquired via ROLE do NOT apply within PL/SQL procedures.

Previous Topic: Finding the difference between dates
Next Topic: Sort operation : SQL end or ETL end ?
Goto Forum:
  


Current Time: Wed Dec 07 08:26:11 CST 2016

Total time taken to generate the page: 0.06947 seconds