Re: Setting SQL*Plus Prompt

From: N Prabhakar <prabhs_at_po.pacific.net.sg>
Date: 1996/12/07
Message-ID: <58afub$bui_at_newton.pacific.net.sg>#1/1


David Stark <david_stark_at_mentorg.com> wrote:
>I need to set the SQL*Plus prompt to the current SID. Is there an easier
>way other than granting read access to the v$database view?
>
>Thanks in advance

Hi there,

set sqlprompt = <oracle_sid>

You can retrieve ORACLE_SID from the environment variable ($ORACLE_SID)

From a unix shell script, you can retrieve the ORACLE_SID and pass it as a parameter to SQL*PLUS script (login.sql) which will set SQL*PROMPT.

For example,

a=$ORACLE_SID

sqlplus scott/tiger _at_login.sql $a

in Login.sql

define oracle_sid = &1
set sqlprompt '&oracle_sid'

I have not tried this, but I have feeling, that it will work

Good Luck

N.Prabhakar Received on Sat Dec 07 1996 - 00:00:00 CET

Original text of this message