views:

423

answers:

4


Hi All, I am giving a select statement in sqlplus,It is retreving the data but the column name is displayed every time after certain number of rows.I want column name to be displayed only once.For example- select emp_name from employee. output:

emp_name

========

raman
sunil
rajesh
dilip

emp_name

========

rahul

pramod

ankita

I want output like this:

emp_name

========

pankaj
ruchi
amar
rakesh
dilip
raju
rahul

all under single column heading,Pls. guide me out. Waiting for ur early rersponse!!!

+1  A: 

Try outputting the result of your query to a file, e.g.:

SQL>SPOOL /tmp/mydata.dat   
SQL>select emp_name from employees;
SQL>SPOOL OFF
karim79
+1  A: 
ik_zelf
+2  A: 

You get this effect because the page size is less than the number of rows returned. The default is 14. If you set it to a value greater than the number of rows, no additional headers will be inserted. You can set the pagesize during a sql*plus session with this command:

set pagesize n

where n is then number of rows. So to set it to 200:

set pagesize 200
Colin Pickard
ik_zelf's answer is essentially the same; pages is an abbreviation for pagesize.
Colin Pickard
+2  A: 

In addition to what Colin and ik_zelf said:

set pages 0

or

set pagesize 0

Sqlplus will suppress all headings, page breaks and titles

beggs