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
Mention the procedure via which, we can run Teradata jobs in a UNIX environment.
Can we collect statistics on multiple columns?
What are the various etl tools in the market?
What are the different methods ot loading a dimension table? A fact table etc?
How to explain project Architecture and flow in teradata interviews?Can please anyone help on this? Am new to teradata.
What is the use of stored procedures in teradata?
What are the different table types supported by teradata?
Explain and compare pros and cons of start schemas?
What is the multi-insert?
Backup Script was blocked then you are unable to archive the data. how do you analyze it and where do you identify ?
Is it necessary to add? Quit statement after a bteq query when I am calling it in a unix environment?
What is the difference between teradata and oracle?
What are the multiload utility limitations?
What are the functions of a Parser?
What is the function of parser component in teradata?