Total Pageviews

Wednesday 24 July 2013

Basic BTEQ commands

BTEQ Commands (Below are the BTEQ commands and their purpose)
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: Abort any and all active running requests and transactions for a session, but do not exit BTEQ.

DEFAULTS: Reset all BTEQ Format command options to their defaults. This will utilize the default configurations.

EXIT: Immediately end the current session or sessions and exit BTEQ.

HALT EXECUTION: Abort any and all active running requests and transactions and EXIT BTEQ.

LOGOFF: End the current session or sessions, but do not exit BTEQ.

LOGON: Starts a BTEQ Session. Every user, application, or utility must LOGON to Teradata to establish a session.

QUIT: End the current session or sessions and exit BTEQ.

SECURITY: Specifies the security level of messages between a network-attached system and the Teradata Database.

SESSIONS: Specifies the number of sessions to use with the next LOGON command.

SESSION CHARSET: Specifies the name of a character set for the current session or sessions.

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 are determined by Teradata SQL or ANSI SQL semantics.

SHOW CONTROLS: Displays all of the BTEQ control command options currently configured.

SHOW VERSIONS: Displays the BTEQ software release versions.

TDP: Used to specify the correct Teradata server for logons for a particular session.



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: Execute a VM CMS command inside the BTEQ environment.

ERROROUT: Write error messages to a specific output file.

EXPORT: Open a file with a specific format to transfer information directly from the Teradata database.

HALT EXECUTION: Abort any and all active running requests and transactions and EXIT BTEQ.

FORMAT: Enable/inhibit the page-oriented format command options.

IMPORT: Open a file with a specific format to import information into Teradata.

INDICDATA: One of multiple data mode options for data selected from Teradata. The modes are INDICDATA, FIELD, or RECORD MODE.

OS: Execute an MS-DOS, PC-DOS, or UNIX command from inside BTEQ.

QUIET: Limit BTEQ output displays to all error messages and request processing statistics.

RECORDMODE: One of multiple data mode options for data selected from Teradata. (INDICDATA, FIELD, or RECORD).

REPEAT: Submit the next request a certain amount of times.

RUN: Execute Teradata SQL requests and BTEQ commands directly from a specified run file.

TSO: Execute an MVS TSO command from inside the BTEQ environment.




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: End the current session or sessions and exit BTEQ.
GOTO: Skip all intervening commands and resume after branching forward to the specified label.
HANG: Pause BTEQ processing for a specific amount of time.
IF…THEN: Test a stated condition, and then resume processing based on the test results.
LABEL: The GOTO command will always GO directly TO a particular line of code based on a label.
MAXERROR: Specifies a maximum allowable error severity level.
QUIT: End the current session or sessions and exit BTEQ.
REMARK: Place a comment on the standard output stream.
REPEAT: Submit the next request a certain amount of times.