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: Accessing the Databse name with pl/sql

Re: Accessing the Databse name with pl/sql

From: Brian Peasland <dba_at_remove_spam.peasland.com>
Date: Wed, 13 Aug 2003 21:27:33 GMT
Message-ID: <3F3AAD45.29758ED1@remove_spam.peasland.com>


SQL is much easier than PL/SQL. For a straight SQL solution, try the following:

SELECT instance_name FROM v$instance;

If this *must* be done in a PL/SQL block then the following code should get you started:

DECLARE
  dbname V$INSTANCE.INSTANCE_NAME%TYPE;
BEGIN
  SELECT instance_name INTO dbname FROM v$instance; END;
/

HTH,
Brian

"Dave S." wrote:

>

> Hi,
> I need to extract y database name using pl/sql commands... how can I do?
> thahks in advance
-- 
===================================================================

Brian Peasland
dba_at_remove_spam.peasland.com

Remove the "remove_spam." from the email address to email me.


"I can give it to you cheap, quick, and good. Now pick two out of
 the three"
Received on Wed Aug 13 2003 - 16:27:33 CDT

Original text of this message

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