Using Scripts, Run Files, Macros, and Stored Procedures - 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

Using Scripts, Run Files, Macros, and Stored Procedures

Depending on where they are stored and how they are executed, files that contain a user’s BTEQ commands and Teradata SQL statements are called scripts, run files, macros, or stored procedures:

 

File Type

Description

Usage

Script, or input stream file

A disk file contained within the SYSIN file on a Mainframe-attached system.

A set of commands and requests that produces a standard report or display, and that has been thoroughly tested.

Run file

A disk file that is not contained within the SYSIN file.

A set of commands and requests that can be used repeatedly. For example, to produce the same report or display on a daily or weekly basis.

Stored procedure

A file that is created, compiled and stored on theTeradata Database (either externally or internally), and is executed in response to a Teradata SQL CALL statement.

A number of users who need to perform the same operations on a regular basis.

Macro

A file that is created and stored on a Teradata Database, and is executed in response to a Teradata SQL EXECUTE statement.

A number of users who need to produce the same report or display on a regular basis.

Use a text editor to create and maintain BTEQ scripts, stored procedure source text, and run files. Use the Teradata SQL CREATE MACRO and ECHO statements to create BTEQ macros.

Note: The ECHO statement is not compatible with the COMPILE command.

Use the COMPILE command in BTEQ to create internally stored procedures (also known as SQL stored procedures) in the Teradata Database.