Re: Vertical align columns in sql*plus

  • From: Kurt-Franke@xxxxxx
  • To: oracle-l <oracle-l@xxxxxxxxxxxxx>, orasnita@xxxxxxxxx
  • Date: Thu, 15 Jul 2010 20:23:22 +0200 (CEST)


Hi,

if you abandon on the additional information like <row1>, column1 etc. you may try the following:


column "Newline Character" noprint new_value newline_char

select chr(10) "Newline Character" from dual;

set colsep "&newline_char"

undefine newline_char

column "Newline Character" clear

set recsep each

set recsepchar "-"


Now the columns of each selected row will be written as one column per line and a line of "-" is used
as separator between rows.


regards

kf

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

Other related posts: