View Single Post
Old May 31st, 2006, 5:45 PM   #5
jim mcnamara
Hobbyist Programmer
 
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4 jim mcnamara is on a distinguished road
SET SERVEROUT ON SIZE 10000
DECLARE
    DBNAME  VARCHAR2(32):=null;
BEGIN
    SELECT name
    INTO DBNAME
    FROM v$database;
    DBMS_OUTPUT.ENABLE;
    DBMS_OUTPUT.PUT_LINE('DATABASE NAME = ' || DBNAME);
END;
/

This is the basic code to get the db name - it displays it. For a trigger you would not want a display.
jim mcnamara is offline   Reply With Quote