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: SQL/SID question

Re: SQL/SID question

From: <Carl.Kristian.Eriksen_at_cinet.no>
Date: 1997/10/03
Message-ID: <875876121.21778@dejanews.com>#1/1

In article <3431DE6F.5694_at_deere.com>,
  jh33378nospam_at_deere.com wrote:
>
> Why not try this:
>
> select instance from v$thread;
>
> It works on my 7.2 system. I don't know if it would return multiple rows
> on OPS.

 This does not seem to work from PL/SQL functions. Declaring the following function:



CREATE OR REPLACE FUNCTION GetSid RETURN VARCHAR2 AS

        sSid VARCHAR2(9);
BEGIN

	SELECT instance INTO sSid
	FROM v$thread;
	RETURN sSid;

END;
/

generates the following error messages:
5/2      PL/SQL: SQL Statement ignored
6/7      PLS-00201: identifier 'V_$THREAD' must be declared
--------------------------------------------------------------
Prefixing with SYS or SYSTEM just changes the error messages slightly:

FROM SYS.v$thread;
5/2      PL/SQL: SQL Statement ignored
6/7      PLS-00201: identifier 'V$THREAD' must be declared
--------------------------------------------------------------
FROM SYSTEM.v$thread;
5/2      PL/SQL: SQL Statement ignored
6/7      PLS-00201: identifier 'SYSTEM.V$THREAD' must be declared
--------------------------------------------------------------

 Is there any way to get around this ?

ck

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Fri Oct 03 1997 - 00:00:00 CDT

Original text of this message

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