Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: strange problem
When using sqlplus to do the select you are most probably using the privileges
that have been assigned to you in a role. Privileges assigned to
a user through a role are not used (or applied) inside PL/SQL blocks (procedures/functions).
You need to have the appropriate privilege explicitly granted to the user
who is executing the procedure/function. In your case you will need
to explicitly grant select on the v$session view (or base table, sys.v_$session)
to the user account that is executing the procedure.
Glen
Narender Akula wrote:
hi gurus,
I am able to select from every hting from v$session at command line.
but when i write in procedure it fails .... why.
SQL> select osuser from v$session where username = 'IMAGE_INDEX' and
rownum
= 1;
OSUSER
EXCEPTION WHEN NO_DATA_FOUND THEN Null; WHEN OTHERS THEN Null;
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Narender Akula INET: narender.akula_at_terralinkltd.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Glen Mitchell NZ Phone: +64 9 3730400 Energy Research Lab URL: http://www.peace.com Peace Software Email: glen.mitchell_at_peace.comReceived on Mon May 14 2001 - 20:59:43 CDT