Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> v$database
I need to know which instance I'm running in:
from sql*plus
select name from v$database ;
NAME
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 ;
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