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
What are the components provided on node?
Explain the types of join supports by teradata?
Explain and compare pros and cons of snow flake schemas?
How to load specific no.of records using bteq, or fastload,or multiload
What is bteq utility in teradata?
Difference between inner join and outer join?
Which is more efficient group by or distinct to find duplicates?
What are the available primary index types in teradata.
Difference between multiload and tpump?
What can be achieved by using the teradata rdbms?
What is spool space? Why do you get spool space errors?
Can we have two time dimensions in a schema(either star or snow flake)? For ex if we want joining date of employee and if we want today's sales with time whether can we have two time dimensions for accommodating above tasks?
Hi send me the Teradata dumps to my id rajeshanantha@yahoo.co.in Thanks Rajesh. A
Give the sizes of SMALLINT, BYTEINT and INTEGER.
What is the syntax for case when statement?