列标题始终出现在整个Oracle输出中 [英] Column headings keep appearing throughout Oracle output
问题描述
每10行之后,我的列标题重新出现在Oracle输出中.我的代码中是否有某些内容,或者可以设置一些环境变量来阻止这种情况?我只需要将列标题显示在结果顶部一次即可.
After ever 10 lines, my column headers reappear in my Oracle output. Is there something about my code or some kind of environment variable I can set to stop this? I only need the column headers to appear once at the top of my results.
BREAK ON Customer
COLUMN Customer -
FORMAT A15 -
HEADING 'Customer Name'
COLUMN "Charter Date" -
HEADING 'Charter|Date'
COLUMN Pilot -
FORMAT A20 -
HEADING 'Pilot'
SELECT DECODE (cu.cus_initial,null, cu.cus_fname||' '||cu.cus_lname,
cu.cus_fname||' '||cu.cus_initial||'. '||cu.cus_lname)
AS Customer,
ch.char_date "Charter Date",
TRIM( e.emp_fname) ||' '|| TRIM(e.emp_lname) AS "Pilot"
FROM hartmar.customer cu,
hartmar.charter ch,
hartmar.crew cr,
hartmar.pilot p,
hartmar.employee e
WHERE cu.cus_code = ch.cus_code
AND ch.char_trip = cr.char_trip
AND cr.emp_num = p.emp_num
AND p.emp_num = e.emp_num
AND cr.crew_type = 'Pilot'
ORDER BY cu.cus_lname, cu.cus_fname, cu.cus_initial, ch.char_date
;
CLEAR BREAKS
CLEAR COLUMNS
推荐答案
假设您正在SQL * Plus中运行此程序,则需要设置页面大小.
Assuming you're running this in SQL*Plus, you need to set your pagesize.
SET PAGESIZE 50000
会使列标题在返回的每50,000行中仅出现一次.我相信50,000个是PAGESIZE的最大设置.
will cause the columns headings to appear only once for every 50,000 rows returned. I believe 50,000 is the maximum PAGESIZE setting.
如果要完全消除标头,可以将PAGESIZE
设置为0,但这甚至可以抑制第一组标头
If you want to eliminate headers entirely, you can set the PAGESIZE
to 0 but that will suppress even the first set of headers
SQL> set pagesize 0;
SQL> select ename, empno from emp;
PAV 7623
smith 7369
ALLEN 7499
WARD 7521
JONES 7566
MARTIN 7654
BLAKE 7698
CLARK 7782
SCOTT 7788
KING 7839
TURNER 7844
ADAMS 7876
SM0 7900
FORD 7902
MILLER 7934
BAR 1234
16 rows selected.
这篇关于列标题始终出现在整个Oracle输出中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!