Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

A simple output pivot option for sqlplus (or SQLcl)

Martin PreissApr 7 2015 — edited Jan 11 2016

In postgres' command line client (psql) there is a nice output pivoting switch to display records in a vertical view:

select * from t;

a | b | c

---+---+---

1 | 2 | 3

4 | 5 | 6


--> Switch display with \x


select * from t;


-[ RECORD 1 ]

a | 1

b | 2

c | 3

-[ RECORD 2 ]

a | 4

b | 5

c | 6

This would make data analysis simpler for result sets with many columns. Of course there are some useful helper functions (Tom Kyte's print_table, Tanel Poder's printtab), but I would prefer a simple built-in mechanism providing this.

Comments
Post Details
Added on Apr 7 2015
11 comments
1,150 views