Re: sqlprompt in Sql*Plus
Date: 1995/06/30
Message-ID: <fkuyt.13.0015C2B3_at_iaehv.nl>#1/1
In article <3ssiov$cbd_at_palm.phcs.com> dhe_at_phcs.phcs.com (David Hermann) writes:
>From: dhe_at_phcs.phcs.com (David Hermann)
>Subject: Re: sqlprompt in Sql*Plus
>Date: 28 Jun 1995 17:49:19 -0400
>In article <3smipm$8j9_at_sheoak.bendigo.latrobe.edu.au>,
>ian_at_ironbark.bendigo.latrobe.edu.au (Ian Couroulis) writes:
>
>|> 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?
>I don't know how to make the sqlprompt automatically update itself,
>but there's an easy way to make it reflect the current status:
>column tmp new_value tmp
>select name||' ('||lower(user)||') > ' tmp
> from V$PARAMETER
> where name = 'db_name' ;
>set sqlprompt "&tmp"
>You could put this in a script and run it
> (a) from your login.sql
>and (b) each time the information in your prompt changes.
>But a truly dynamic prompt would be better.
I haven't tried it, but you could do something like this :
create a script called 'connect.sql'. This file would contain a connect-statement and something like your query (see above). In SQL*Plus you wouldn't use
PROMPT> connect scott/tiger
but
PROMPT> _at_connect scott/tiger
This way your prompt changes dynamically each time you use a connect statement.
Greetings,
Frank
Since I use this account only for reading the usenet's newsgroups, I won't normally respond to E-mail send to this account.
If you want to E-mail me, please use my Compuserve account : 100413.2067_at_compuserve.com Received on Fri Jun 30 1995 - 00:00:00 CEST