Re: SQLPlus prompt

From: Vikram Dayanidhi <vikran_at_Bayou.UH.EDU>
Date: Mon, 11 May 1998 19:35:27 -0500
Message-ID: <Pine.OSF.3.95q.980511192421.11953B-100000_at_Bayou.UH.EDU>


It is possible to change the sql prompt on SQLPlus based on the instance you are connecting to.The main problem is figuring out the name of the instance. We figured out the name of the database instance on our system by checking the computer name. Once we found the instance name, we used the following in our login script: (Note: 'show_where' is a function we created which returns the instance name)  

--===================================================================
-- This is used to set the sql prompt. A sql file called 'PROMPT.SQL'
-- is created which defines the variable PROMPT_VAR. This variable
-- is used to set the sql prompt....
--===================================================================
define prompt_var = 'SQL>'

set heading off
spool prompt.sql

select 	'define prompt_var = '||show_where||'>'
from 		dual;

spool off
set heading on
start prompt

set sqlprompt &prompt_var
---- End ----

Hope this helps

Vikram

On 11 May 1998, Sbaiz wrote:

> Hi all
>
> I'd like to change the prompt SQL> of SQLPlus. So I want to visualize the
> prompt SQL_<istance_name> instead of SQL>.
> There's somebody that know how help me.
>
> Thanks in advance
>
> Sbaiz P.
>
>
>
Received on Tue May 12 1998 - 02:35:27 CEST

Original text of this message