cannot select from dba_role_privs in FUNCTION - WHY? [message #393384] |
Sun, 22 March 2009 07:46 |
roithi
Messages: 8 Registered: March 2006
|
Junior Member |
|
|
Hi guys
When i do the following statement in my editor it works,
select count(*) from dba_role_privs;
but when i put this select statement into my function i get an compilation error "table or view not found".. how can that be?
code of the function:
create or replace function get_student
(p_schema in varchar2, p_tab in varchar2) return varchar2 as
e_ret varchar2(2000);
counter number;
begin
select count(*) into counter from dba_role_privs;
end;
/
6/24 PL/SQL: ORA-00942: Tabelle oder View nicht vorhanden
the user has the role DBA,
|
|
|
Re: cannot select from dba_role_privs in FUNCTION - WHY? [message #393386 is a reply to message #393384] |
Sun, 22 March 2009 08:11 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
Check your privs again.
You need to grant
to the dba user.
Also please post how you are calling the function.
I was not sure about your processing logic/in parameters.
So just removed it.
1 create or replace function get_student
2 return number as
3 counter number;
4 begin
5 select count(*) into counter from dba_role_privs;
6 return counter;
7* end;
scott@chum > /
Function created.
scott@chum > select get_student from dual;
GET_STUDENT
-----------
151
scott@chum > select count(*) from dba_role_privs;
COUNT(*)
----------
151
[Updated on: Sun, 22 March 2009 08:16] Report message to a moderator
|
|
|
|