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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: possible to set continuation prompt in sql*plus?

Re: possible to set continuation prompt in sql*plus?

From: Daniel Fink <daniel.fink_at_sun.com>
Date: Wed, 23 Jul 2003 08:32:28 -0600
Message-Id: <25998.339132@fatcity.com>


This is a multi-part message in MIME format.

--------------78617B30111B6E7B1701FFDE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Building on Jacques' solution, here is one that aligns all the statements nice and neat. Of course, it does not have the username/instance, so I don't know how acceptable it is....

select ' 1 '
as new_prompt
from dual
/

set sqlprompt "&new_sqlprompt"

  1 select 1,

  2  2,
  3  3,
  4  4,
  5  5,
  6  6,
  7  7,
  8  8,
  9  9,

 10 10
 11 from dual;

         1 2 3 4 5 6 7 8 9 10 ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------

         1 2 3 4 5 6 7 8 9 10

Jacques Kilchoer wrote:
>
> You can always set your prompt to take up two lines, but that looks ugly to me too.
> See example.
> SQL> show user
> USER est "SYSTEM"
> SQL> show sqlprompt
> sqlprompt "SQL> "
> SQL> -- change prompt to be connected username and last 4
> SQL> -- characters of instance name
> SQL> column new_prompt new_value new_sqlprompt
> SQL> select
> 2 user || '@' || chr (10) ||
> 3 substr (instance_name, length (instance_name) - 3) || '>'
> 4 as new_prompt
> 5 from v$instance ;
>
> NEW_PROMPT
> -------------------------------------------------
> SYSTEM@
> jrk1>
>
> SQL> set sqlprompt "&new_sqlprompt"
> SYSTEM@
> jrk1>select *
> 2 from dual ;
>
> D
> -
> X
>
> SYSTEM@
> jrk1>
>
> > -----Original Message-----
> > From: Pardee, Roy E [mailto:roy.e.pardee_at_lmco.com]
> >
> > Apologies--I wasn't clear in my original post. Right now I'm getting:
> >
> > rpardee_at_devl> select username
> > 2 from dba_users
> > 3 where username like '%MC%' ;
> >
> > What I'd *really* like to have is:
> >
> > rpardee_at_devl> select username
> > 2 from dba_users
> > 3 where username like '%MC%' ;
> >
> > That way I could copy/paste sql commands as easily as I could
> > when my prompt was just "SQL> ".
> >
> > Setting sqlnumber off gets me:
> >
> > rpardee_at_devl> select username
> > rpardee_at_devl> from dba_users
> > rpardee_at_devl> where username like '%MC%' ;
> >
> > Which isn't horrible, although I do miss the numbers. But no
> > matter--I'll just live with it...
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Jacques Kilchoer
> INET: Jacques.Kilchoer_at_quest.com
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
--------------78617B30111B6E7B1701FFDE
Content-Type: text/x-vcard; charset=us-ascii;  name="daniel.fink.vcf"

Content-Transfer-Encoding: 7bit
Content-Description: Card for Daniel Fink
Content-Disposition: attachment;

 filename="daniel.fink.vcf"

begin:vcard
n:Fink;Daniel
tel;cell:303.808.3282
tel;work:303.272.3225
x-mozilla-html:TRUE
adr:;;;;;;
version:2.1
email;internet:daniel.fink_at_sun.com Received on Wed Jul 23 2003 - 09:32:28 CDT

Original text of this message

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