You should set the pagesize
to a non-zero number that way your headers will be displayed. The number you set it to may depend on the number of rows that you have. If you set it 100 as per the following line:
set pagesize 100
then 100 rows will be printed under the headers, then the column headers will be repeated for the next 100 rows. The maximum as mentioned in 50000. Also set heading
to on as
set heading on
otherwise it will not display the headers, despite the pagesize being non-zero. Also remember when you are selecting columns in that way they will not be padded, so the headings might appear out of place.