in a BTEQ we have 2 insert 2 del 2 update statment.
when the BTEQ is restarted i need to run the BTEQ from
after DEL statment(means no need to run the insert & del
stat).what is the logic for the above requirement?
Answer Posted / yuvaevergreen
Adding to above,assuming usage of a simple restart table,
below logic can be used. Below sql will not take care of
insert or delete statement failure. If the update statement
fails, the script would be restarted from update statement.
If the insert or delete statements fail, the script
would be started from insert statement.
bteq << EOF
.logon tdpid/user,password;
SELECT * FROM RESTART_TABLE WHERE STATUS='RESTART';
IF .ACTIVITYCOUNT=1 THEN .GOTO UPDTDML;
IF .ACTIVITYCOUNT=0 THEN .GOTO INSDML;
.label INSDML;
INSERT STATEMENT;
.IF ERRORCODE <> 0 THEN .EXIT;
.label DELDML;
DELETE STATEMENT;
.IF ERRORCODE <> 0 THEN .EXIT;
.LABEL UPDTDML;
UPDATE STATEMENT;
.IF ERRORCODE <> 0 THEN .GO TO REST;
.IF ERRORCODE = 0 THEN .GO TO REST1;
.LABEL REST;
DEL FROM RESTART_TABLE;
INSERT INTO RESTART_TABLE ('RESTART');
.EXIT;
.LABEL REST1;
DEL FROM RESTART_TABLE;
.EXIT;
.EOF
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
how do you manage the production space. what are the proactive methods you can take ?
What are the uses of bynets in multi-node systems?
In Teradata, what is the significance of UPSERT command?
What are the different functions performed in development phase?
hi frnds i want to learn teradata utilities and teradata dba real time. i have 1+ years of experience in teradata. so i want to go deeply in Tearada. plz let me know at my email id who r best to learn from. im lookng for a realtime guy in HYD or Banglr. Thanks in advance. Rajesh my email-id: rajeshmss87@gmail.com
What is the syntax for case when statement?
What exactly do you know about catching in teradata?
What is the use of teradata system software?
What do you mean by parsing?
What are some primary characteristics of teradata?
What do you mean by fastexport in teradata?
Difference between stored procedure and macro?
What are the different design perspectives used in teradata?
How to write the query . eid enm doj dob i want to display the names who worked more than 25 years .
There is a column with date in it. If I want to get just month how it can be done? Can I use sub string?