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 / aarsh dave
Create an empty file before each set of DML statements.
Write the BTEQ as below:
bteq << EOF
.logon tdpid/user,password;
.OS if [-f bteq_restart.txt];then else {touch bteq_restart.txt};
.run file bteq_restart.txt;
.label INSDML;
INSERT STATEMENT 1;
INSERT STATEMENT 2;
.IF ERRORCODE <> 0 THEN .EXIT ERRORCODE;
.label DELDML;
DELETE STATEMENT 1;
DELETE STATEMENT 2;
.IF ERRORCODE <> 0 THEN .EXIT ERRORCODE;
.IF ERRORCODE <> 0 THEN .OS echo '.GOTO UPDTDML' >
bteq_restart.txt;
.LABEL UPDTDML;
UPDATE STATEMENT 1;
UPDATE STATEMENT 2;
.IF ERRORCODE <> 0 THEN .EXIT ERRORCODE;
.OS rm -f bteq_restart.txt;
.EOF
Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Backup Script was blocked then you are unable to archive the data. how do you analyze it and where do you identify ?
What exactly do you know about catching in teradata?
What is meant by a Parsing Engine?
Explain vproc in teradata?
Why is the case expression used in teradata?
Can any one explain me the difference between BTEQ and MLOAD,TUMP. All canbe used for same purpose but still differnt methods. why ?
What happens in a conflict? How do you handle that?
Define views in teradata with syntax.
What is the primary index in teradata?
What is the purpose of upsert command?
How to find duplicates in a table?
What do you mean by caching in teradata?
Describe the between keyword in teradata?
How many sessions of MAX is PE capable of handling at a particular time?
Why are oltp database designs not generally a good idea for a data warehouse?