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: Oracle database name in SQL*Plus prompt

Re: Oracle database name in SQL*Plus prompt

From: <jan_at_abs.ee>
Date: 1997/07/21
Message-ID: <5qvfn0$dpp@drn.zippo.com>#1/1

Hi Winston,

>Is there an easy way to set my prompt in SQL*Plus to the name of the
>database that I am using without having to prompt myself for the name of
>the database ?

I have created two scripts to make it comfortable.

SET TERMOUT OFF BREAK ON TODAY
COLUMN TODAY NEW_VALUE _DATE
SELECT TO_CHAR(SYSDATE, 'fmMonth DD, YYYY') TODAY FROM DUAL;
CLEAR BREAKS COLUMN USER_NAME NEW_VALUE _USR
COLUMN MESS_NAME NEW_VALUE _mess

define _usr = ""
define _mess = "not logged in"

SELECT USER||'@'||substr(global_name,1,instr(global_name,'.')-1) USER_NAME ,'logged in' MESS_NAME FROM global_name;

set sqlp "&_usr> "

alter session set nls_date_format='DD.MM.YYYY'; SET TERMOUT ON prompt &_mess


Just forget the command 'connect'! If you don't, you'll be doing very big mistakes very fast.

Jan
jan_at_abs.ee Received on Mon Jul 21 1997 - 00:00:00 CDT

Original text of this message

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