You are on page 1of 5

BTEQ Commands

The BTEQ commands in Teradata are designed for flexibility. These commands are not used directly on the data inside the tables. However, these 60 different BTEQ commands are utilized in four areas.

Session Control Commands File Control Commands Sequence Control Commands Format Control Commands

Session Control Commands


ABORT DEFAULTS Abort any and all active running requests and transactions, but do not exit BTEQ. Reset all BTEQ Format command options to theirdefaults. This will utilize the default configurations. Immediately end the current session or sessions and exit BTEQ. Abort any and all active running requests and transactions and EXIT BTEQ. End the current session or sessions, but do not exit BTEQ. Starts a BTEQ Session. Every user, application, or utility must LOGON to Teradata to establish a session. End the current session or sessions and exitBTEQ. Specifies the security level of messages between a network-attached system and the Teradata Database. Specifies the number of sessions to use with thenext LOGON command. Specifies the name of a character set for thecurrent session or sessions.

EXIT HALT EXECUTION LOGOFF LOGON

QUIT SECURITY

SESSIONS SESSION CHARSET

SESSION SQLFLAG Specifies a disposition of warnings issued in response to violations of ANSI syntax. The SQL will still run, but a warning message will be provided. The four settings are FULL, INTERMEDIATE, ENTRY, and NONE. SESSION TRANSACTION Specifies whether transaction boundaries aredetermined by Teradata SQL or ANSI SQL semantics.

SHOW CONTROLS Displays all of the BTEQ control command options currently configured. SHOW VERSIONS TDP Displays the BTEQ software release versions. Used to specify the correct Teradata server for logons for a particular session.

Figure 2-11

File Control Commands


These BTEQ commands are used to specify the formatting parameters of incoming and outgoing information. This includes identifying sources and determining I/O streams. CMS ERROROUT EXPORT HALT EXECUTION FORMAT IMPORT INDICDATA Execute a VM CMS command inside the BTEQ environment. Write error messages to a specific output file. Open a file with a specific format to transfer information directly from the Teradata database. Abort any and all active running requests and transactions and EXIT BTEQ. Enable/inhibit the page-oriented format command options. Open a file with a specific format to importinformation into Teradata. One of multiple data mode options for data selected from Teradata. The modes are INDICDATA, FIELD, orRECORD MODE. Execute an MS-DOS, PC-DOS,

OS

or UNIX commandfrom inside BTEQ. QUIET REPEAT RUN TSO Limit BTEQ output displays to all error messages and request processing statistics. Submit the next request a certain amount of times Execute Teradata SQL requests and BTEQ commands directly from a specified run file. Execute an MVS TSO command from inside the BTEQ environment.

Figure 2-12

Sequence Control Commands


These commands control the sequence in which Teradata commands operate. ABORT Abort any active transactions and requests.

ERRORLEVEL Assign severity levels to particular error numbers. EXIT GOTO HANG IFTHEN LABEL MAXERROR QUIT REMARK REPEAT Figure 2-13 End the current session or sessions and exit BTEQ. Skip all intervening commands and resume afterbranching forward to the specified label. Pause BTEQ processing for a specific amount of time. Test a stated condition, and then resume processing based on the test results. The GOTO command will always GO directly TO aparticular line of code based on a label. Specifies a maximum allowable error severity level. End the current session or sessions and exit BTEQ. Place a comment on the standard output stream. Submit the next request a certain amount of times.

Format Control Commands

These commands control the formatting for Teradata and present the data in a report mode to the screen or printer. DEFAULTS ECHOREQ Reset all BTEQ Format command options to their defaults. This will utilize the default configurations. Enable the Echo required function in BTEQ returning a copy of each Teradata SQL request and BTEQ command to the standard output stream. Open a file with a specific format to transfer information directly from the Teradata database. Split or fold each line of a report into multiple lines. Specify a footer to appear at the bottom of every report page. Enable/inhibit the page-oriented format command options. Open a file with a specific format to transfer orIMPORT information directly to Teradata. One of multiple data mode options for data selected from Teradata. The modes areINDICDATA, FIELD, or RECORD MODE. Specifies a character or string of characters torepresent null values returned from Teradata. Omit specific columns from a report. Ejects a page whenever a specified column changes values. Specifies the page length of printed reports based on lines per page. Limit BTEQ output displays to all error messages and request processing statistics. One of multiple data mode options for data selected from Teradata. (INDICDATA, FIELD, orRECORD). Cancel a request when the specified value of the RETLIMIT command option is exceeded.

EXPORT FOLDLINE FOOTING FORMAT IMPORT

INDICDATA

NULL OMIT PAGEBREAK PAGELENGTH QUIET RECORDMODE RETCANCEL

RETLIMIT

Specifies the maximum number of rows to bedisplayed or written from a Teradata SQL request. Retry requests that fail under specific error conditions. Specify a header appearing at the top of all pages of a report. Specifies a character string or specific width of blank characters separating columns of a report.

RETRY RTITLE SEPARATOR

SHOWCONTROLS Displays all of the BTEQ control command optionscurrently configured. SIDETITLES SKIPLINE SUPPRESS TITLEDASHES UNDERLINE WIDTH Place titles to the left or side of the report instead of on top. Inserts blank lines in a report when the value of a column changes specified values. Replace each and every consecutively repeated value with completely-blank character strings. Display dash characters before each report linesummarized by a WITH clause. Display a row of dash characters when the specified column changes values. Specifies the width of screen displays and printed reports, based on characters per line.

You might also like