列标题在整个 Oracle 输出中不断出现
每 10 行之后,我的列标题就会重新出现在 Oracle 输出中。我的代码或某种环境变量是否可以设置来阻止这种情况?我只需要列标题在结果顶部出现一次。
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
假设您在 SQL*Plus 中运行它,您需要设置页面大小。
将导致每返回 50,000 行,列标题仅出现一次。我相信 50,000 是最大 PAGESIZE 设置。
如果您想完全消除标头,可以将 PAGESIZE 设置为 0,但这甚至会抑制第一组标头
Assuming you're running this in SQL*Plus, you need to set your 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.
If you want to eliminate headers entirely, you can set the
PAGESIZE
to 0 but that will suppress even the first set of headers使用“隐藏”功能将抑制除第一行标题之外的所有标题!
感谢“Bruno Ruess”,来自 https://community.oracle.com/ thread/2389479?start=0&tstart=0 对于上述内容。
如果您还添加了“Then
”,您可以抑制标题行的“下划线”,并获得看起来更像 CSV 的内容。
Use a 'hidden' feature that will suppress all EXCEPT the first row of headings!
Thanks to "Bruno Ruess" via https://community.oracle.com/thread/2389479?start=0&tstart=0 for the above.
If you then also add
Then you can supress the "underlining" of the header row, and get to something that looks a lot more like a CSV.
您还可以:
在报告开始后停止所有列标题。
You can also:
To stop all column headers after the start of your report.