Re: Vertical align columns in sql*plus

  • From: Taral Desai <taral.desai@xxxxxxxxx>
  • To: Mark.Bobak@xxxxxxxxxxxx
  • Date: Fri, 16 Jul 2010 16:59:24 -0500

Attached is same prom Tom Kyte but no need to store in database

SQL> @print "select empno,ename from emp"
.EMPNO                        : 7369
.ENAME                        : SMITH
-----------------
.EMPNO                        : 7499
.ENAME                        : ALLEN
-----------------
.EMPNO                        : 7521
.ENAME                        : WARD
-----------------
.EMPNO                        : 7566
.ENAME                        : JONES
-----------------
.EMPNO                        : 7654
.ENAME                        : MARTIN
-----------------
.EMPNO                        : 7698
.ENAME                        : BLAKE
-----------------
.EMPNO                        : 7782
.ENAME                        : CLARK
-----------------
.EMPNO                        : 7788
.ENAME                        : SCOTT
-----------------
.EMPNO                        : 7844
.ENAME                        : TURNER
-----------------
.EMPNO                        : 7876
.ENAME                        : ADAMS
-----------------
.EMPNO                        : 7900
.ENAME                        : JAMES
-----------------
.EMPNO                        : 7902
.ENAME                        : FORD
-----------------
.EMPNO                        : 7934
.ENAME                        : MILLER
-----------------

On Fri, Jul 16, 2010 at 1:24 PM, Bobak, Mark <Mark.Bobak@xxxxxxxxxxxx>wrote:

> A more flexible solution would be Tom Kyte's print_table procedure.
>
> See here:
>
> http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1035431863958
>
> -Mark
>
>
>
>
> -----Original Message-----
> From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]
> On Behalf Of Maureen English
> Sent: Friday, July 16, 2010 2:15 PM
> To: orasnita@xxxxxxxxx
> Cc: oracle-l
> Subject: Re: Vertical align columns in sql*plus
>
> Octavian,
>
> I knew I saw something like this before, so I asked one of
> my coworkers who writes a lot of reporting queries.
>
> You can try using newline...
>
> For example, run this query:
>
> set lines 80
> set pages 2000
> set echo off
> set verify off
> set feedback off
> set head off
>
> column who    newline
> column dbase  newline
> column dspace newline
> column tspace newline
> column prof   newline
>
> select 'USERNAME:             '||username who,
>        'DATABASE:             '||name dbase,
>        'DEFAULT TABLESPACE:   '||default_tablespace dspace,
>        'TEMPORARY TABLESPACE: '||temporary_tablespace tspace,
>        'PROFILE:              '||profile prof
> from v$database, dba_users
> ;
>
> - Maureen
>
> Octavian Rasnita wrote:
> > Hi,
> >
> > Is it possible to align vertically the columns displayed in sql*plus
> > like under SQLite by using .mode line or in MySQL by ending the query
> > with \G?
> >
> > ...something like:
> >
> > <row1>
> > column1: 1.23
> > column2: "the value"
> > column3: 0
> > <row2>
> > column1: 2.55
> > column2: "another val"
> > column3: 1
> >
> > Thank you.
> >
> > --
> > Octavian
> >
> >
> > __________ Information from ESET NOD32 Antivirus, version of virus
> > signature database 5280 (20100715) __________
> >
> > The message was checked by ESET NOD32 Antivirus.
> >
> > http://www.eset.com
> --
> //www.freelists.org/webpage/oracle-l
>
>
>
>
> --
> //www.freelists.org/webpage/oracle-l
>
>
>


-- 
Thanks & Regards,
Taral Desai

Other related posts: