|
|
Archives of the TeradataForum
Message Posted: Tue, 30 Nov 2004 @ 17:18:46 GMT
Subj: | | Handling errors within BTEQ |
|
From: | | jose lopez ruiz |
Hello:
This is my first question in this forum.
If I have some "updates", "inserts",.... in one bteq, and I want to verify if each operation is ok, How can I do this? I don't want to have a
label error for each operation. Could I use variables to indicate which is the error and then goto a unique label error?
For example:
insert into tmp_table select 20,*,0,0,0 from x;
if errorcode <> 0 THEN .goto label1;
update tmp_table set mm='hello'
if errorcode <> 0 THEN .goto label2;
Is it posible
insert into tmp_table select 20,*,0,0,0 from x;
if errorcode <> 0 THEN ERRORVARIABLE='Error in insert' .goto label1;
update tmp_table set mm='hello'
if errorcode <> 0 THEN ERRORVARIABLE='Error in update' .goto label1;
label 1
insert into error_table (ERRORVARIABLE)
quit errorcode
| |