0

I want to understand why my columns are missing their headers.

Consider this table:

SQL> DESC customer;
Name Null? Type 
------------ -------- ------------ 
CUST_ID NOT NULL NUMBER(5) 
CUST_NAME VARCHAR2(15) 
ACCOUNT_ID VARCHAR2(10) 
ACCOUNT_TYPE VARCHAR2(2) 
STATE VARCHAR2(2) 

When I select * from the table, the result is missing the column headers.

SQL> SELECT * FROM customer;
 90001 B and B A-11101 PR AK
 90002 XYZ A-11102 CM NJ
 90003 JJ Sons A-11103 CM NJ
 90004 Exxon A-11104 PR NY
 90005 ABC A-11105 CM NY
 90006 Smith Co. A-11106 CM MD
 90007 Brown Co. A-11107 CM MD
 90008 Cooper Inc. A-11108 PR MD
8 rows selected. 

Why?

My goal is to display the tables with the headers. If there are other details I need to add, let me know.

asked Jun 5, 2016 at 19:52

1 Answer 1

2

Heading may be disabled in your environment. Enable it (it is enabled by default).

SQL> select banner from v$version;
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production
CORE 12.1.0.2.0 Production
TNS for Linux: Version 12.1.0.2.0 - Production
NLSRTL Version 12.1.0.2.0 - Production
SQL> show heading
heading OFF
SQL> set heading on
SQL> select banner from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production
CORE 12.1.0.2.0 Production
TNS for Linux: Version 12.1.0.2.0 - Production
NLSRTL Version 12.1.0.2.0 - Production

Or pagesize is set 0:

SQL> show heading pagesize
heading ON
pagesize 14
SQL> set pagesize 0
SQL> select banner from v$version;
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production
CORE 12.1.0.2.0 Production
TNS for Linux: Version 12.1.0.2.0 - Production
NLSRTL Version 12.1.0.2.0 - Production
SQL> set pagesize 14
SQL> select banner from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production
CORE 12.1.0.2.0 Production
TNS for Linux: Version 12.1.0.2.0 - Production
NLSRTL Version 12.1.0.2.0 - Production
answered Jun 5, 2016 at 20:00
3
  • I just used show heading and it reports that heading ON Commented Jun 5, 2016 at 20:04
  • 1
    @NonCreature0714 Try pagesize next. Commented Jun 5, 2016 at 20:08
  • That was it, my pagesize was set to 0 Commented Jun 5, 2016 at 20:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.