BTEQ Commands to Use - Basic Teradata Query

Basic Teradata Query Reference

Product
Basic Teradata Query
Release Number
15.00
Language
English (United States)
Last Update
2018-09-25
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities

BTEQ Commands to Use

HEADING - creates a report heading

Command format:

   .SET HEADING 'heading specifier'

RTITLE (report title) - creates a report heading

Command format:

   .SET RTITLE 'heading specifier'

Note: The two commands are variations of the same command. The RTITLE command is easier to use because it automatically includes the report date and page numbers.

FOOTING - creates a page footer

Command format:

   .SET FOOTING 'footing specifier'

The specifier has the following format for both headers and footers:

   'a||b||c//d||e||f//g||h||i' 

where:

  • a is the left-justified entry on line 1.
  • b is the centered entry on line 1.
  • c is the right-justified entry on line 1.
  • d is the left-justified entry on line 2.
  • e is the centered entry on line 2.
  • f is the right-justified entry on line 2.
  • g is the left-justified entry on line 3.
  • h is the centered entry on line 3.
  • i is the right-justified entry on line 3.
  • and:

  • || separates the three parts of a line.
  • // separates the lines.
  • To break a header line and begin a new line of header text, insert a pair of slashes (//) at the required break point. Up to nine break points can be entered for a maximum of 10 header lines within a HEADING or FOOTING command.

    Specify only the entries needed, with the appropriate separator characters. If the left‑middle‑right entries are not specified, BTEQ centers the text. If the first‑second‑third lines are not specified, BTEQ puts the text on the first line.

    If more than two pair of line separator characters are specified, indicating more than three lines, the following occurs:

     

    System Type

    Results

    Mainframe-attached system

    BTEQ returns an error message and treats the additional separators as header or footer text.

    Workstation-attached system

    BTEQ truncates the additional separators from the header or footer text.

    Example  

    In a mainframe-attached system, using the following FOOTING command and SELECT statement:

       .footing '&DATE||Confid||dential||Page&PAGE
       select * from department;

    The above example produces the following error message and report:

       .footing '&DATE||Confid||dential||Page&PAGE
       
       *** Warning: Maximum of 2 '||' separators is allowed,
       others ignored. 
       
       *** Query completed. 5 rows found. 4 columns returned. 
       90/08/10     select * from department;   Page 1
       
        DeptNo  DeptName        Loc  MgrNo
        ------  --------------  ---  -----
           500  Engineering     ATL  10012
           700  Marketing       NYC  10021 
           300  Exec Office     NYC  10018
           600  Manufacturing   CHI  10007
           100  Administration  NYC  10011
       

    Refer to “HEADING” on page 189, “RTITLE” on page 283, and “FOOTING” on page 176 for additional information and examples of specifying report headers and footers.