Skip to Main Content

SQL & PL/SQL

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!

How to format columns properly in SQL Plus?

JulaayiNov 18 2013 — edited Nov 20 2013

Hello All,

How do you setup a default style for displaying the output columns in sqlplus? The columns look clumsy when queried. They display correctly in Toad but, I wanted to learn through sqlplus and I am relatively new to Oracle world. So, just wondering how can I do this?

Here is the DESC of table

SQL> DESC EMP.GROUP_TYPE

Name

              Null?    Type

-------------------------------------------------------------------------------

--------------------------------------------------------------------------------

-------------- -------- --------------------------------------------------------

------------------------------------------------------------

GROUP_TYPE

              NOT NULL VARCHAR2(30 CHAR)

SUMMARY_CNT

                        NUMBER

GROUP_TYPE_DESC

                        VARCHAR2(200 CHAR)

UPDT_DT

              NOT NULL DATE

SQL>

DDL for the Table

CREATE TABLE EMP.GROUP_TYPE

(

  GROUP_TYPE    VARCHAR2(30 CHAR)            NOT NULL,

  SUMMARY_CNT    NUMBER,

  GROUP_TYPE_DESC  VARCHAR2(200 CHAR),

  UPDT_DT          DATE                         DEFAULT SYSDATE               NOT NULL

)

DML for the Table

INSERT INTO GROUP_TYPE VALUES('Group_1', 100, 'This Group has been created for Group1 type users for future classifaction purposes', '2/28/2011 3:29:33 PM'

INSERT INTO GROUP_TYPE VALUES('Group_2', 100, 'This Group has been created for Group2 type users for future classifaction purposes', '2/28/2011 3:29:33 PM'

INSERT INTO GROUP_TYPE VALUES('Group_3', 100, 'This Group has been created for Group3 type users for future classifaction purposes', '2/28/2011 3:29:33 PM'

INSERT INTO GROUP_TYPE VALUES('Group_4', 100, 'This Group has been created for Grou4 type users for future classifaction purposes', '2/28/2011 3:29:33 PM'

Thanks.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2013
Added on Nov 18 2013
11 comments
3,314 views