@lew
To capture the output of DML (Data Manipulation Language) statements in Teradata, such as INSERT, UPDATE, DELETE, or MERGE, you can use the BTEQ (Basic Teradata Query) utility. Here's how you can do it:
1 2 |
INSERT INTO database.table_name VALUES (1, 'John', 'Doe'); |
1 2 3 4 5 6 7 8 9 10 11 12 |
.LOGON <Teradata server>/<username>,<password>; .SET RETLIMIT <max_number_of_rows>; .SET ERRORLEVEL 3807 SEVERITY 0; .SET ERRORLEVEL 0 SEVERITY 5; .LOGTABLE sysadm.my_log_table; .RUN file=insert_data.txt; .LOGOFF; .QUIT; |
1
|
bteq < insert_script.btq > output.txt |
This will execute the DML statement in insert_data.txt and capture the output in output.txt. The output will include any error messages or success/failure status of the DML statement.
Note: Make sure to replace <Teradata server>
, <username>
, <password>
, <max_number_of_rows>
with your actual Teradata server connection information and settings.