Hi All,
Today we will discuss about Teradata Data utility BTEQ
DEFINITION : BTEQ - Basic Teradata Query
- General-purpose, command-based program that allows users on a workstation to communicate with one or more Teradata Database systems.
- A set of SQL statements used to inserts updates or deletes in teradata tables.
- Imports data to teradata database from a file.
- Exports data from table and formats the results and returns them to the screen, a file, or to a designated printer.
- Do report the error occurs but will not capture it as log.
BTEQ Session:
- Logical connection between host and teradata database
- Multiple sessions are allowed to work tasks on in parallel
- In a bteq session, .show control command list out all the parameters set over that session. We can also set the parameters.
- Session for a script can be set using command,
- For e.g. .SET SESSION 4
Capabilities in BTEQ:
In a BTEQ session, we can access a Teradata Database easily and do the following:
- Enter Teradata SQL statements to view, add, modify, and delete data.
- Enter BTEQ commands.
- Enter operating system commands.
- Create and use Teradata stored procedures
- BTEQ supports Teradata-specific SQL functions for doing complex analytical querying and data mining
- All database requests in BTEQ are expressed in Teradata SQL.
- BTEQ also supports the conditional logic (i.e., "IF.THEN...") based on activity count or error code. It is useful for batch mode export / import processing.
From ….
.if activitycount > 0 then .goto continue
.quit
.label continue
- Error handling is applicable in BTEQ. We can assign error level for each error code and make decisions based on the level assigned.
- E.g., .set errorlevel 2168 severity 4
OPERATING MODES:
1) Interactive mode:
0 comments:
Post a Comment