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: set sqlprompt to something useful

Re: set sqlprompt to something useful

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 09 Dec 1999 16:08:15 -0500
Message-ID: <4g605s078jbhnh5cbj6o3oaift6k4p83ep@4ax.com>


A copy of this was sent to ccyr6798_at_my-deja.com (if that email address didn't require changing) On Thu, 09 Dec 1999 20:36:02 GMT, you wrote:

>
>
>
>I'd like to set my sqlprompt in my login to something like
>
>user dbSID>
>
>but can't get the stuff into the prompt.
>
>set sqlp = select username||'> ' from user_users;
>doesn't work and neither does setting a variable.
>
>how do I get it to eval the stuff on the right before making the
>assignment?
>

I put something like this:

column global_name new_value gname
set termout off
select lower(user) || '@' ||
decode(global_name, 'ORACLE8.WORLD', '8.0', 'ORA8I.WORLD', '8i', global_name ) global_name from global_name; set termout on
set sqlprompt '&gname> '

into my login.sql. you cannot really get at the SID (environment variable -- you could problem do something with HOST) so I use the global database name.

>thanks,
>Cary
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Dec 09 1999 - 15:08:15 CST

Original text of this message

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