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
How to eliminate product joins in a teradata sql query?
what are the day to day activities of teradata DBA ?
Explain the term 'tables' related to relational database management system?
What is the use of virtual processor connectivity in teradata?
What are the string manipulation operators and functions associated with teradata?
What are the steps involved after the disk manager passes the request?
What are the various indexes in teradata? How to use them? Why are they preferred?
Explain the term 'row' related to relational database management system?
Explain parsing engine in teradata?
List out some of the primary characteristics of teradata.
What is the purpose of joins in teradata and what are the available join types?
Did you write stored procedures in teradata?
List out teradata data types?
Explain amp in teradata?
During the Display time, how is the sequence generated by Teradata?