Re: SQL*Plus custom prompt as user name?

From: Karen Morgan <KMMorgan_at_erols.com>
Date: Sat, 7 Aug 1999 21:40:14 -0500
Message-ID: <7oin5e$fve$1_at_autumn.news.rcn.net>


Igor Zotov wrote in message ...
>Hi,
>is there any way to show current user name in SQL*Plus prompt?
>
>Regards.
>Igor.
>
>
>

[Quoted] The following Login.sql script will give the username and database instance as the sql prompt at login. For example if the username is SCOTT and the instance is TEST then the prompt will become: scott test>

/*
****************************************************************************
*************** */

set termout off
/*

   Filename: Login.sql

   Purpose: To setup prompts and such for a sql*plus login.

  • Be sure to edit the registry and modify the oracle sqlpath to include the directory where it's contained. SQL*Plus will automatically run on login.

   Created on 2-May-1997 by Karen Morgan. */
set numwidth 9
set linesize 180
set pagesize 300
column sid new_value osid noprint
column usr new_value ousr noprint
select lower (substr (global_name, 1, (instr (global_name, '.') -1))) sid   from global_name ;
select lower (user) usr from dual ;
set termout on
set sqlprompt '&ousr &osid> '

/*
****************************************************************************
*************** */


Good Luck,
Karen Received on Sun Aug 08 1999 - 04:40:14 CEST

Original text of this message