user2018791
user2018791

Reputation: 1153

what is a page of sqlplus report

We can control how many rows can be displayed in a page using set pagesize. But I can not find the definition of a page. I mean I don't know a page begins with which line and ends with which line.

For example:

SQL> sho pages
pagesize 14
SQL> select empno,ename from emp;

     EMPNO ENAME
 ---------- ----------
     7369 SMITH
     7499 ALLEN
     7521 WARD
     7566 JONES
     7654 MARTIN
     7698 BLAKE
     7782 CLARK
     7788 SCOTT
     7839 KING
     7844 TURNER
     7876 ADAMS

     EMPNO ENAME
---------- ----------
     7900 JAMES
     7902 FORD
     7934 MILLER

14 rows selected.    

Does the a page begin with the first blank line ?

Upvotes: 0

Views: 46

Answers (1)

Alex Poole
Alex Poole

Reputation: 191245

By default the page begin with a blank line. That is controlled by the newpage setting:

SET NEWP[AGE] {1 | n | NONE}

Sets the number of blank lines to be printed from the top of each page to the top title. A value of zero places a formfeed at the beginning of each page (including the first page) and clears the screen on most terminals. If you set NEWPAGE to NONE, SQL*Plus does not print a blank line or formfeed between the report pages.

If you change that from its default value of 1 you'll see the number of blank lines change. If you set it zero then if your terminal supports it you'll see each page of output separately (more obvious with pause on), and if you spool the output you'll also see a formfeed character (^L) in the output file.

You can also see that the blank line is at the start (rather than the end) of the page with pause, which "pauses output at the beginning of each PAGESIZE number of lines":

SQL > set pause "-- start of page --"
SQL > set pause on
SQL > set newpage 2
SQL > select object_name from all_objects where object_name like 'ALL%';
-- start of page --

The terminal pauses without displaying any output. If you hit return you see the whole first page, including the leading two blank lines (repeating the command and first pause for context):

SQL > select object_name from all_objects where object_name like 'ALL%';
-- start of page --


OBJECT_NAME
------------------------------
ALL_XML_SCHEMAS
ALL_XML_SCHEMAS2
ALL_CONS_COLUMNS
ALL_CONS_COLUMNS
ALL_LOG_GROUP_COLUMNS
ALL_LOG_GROUP_COLUMNS
ALL_LOBS
ALL_LOBS
ALL_CATALOG
ALL_CATALOG
ALL_CLUSTERS
ALL_CLUSTERS
ALL_COL_COMMENTS
ALL_COL_COMMENTS
ALL_COL_PRIVS
ALL_COL_PRIVS
ALL_COL_PRIVS_MADE
ALL_COL_PRIVS_MADE
ALL_COL_PRIVS_RECD
-- start of page --

It's now pausing before displaying the second page of results, and has not shown the two blank lines from that second page.

Read more about page dimensions.

Upvotes: 3

Related Questions