Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Is it possible to make the SQL*Plus prompt with "newline" character ?

Re: Is it possible to make the SQL*Plus prompt with "newline" character ?

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Tue, 10 Feb 2004 13:55:51 -0000
Message-ID: <4028e2e9$0$7064$ed9e5944@reading.news.pipex.net>


I modified Connor's instructions at
http://www.jlcomp.demon.co.uk/faq/sqlplus_prompt.html to do this

SQL*Plus: Release 9.2.0.4.0 - Production on Tue Feb 10 13:40:10 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production

SQL>define prompt ='not connected'
SQL>column x new_value prompt
SQL>set termout off
SQL>select global_name||chr(10)||'>' x from global_name;
SQL>set sqlprompt '&&prompt'

DBNAME_REMOVED
>select 1 from dual;

         1


         1

Note the caveat (pre 10g) that if you put this in glogin.sql then issue conn dbname/pass_at_db the script doesn't get reexecuted and you end up thinking you are on test instead of production or whatever. Apparently 10g fixes this behaviour, but I have just hosed my linux box so can't verify this.

-- 
Niall Litchfield
Oracle DBA
Audit Commission UK
"David" <david_at_david.nospam.com> wrote in message
news:c0aij0$oc92_at_imsp212.netvigator.com...

> I want to create the prompt like this:
>
> <database_name>
> > select * from v$database;
> .
> .
> .
>
> 1 rows selected
>
> <database_name>
> > select * from v$database;
>
> i.e. is it possible to do something like this <database_name> || chr(10)
||
> >
>
>
>
Received on Tue Feb 10 2004 - 07:55:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US