Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SQL *Plus

Status
Not open for further replies.

akaivyleaf

Programmer
Nov 1, 2000
42
US
How do I get my column Headings from a select statement to show?

We just loaded SQL *PLus on our machines, and everything works well but we cannot display our column headings.

A sample statement is as follows but something seems to be wrong in an the configuration of SQL *Plus.

SELECT cost "COST", description "DESCRIPTION"
FROM course;
 
Try it without the quotes.
There is also a col command that
you can issue before the select, if
you want to format the output.

Jim

oracle, vb, some javascript
 
The command SET HEAD ON in SQL*Plus will switch on the headings.

The col command can be used to give a column a heading for the session. e.g.

col item_Desc for a30 trunc head "Description" - This formats the column to 30 chars truncated with a heading of Description
 
I tried both of the methods mentioned, and still no column headings. Any other suggestions?
 
In case anyone is reading this. I found out the solution. I don't know if this is normal or not but, I did COL HEAD ON and still didn't see the headings. I finally logged off and logged into another session and the column headings appeared.

I was under the impression that if you logged out, the settings went back to the default but apparently I was mistaken.

Glad to know it's now working for me.
 
Folks,
If you use 'set head off' in SQL*Plus or 'set pages 0'( that is a zero), both will eliminate headings. Also, make sure your local login.sql doesn't have these commands in there. (or glogin.sql)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top