Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Setting prompt in SQL*Plus

Re: Setting prompt in SQL*Plus

From: Bob Cunningham <bcunn_at_oanet.com>
Date: Sun, 26 Apr 1998 02:22:35 GMT
Message-ID: <35429820.80317980@news.oanet.com>


On 25 Apr 1998 06:42:23 GMT, "Ng TC" <tcng_at_yas.com.sg> wrote:

>
>Hi,
>
>I read somewhere that the following (when included in glogin.sql) sets the
>prompt of sqlplus to the instance I am connecting to:
>
>select lower(substr(global_name,1,(instr(global_name,'.')-1))) sid from
>global_name;
>set sqlprompt 'SQL &osid>'
>
>It works fine, but when I do a 'connect' again, it will not reflect the new
>instance.
>
>Is there a way around this? I want the prompt to show the correct instance
>that I am connected to.

You could write an SQL script to be used instead of directly issuing the CONNECT command. The script would issue the CONNECT and then execute the login script(s) you desire. As well, since the login script will issue a DML statement overwriting the current contents of the SQL buffer, the connection script could save the buffer contents and restore it later so that you wouldn't lose the current buffer contents across the reconnection process.

>
>Thanks.
>
>Regards,
>Tse Chong

Bob Cunningham
bcunn_at_oanet.com Received on Sat Apr 25 1998 - 21:22:35 CDT

Original text of this message

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