From kirti.deshpande@verizon.com Mon, 14 May 2001 19:22:16 -0700 From: "Deshpande, Kirti" Date: Mon, 14 May 2001 19:22:16 -0700 Subject: RE: strange problem Message-ID: MIME-Version: 1.0 Content-Type: text/plain Hi Narender, You will need to grant explicit select privilege to the user id for accessing the underlying view sys.v_$session to be able to do this in a PL/SQL procedure. The id may have access to the v$session via a role. And that would not work in a PL/SQL procedure. HTH.. Regards, - Kirti Deshpande Verizon Information Services http://www.superpages.com > -----Original Message----- > From: Narender Akula [SMTP:narender.akula@terralinkltd.com] > Sent: Monday, May 14, 2001 7:16 PM > To: Multiple recipients of list ORACLE-L > Subject: strange problem > > 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 > ------------------------------ > MLOBO > this is ok... > > CREATE OR REPLACE PROCEDURE n2 IS > tmpVar varchar2(100); > BEGIN > select osuser into tmpvar from v$session where username = 'MLOBO' > and rownum = 1; > dbms_output.put_line ('name '||tmpvar); > EXCEPTION > WHEN NO_DATA_FOUND THEN > Null; > WHEN OTHERS THEN > Null; > END n2; > > this is failing says sys.V_$session must be declared. > what could be reason ? > > > narender.akula > > > > > > > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.com > -- > Author: Narender Akula > INET: narender.akula@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@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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Deshpande, Kirti INET: kirti.deshpande@verizon.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@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).