Reputation: 499
When I run a sql statement which supposed to return exact one row, sqlplus print column names many many times ? why ?
Upvotes: 5
Views: 9320
Reputation: 48131
Probably because your pagesize is much smaller than the number of lines necessary to display the data, due to wrapping. It repeats the heading on each "page" of output, even if it has not completed displaying a single row.
For the purpose of seeing/copy-pasting an entire output as a whole, try SET PAGESIZE 10000
(or some other large number).
For exploring the output in the console, you'd probably want to set it to your console window's height instead (you guessed it - the real "page size"). This way, you'll see exactly one set of headers, whichever place in the output you're in - which is exactly this statement's purpose.
A closely-related command is SET LINESIZE
- output width.
Upvotes: 12
Reputation: 993
Because of its configuration. You can set sqlplus behaviour via SET:
http://ss64.com/ora/syntax-sqlplus-set.html
Upvotes: 1