Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Pagination in SQL*Plus

tony.gOct 3 2013 — edited Oct 4 2013

Hi

I am trying to manage the pages sizes in my sql*plus report and having an issue, so I have created an emp and dept version to show my question.

I have a query, where I am breaking on a field, then want to skip to the next page using the break command.  I was expecting sqlplus to either use formfeed for the skip to next page (if I have set newpage 0) or to put CR/LF in for the appropriate number of lines depending on the size of the pagesize I have set (if I have newpage set to non 0).  I am finding the formfeed works OK, but I do not want to use this, I want to use the CR/LF  option (that I think exists!!).

My example code is this:

clear columns
clear breaks

set lines 80
set pages 100
set newpage none


column deptno format 00
break on deptno skip page

ttitle -
left   'Left ' -
center 'TEST TEST ' -
right  'Page ' format 999 sql.pno skip2


select deptno, empno
from emp
order by deptno, empno


spool $HOME/test.log
/
spool off

The issue I have is the the output looks like this:

Left                               TEST TEST                           Page    1

DEPTNO      EMPNO
------ ----------
    10       7782
             7839
             7934
Left                               TEST TEST                           Page    2

DEPTNO      EMPNO
------ ----------
    20       7369
             7566
             7788
             7876
             7902
Left                               TEST TEST                           Page    3

DEPTNO      EMPNO
------ ----------
    30       7499
             7521
             7654
             7698
             7844
             7900

14 rows selected.

As I have pagesize set to 100, I would have expected that there should be 100 lines between each Left in the ttile, but you can see that this is not true.

Can anyone please tell me why this isn't the case?

Many thanks

Tony

This post has been answered by Frank Kulash on Oct 3 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 1 2013
Added on Oct 3 2013
10 comments
1,584 views