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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Making database name part of SQL prompt in sqlplus

Re: Making database name part of SQL prompt in sqlplus

From: Deborah Lorraine <dlorraine_at_ucdavis.edu>
Date: Thu, 06 Jul 2000 16:48:27 -0700
Message-Id: <10550.111382@fatcity.com>

--=====================_1757839569==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

Here's our glogin.sql which sets the prompt:

rem SQL*Plus global login startup file. rem
rem Set the SQL prompt to include the database name rem selected from v$parameter
rem
rem set feedb on echo on
set termout off
column value noprint new_value dbname
select value
from v$parameter
where name = 'db_name'
/
set sqlprompt "&dbname:SQL>"
column value print
rem
rem Issue a commit to clear transaction buffer in case rem the user wants to do a 'set transaction ...' rem
commit
/

def _editor=vi
set newpage 0
set pagesize 23
set numwidth 7
set pause on pause '[4mPress enter to continue or ^C to stop[5m...[m' rem
rem Invoke users '.sqlrc' file if it exists rem
@$HOME/.sqlrc
set termout on

At 12:26 PM 7/6/00 , you wrote:
>Anyone know how to do it?
>
>I've got a number of users doing SQL*Plus work and they keep making errors
>as to which instance they are in...
>
>Anyone?
>
>J
>
>--
>Author: Jay Weinshenker
> INET: jweinshe_at_concentric.net
>
>Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
>San Diego, California -- Public Internet access / Mailing Lists
>--------------------------------------------------------------------
>To REMOVE yourself from this mailing list, send an E-Mail message
>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
>the message BODY, include a line containing: UNSUB ORACLE-L
>(or the name of mailing list you want to be removed from). You may
>also send the HELP command for other information (like subscribing).

--=====================_1757839569==_.ALT
Content-Type: text/html; charset="us-ascii"

<html>
<font face="Courier New, Courier">Here's our glogin.sql which sets the prompt: <br>
<br>
rem&nbsp; SQL*Plus global login startup file.<br> rem<br>
rem&nbsp; Set the SQL prompt to include the database name <br> rem&nbsp; selected from v$parameter<br>
rem <br>
rem set feedb on echo on<br>
set termout off<br>
column value noprint new_value dbname<br> select value<br>
from v$parameter<br>
where name = 'db_name'<br>
/<br>
set sqlprompt &quot;&amp;dbname:SQL&gt;&quot;<br> column value print<br>
rem<br>
rem&nbsp; Issue a commit to clear transaction buffer in case <br> rem&nbsp; the user wants to do a 'set transaction ...'<br> rem<br>
commit<br>
/<br>
<br>
def _editor=vi<br>
set newpage 0<br>
set pagesize 23<br>
set numwidth 7<br>
set pause on pause '[4mPress enter to continue or ^C to stop[5m...[m'<br>
rem<br>
rem&nbsp;&nbsp; Invoke users '.sqlrc' file if it exists<br> rem<br>
@$HOME/.sqlrc<br>
set termout on<br>

<br>
<br>
<br>
</font>At 12:26 PM 7/6/00 , you wrote:<br>
<blockquote type=cite cite>Anyone know how to do it?<br>
<br>

I've got a number of users doing SQL*Plus work and they keep making errors as to which instance they are in...<br> <br>
Anyone?<br>
<br>
J<br>
<br>
-- <br>
Author: Jay Weinshenker<br>
&nbsp;INET: jweinshe_at_concentric.net<br>
<br>
Fat City Network Services&nbsp;&nbsp;&nbsp; -- (858) 538-5051&nbsp; FAX: (858) 538-5051<br>
San Diego, California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet access / Mailing Lists<br>
--------------------------------------------------------------------<br>
To REMOVE yourself from this mailing list, send an E-Mail message<br> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in<br> the message BODY, include a line containing: UNSUB ORACLE-L<br> (or the name of mailing list you want to be removed from).&nbsp; You may<br>
also send the HELP command for other information (like Received on Thu Jul 06 2000 - 18:48:27 CDT

Original text of this message

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