기본 SQL * Plus 보고서를 작성하는 방법을 배우고 있습니다.기본 SQL * Plus 보고서 : 의도대로 명령이 작동하지 않음
실습 중 BREAK ON 명령에 문제가있어서 어떻게 진행해야할지 확신이 없습니다.
참고로, 사용되는 테이블을 "신문"이라고하며 신문에 지형지 물의 이름, 지형지 물이있는 섹션 및 지형지 물이있는 페이지가 포함되어 있습니다.
rem Newspaper Report
ttitle 'Newspaper Features by Section'
btitle 'Hot off the Presses'
column feature format a15 word_wrapped
column section format a7
column page format 99
column feature heading 'Feature'
column section heading 'Section'
column page heading 'Page'
break on section skip 1
set linesize 80
set pagesize 40
set newpage 0
set feedback off
spool test.sql
select section, feature, page from newspaper
order by section;
spool off
가 출력 : 그것은 도달 할 때마다이 예에서
Section Feature Page
------- --------------- ----
A National News 1
Editorials 12
B Bridge 2
Movies 4
Modern Life 1
Television 7
C Comics 4
Weather 2
D Sports 1
E Business 1
F Obituaries 6
Classified 8
Doctor Is In 6
Births 7
이, SQL은 * 플러스 한 줄을 건너
다음과 같은 보고서를 실행, SQL * Plus는 예상대로 결과를 반환 새로운 기능. 이것이 어떻게 작동 할 것으로 기대됩니다. 나는 다음과 같은 보고서를 실행할 때
그러나, 나의 결과는 방법을 포맷하지 않는 그들은해야합니다 :
rem Newspaper Report
ttitle 'Newspaper Features by Page'
btitle 'Hot off the Presses'
column feature format a15 word_wrapped
column section format a7
column page format 99
column feature heading 'Feature'
column section heading 'Section'
column page heading 'Page'
break on page skip 1
set linesize 80
set pagesize 40
set newpage 0
set feedback off
spool test.sql
select page, feature, section from newspaper
order by page;
spool off
출력 :
Page Feature Section
---- --------------- -------
1 Modern Life B
Sports D
National News A
Business E
2 Weather C
Bridge B
4 Movies B
Comics C
6 Doctor Is In F
Obituaries F
7 Television B
Births F
8 Classified F
12 Editorials A
없음 라인이 페이지가 변경되면 생략되지 않았다 . 내가 잘못한 일을하고 있거나 명령이 이런 식으로 제한되어 있습니까?
그 트릭을! –