Example: DELETE ALL Multistatement Request - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2024-12-13
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantage™

The DELETE ALL statement in the following BTEQ request invokes fastpath delete processing. The statements are combined into a multistatement request and are processed as an implicit transaction in Teradata session mode. Note that DELETE is the last statement in the request:

     SELECT *
     FROM DBC.log_on_off_v
     WHERE log_date = DATE
     AND   user_name = 'Administrator'
    ;SELECT log_time, user_name, event, account_name
     FROM DBC.log_on_off_v
     WHERE log_date = DATE
     AND   user_name NOT IN ('Administrator', 'SecAdmin', 'Oper')
    ;SELECT log_time, event, logical_host_id, pe_no
     FROM DBC.log_on_off_v
     WHERE log_date = DATE
     AND user_name = 'Oper'
    ;DELETE FROM DBC.log_on_off_v ALL ;

In ANSI session mode, the COMMIT statement must follow the DELETE request, so the last line of the preceding example would read:

     DELETE FROM DBC.log_on_off_v ALL ;
     COMMIT;