Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: set sqlprompt to something useful
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