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: Three SQL*Plus Questions

Re: Three SQL*Plus Questions

From: Brett Neumeier <random_at_interaccess.com>
Date: 1998/02/19
Message-ID: <6ci0u0$ma5$1@nntp3.interaccess.com>#1/1

Frank Hubeny (fhubeny_at_ntsource.com) wrote:
: I don't believe the following are possible to do in either plus33w.
: Are they possible in plus80w?
:
: 1) Can I dynamically change the prompt from "SQL>" to the username of
: the user to whom I am connected at the moment? That is, if I connect as
: user SYSTEM, then "SYSTEM>" would appear as the prompt without my having
: to do anything but make the connection.

Actually I think you can do something like this.

There's a SQL file that is automatically run when you start SQLPLUS. I don't remember, unfortunately, what it's called or where it needs to be. But I suspect that if you put the following code in such a file, it will work just fine:

---snip
set feedback off
set termout off
col curr_user new_value current_user
select user curr_user from dual;
set feedback on
set termout on
set sqlprompt "&&current_user> "
---snip

Of course you may also need to have a script that you use in place of the connect command, for when you change connections:

---snip
REM connect.sql, call as "@connect user password dbname" connect &1/&2@&3
set feedback off
set termout off
select user curr_user from dual;
set feedback on
set termout on
set sqlprompt "&&current_user> "
---snip

I haven't tried this myself so I don't know whether it works. But perhaps it will help.

-- 
-bn
random_at_interaccess.com	(PGP 2.6.2 public key available on request)
"There is no .signature -- only ZUUL!"
Received on Thu Feb 19 1998 - 00:00:00 CST

Original text of this message

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