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 -> Re: Session ID

Re: Session ID

From: <UMESH.X.TIWARI_at_x400gw.ameritech.com>
Date: 1997/11/13
Message-ID: <879446207.31823@dejanews.com>#1/1

You already know that ORA-01422 is encountered because there are multiple sessions initiated by the same userid. Obviously you can not fetch multiple rows into one single variable in a pl/sql block unless you define a cursor for the purpose. You can make this view accessible (readable) by other users via a public synonym and granting select privileges to certain users.

Umesh



In article <Pine.GSO.3.96.971111160814.4720F-100000_at_sol10>,   Pepe Galindo <ppgg_at_lcc.uma.es> wrote:
>
> Hello people!
>
> I have some questions. I hope somebody answer me. I will be grateful if he
> answerd me by e-mail too. Thanks.
>
> 1. What number/s identify a Oracle session.
> 2. How can a normal user (not dba) know that numbers?
> If it is impossible then:
> How can I construct a PL/SQL procedure to do that?
>
> I think that to identify a session are necessary 2 numbers: SID and
> SERIAL# from table V$SESSION.
>
> How can a user know that numbers?
> V$SESSION is a dba table. Then I can construct a PL/SQL procedure with SYS
> as owner:
>
> PROCEDURE SESSIONID (SID OUT NUMBER,
> SERIAL# OUT NUMBER) IS
> Usuario ALL_TABLES.OWNER%TYPE;
> BEGIN
> SELECT USER INTO Usuario FROM DUAL;
> SELECT SID,SERIAL# INTO SID,SERIAL# FROM V$SESSION
> WHERE USERNAME=Usuario AND STATUS='ACTIVE';
> END SESSIONID;
>
> One problem arise when exist two 'ACTIVE' sessions with the same USERNAME.
> Then the oracle error is:
> ORA-01422: exact fetch returns more than requested number of rows
>
> How can I access to V$SESSION table to read this two values for a only one
> session??
>
> The last question: Do somebody know a oracle news in spanish language?
>
> Thank you very much.
> ppgg_at_lcc.uma.es
-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Thu Nov 13 1997 - 00:00:00 CST

Original text of this message

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