Set Column Size in SQLplus

Symptom

In SQLplus, you’ll always facing a below query which is hard for you to read. It’s a headache to read all these output clearly. As an example, you want list out MANDT, BNAME and PWDSALTEDHASH from the table USR02 of user aracici.

SQL> select MANDT, BNAME, PWDSALTEDHASH from sapsr3.usr02 where BNAME='aracici';

MANDT     BNAME
--------- ------------------------------------
PWDSALTEDHASH
-----------------------------------------------------------------------------------------
120       aracici
ZzkyItkHxue5bE={x-issha, 1024mtjiYeIV96qnJagM8o}k5eWUvA4Vdm

Solution

1. This is an example for above query. You can adjust your query output accordingly.

SQL> column MANDT format a10;
SQL> column BNAME format a20;
SQL> column PWDSALTEDHASH format a50;
SQL> set linesize 300

2. You’ll getting the output result.

MANDT      BNAME                PWDSALTEDHASH
---------- -------------------- --------------------------------------------------
120        aracici              ZzkyItkHxue5bE={x-issha, 1024mtjiYeIV96qnJagM8o}k
                                5eWUvA4Vdm

Note

– set linesize n set the output width of SQLplus.
– format a10, a20 = character counts

You May Also Like

Leave a Reply?