Search This Blog

Wednesday, May 5, 2010

Change SQL prompt oracle SQL*Plus (pre 10g)

Here we discussed how to change prompt for release 10g and up. Now we will discuss how to achieve same in pre 10g releases

Enter following commands in glogin.sql file located at $ORACLE_HOME/sqlplus/admin directory or execute them one by one at SQL Prompt.

col username new_value username
col dbname new_value dbname
set termout off
SELECT lower(user) username,
       substr(global_name, 1, instr(global_name, '.')-1) dbname
FROM   global_name
set termout on
set sqlprompt '&&username@&&dbname> '

1 Comment:

sap project system said...

I have to say that your blog is one of the most informative blogs I found about Oracle. This post describe how to change SQL prompt. The code is short and simple. You can understand the logic and apply it directly.

Copyright (c) All rights reserved. Presented by Suresh Vaishya