UNDERLINE Command | Basic Teradata Query - UNDERLINE - 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 whether one line of dash characters, which spans all report columns, is to be printed whenever the value of the indicated column changes.

Syntax



where the following is true:

n
The column numbers, ordered from left to right, and separated by a comma or one space.

The value of n can range from 1 to 2048.

Usage Notes

Use the UNDERLINE command to improve report appearance by separating the data into logical sections. When the value of a specified column changes, BTEQ inserts a dashed line across the width of the report, not just across the width of the column specified.

If specifying more than one column, BTEQ inserts a dashed line when the value of any of the specified columns changes, or if the value of more than one column changes at the same time.

The initial configuration of the UNDERLINE command options are OFF and ALL. If ON or OFF is not specified, or column numbers are not included, BTEQ sets UNDERLINE to ON ALL.

On workstation-attached systems, the terminal is not treated as an intelligent terminal, so the underline is implemented by drawing a line on the next line below the line of text.

The UNDERLINE setting only affects the output for Field Mode, not Record Mode, Indicator Mode, or Multipart Indicator Mode.

The UNDERLINE command can be used in an SQL macro.

Example 1 – UNDERLINE

The following example returns the selected information first with the UNDERLINE command option set to OFF, then set to ON for all columns:

database workforce;
.defaults    
.format on   
.heading 'Underline Off'
select   Proj_id 
,description 
,comdate     from     project 
order by proj_id 
;   
.defaults   
.format on    
.heading 'Underline - Default'
.underline 
= 1    
.defaults 
.format off 
.logoff   
.exit

BTEQ Response

*** Query completed. 24 rows found. 3 columns returned
                           Underline Off
   
Project                                    Compl
Id        Project Description               Date
--------  -------------------------     --------
AP1-0001  A/P Payable DB Design         83/04/10
AP1-0002  A/P Payable Online System     83/04/21
AP1-0003  A/P Payable Batch System      83/04/21
AP2-0001  A/P Payable DB Design         83/04/10
AP2-0002  A/P Payable Online System     83/04/10
AP2-0003  A/P Payable Batch System      83/04/10
AR1-0001  A/R RECV database Design      83/04/21
AR1-0002  A/R RECV Online System        83/04/10
   .
   .
 (etc)
*** Query completed. 24 rows found. 3 columns returned.
   
Underline - Default
Project                                 Compl
Id        Project Description            Date
--------  -------------------------  --------
AP1-0001  A/P Payable DB Design      83/04/10
---------------------------------------------
AP1-0002  A/P Payable Online System  83/04/21
---------------------------------------------
AP1-0003  A/P Payable Batch System   83/04/21
---------------------------------------------
AP2-0001  A/P Payable DB Design      83/04/10
---------------------------------------------
AP2-0002  A/P Payable Online System  83/04/10
--------------------------------------------
AP2-0003  A/P Payable Batch System   83/04/10
---------------------------------------------
AR1-0001  A/R RECV database Design   83/04/21
---------------------------------------------
AR1-0002  A/R RECV Online System     83/04/10
   .
   .
   .
 (etc)

Example 2 – UNDERLINE

To insert a dashed line across the page whenever columns 3 and 7 change value, type the following:

.SET UNDERLINE ON 3,7

Example 3 – UNDERLINE Instigated By a Macro

The Example 2 UNDERLINE command in an SQL macro appears as follows:

ECHO '.SET UNDERLINE ON 3,7';