dba:Login prompt

SET TERMOUT OFF
COLUMN dbname NEW_VALUE prompt_dbname
SELECT
  SUBSTR(
    global_name,
    1,
    DECODE(
      INSTR(global_name,'.'),
      0,
      LENGTH(global_name),
      INSTR(global_name,'.')-1
    )
  ) dbname
FROM
  global_name;

SET SQLPROMPT "&&prompt_dbname> "
SET TERMOUT ON
Advertisements