Aborting Requests with the ABORT Command - 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

Aborting Requests with the ABORT Command

Use the ABORT command to stop a request to the Teradata Database, and restore any changes that were caused by the request.

When issuing the ABORT command, the Teradata Database:

1 Stops processing the request.

2 Discards all of the responses that it has prepared for the request.

3 Backs out all changes that the request made to the database.

4 Aborts the transaction in which the request was embedded.

5 Returns a failure message, indicating that the request was aborted.

Timing the ABORT Request

To successfully abort a Teradata SQL request, the abort request must reach the Teradata Database before it returns a response to the original request. If the abort request arrives too late, the Teradata Database does not process it.Neither the original request nor its transaction is affected.

Restoring a Teradata Database After a Failed ABORT Request

If the request did not affect the database, or if the affect was not damaging, then the impact of a failed abort request is minimal. If the request damaged the database, then correct the damage using one of the following options:

  • If the request was embedded in a transaction, abort the transaction by submitting a Teradata SQL ABORT statement as a normal Teradata SQL request, which backs out the effect of the damaging request.
  • If the request was not embedded in a transaction, submit a second request that has the opposite effect of the first, thus returning the database to its state before the damaging request.
  • Aborting a File Redirection

    When redirecting a standard input stream file, abort or interrupt processing on a client system using one of the following options:

  • On workstation-attached systems, use the Break key on the workstation keyboard, as described in “Discarding Input and Aborting Requests” on page 83.
  • For UNIX and Windows systems, in response to the double-break function, BTEQ aborts the current Teradata SQL statement and continues reading the rest of the file. The triple-break function aborts the current statement and exits BTEQ.
  • Note: On workstation-attached systems, do not use the single-break function to abort a file redirection operation. Pressing the Break key while a Teradata SQL statement that extends over two lines is executing, causes BTEQ to send the second line of the statement to the Teradata Database and display an error message. When using the single-break function, it must be followed with an ABORT command.