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


Please Help Members By Posting Answers For Below Questions

How to eliminate product joins in a teradata sql query?

692


what are the day to day activities of teradata DBA ?

5449


Explain the term 'tables' related to relational database management system?

684


What is the use of virtual processor connectivity in teradata?

667


What are the string manipulation operators and functions associated with teradata?

729






What are the steps involved after the disk manager passes the request?

681


What are the various indexes in teradata? How to use them? Why are they preferred?

681


Explain the term 'row' related to relational database management system?

617


Explain parsing engine in teradata?

694


List out some of the primary characteristics of teradata.

642


What is the purpose of joins in teradata and what are the available join types?

639


Did you write stored procedures in teradata?

708


List out teradata data types?

636


Explain amp in teradata?

650


During the Display time, how is the sequence generated by Teradata?

697