PAGELENGTH Command | Basic Teradata Query - PAGELENGTH - Basic Teradata Query

Basic Teradata® Query Reference

Product
Basic Teradata Query
Release Number
17.00
Published
December 2020
Language
English (United States)
Last Update
2020-12-12
dita:mapPath
zqt1544831938740.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities

Purpose

This control enables users to specify the maximum number of lines for report form output.

Syntax



where the following is true:

n
Specifies the maximum number of lines on a page.

The value is 55 by default.

The valid range is 1 to 2147483647 (for Workstation).

The valid range is 1 to 2147483407 (for Mainframe).

Usage Notes

Use the PAGELENGTH command to customize page length for different reports or forms.

Use an asterisk (*) to represent a single page with unlimited number of lines. Each query will produce one page with a length equal to the number of lines needed to print that query's entire result set and possibly a header, footer, column titles, and titledashes.

The FORMAT setting must be ON for the PAGELENGTH setting to have any effect on formatting report form output.

The PAGELENGTH command can be used in an SQL macro.

Example 1 – PAGELENGTH

The following example shows the results of using the PAGELENGTH command to set the maximum page length at 67 lines and at 30 lines for the same select operation:

database workforce;   
.set defaults    
.set format on   
.heading "Pagelength 67"    
.footing "Bottom of Page”   
.set pagelength 67   
select   deptname       
,deptno        
,loc     from     department   
order by deptname    
;   
.defaults  
.format on  
.heading "Pagelength 30"  
.footing "Bottom of Page”    
.pagelength 30    
= 1    
.format off   
.logoff   
.exit

BTEQ Response

In response to the first select operation BTEQ formats the results, prints the footer at line 67, and ejects the page:

*** Query completed. 5 rows found. 3 columns returned.
                          Pagelength 67
DeptName         DeptNo   Loc
--------------   ------   ---
Administration      100   NYC
Engineering         500   ATL
Exec Office         300   NYC
Manufacturing       600   CHI
Marketing           700   NYC
.
.
(BTEQ counts to line 67)
.
.
                          Bottom of Page

In response to the second select operation BTEQ formats the results, prints the footer at line 30, and ejects the page as follows:

*** Query completed. 5 rows found. 3 columns returned.
                           Pagelength 30
DeptName          DeptNo   Loc
--------------    ------   ---
Administration       100   NYC
Engineering          500   ATL
Exec Office          300   NYC
Manufacturing        600   CHI
Marketing            700   NYC
.
.
(BTEQ counts to line 30)
.
.
                           Bottom of Page

Example 2 – PAGELENGTH Instigated By a Macro

The PAGELENGTH commands in an SQL macro appear as follows:

ECHO '.PAGELENGTH 67';

or as:

ECHO '.PAGELENGTH 30';