All Forums Database
philipalex 3 posts Joined 09/13
20 Sep 2013
Please help me on BT/ET and ROLLBACK/ABORT

HI all,
 
I am a new bee in TD and I am facing an issue. The details are given below.
 
I am trying the below query, here I am trying to INSERT rows into a table and ROLLBACK...
 
BT;INSERT INTO TABLEA SELECT COL1,COL2,COL3 from TABLEB; ET;ROLLBACK;
 
while executing the above query I am getting the below error. Please help me on this.......
 
TRANSACTION Command Complete
 
 
315 rows processed.
INSERT Command Complete

 
ERROR [HY008] [Teradata][ODBC Teradata Driver][Teradata Database] User-generated transaction ABORT.
ROLLBACK Command Failed.

 
 

Tags:
dnoeth 4628 posts Joined 11/04
20 Sep 2013

 
You should commit a transaction only when you're shure you don't need a rollback :-)
There's an ET before the ROLLBACK.
 
Dieter

Dieter

ulrich 816 posts Joined 09/09
20 Sep 2013

Hm,
what you do is
1. Begin a transaction
2. Ins/select - at the end of the Ins/Select the transaction is still open.
3. End the transaction (Insert / Select is commited)
4. Rollback - What do you expect to be rolled back after the ET?
 
Rollback is mainly used within a transaction with some conditional logic.
So whats your intention?
 

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

philipalex 3 posts Joined 09/13
21 Sep 2013

Thank you for reply's...
 
Yes, I forget to add the condition, I am inserting the data into TABLEA using my control table status. If I am using an conditional statement could you please provide the syntax for rollbacking the transaction..

You must sign in to leave a comment.