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
In BTEQ, how are the session-mode parameters being set?
What is spool space? Why do you get spool space errors? How do trouble-shoot them?
How do you set the session mode parameters in bteq?
Explain teradata utilities. What is multiload, fast load, tpump?
Explain the parallel data extension in teradata?
What does sleep function does in fast load?
What is a node in teradata? Explain
What tools would you use for that?
Hi, If anyone has TD 14 Basics dumps or study materials, please share. nirmaaal1991@gmail.com
If RDBMS is halted what will you do ?
What are the joins in teradata and how many types of joins are there in teradata?
What is the purpose of joins in teradata?
In a table can we use primary key in one column and in another column both unique and not null constrains.if yes how?
Highlight a few of the advantages that ETL tools have over Teradata.
What are the frequently used data types in teradata?