Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> v$database

v$database

From: jhking <jhking_at_airmail.net>
Date: Wed, 07 Aug 2002 17:35:31 -0500
Message-ID: <C3520C9D875DA5C7.032057F1C822E449.5DEF9D353EBD44C4@lp.airnews.net>


I need to know which instance I'm running in: from sql*plus
select name from v$database ;
NAME



HTD1

SQL> create or replace function whereami

   2 return varchar2
   3 is
   4 inst v$database.name%type ;
   5 begin

   6      select name
   7        into inst
   8        from v$database  ;
   9      return inst ;

  10 end ;
  11 /

Warning: Function created with compilation errors.

SQL> show errors
Errors for FUNCTION WHEREAMI:

LINE/COL ERROR

-------- -----------------------------------------------------------------
4/9      PLS-00201: identifier 'SYS.V_$DATABASE' must be declared
4/9      PL/SQL: Item ignored
6/5      PL/SQL: SQL Statement ignored
8/12     PLS-00201: identifier 'SYS.V_$DATABASE' must be declared
9/5      PL/SQL: Statement ignored
9/12     PLS-00320: the declaration of the type of this expression is
          incomplete or malformed

How can I get this information from inside a function/procedure/package?

8.1.7.0.0 database on Solaris. Received on Wed Aug 07 2002 - 17:35:31 CDT

Original text of this message

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