Re: sqlprompt in Sql*Plus

From: Rennick Sandra <t89003_at_isdserv.dehavilland.ca>
Date: 1995/06/28
Message-ID: <1995Jun28.152948.1835_at_dhnews.dehavilland.ca>#1/1


Ian Couroulis (ian_at_ironbark.bendigo.latrobe.edu.au) wrote:
: I thought I read somewhere that it was possible to automatically
: set the prompt in Sql*Plus from "SQL>" to the value of $ORACLE_SID
: by putting something in the global login (glogin.sql) file. I have
: tried experimenting with the 'sqlprompt' value in Sql*Plus but not
: having much luck.
 

: What I really would like is my prompt set to: ORACLE_SID (user)
: For instance:
 

: EMP (scott) > connect tiger/tiger
: EMP (tiger) >

 

: Is this possible? If not, what about either ORACLE_SID or user
: as the prompt?
 

: Ian.
: --

Hi Ian:

We use the following statements in our glogin.sql:

column name new_value dname noprint
select name from v$database;
define pmt = 'SQL-&&dname>>'
set sqlprompt "&&pmt "

This sets the prompt to be SQL-[ORACLE_SID]>>

   Where [ORACLE_SID] is replaced with your SID.

To make this work, we had to grant select on v$database to public.

I don't see why you could not replace the query with "select user from dual;"

Hope this helps.

Sandra Rennick Received on Wed Jun 28 1995 - 00:00:00 CEST

Original text of this message