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

Backup Script was blocked then you are unable to archive the data. how do you analyze it and where do you identify ?

1707


What exactly do you know about catching in teradata?

794


What is meant by a Parsing Engine?

919


Explain vproc in teradata?

756


Why is the case expression used in teradata?

794


Can any one explain me the difference between BTEQ and MLOAD,TUMP. All canbe used for same purpose but still differnt methods. why ?

3268


What happens in a conflict? How do you handle that?

823


Define views in teradata with syntax.

820


What is the primary index in teradata?

800


What is the purpose of upsert command?

803


How to find duplicates in a table?

847


What do you mean by caching in teradata?

811


Describe the between keyword in teradata?

809


How many sessions of MAX is PE capable of handling at a particular time?

799


Why are oltp database designs not generally a good idea for a data warehouse?

811