1

I am giving a select statement in SQL*Plus. It is retreiving the data but the column name is displayed every time after certain number of rows. I want the column name to be displayed only once.

For example:

select emp_name from employee.

currently gets 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. How can I do that?

4

4 回答 4

4

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
于 2009-07-02T09:16:35.737 回答
3

除了 Colin 和 ik_zelf 所说的:

set pages 0

或者

set pagesize 0

Sqlplus 将抑制所有标题、分页符和标题

于 2009-07-02T09:32:34.597 回答
1

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
于 2009-07-02T09:11:23.813 回答
1

See http://download.oracle.com/docs/cd/B28359_01/server.111/b31189/ch12040.htm#SQPUG095

set pages 50000

Ronald

于 2009-07-02T09:13:16.057 回答