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

What are the available join types in teradata?

598


Describe the between keyword in teradata?

612


Comment whether bottleneck is an error or not.

625


What is the use of virtual processor connectivity in teradata?

569


Did you write stored procedures in teradata?

619






In the Primary Index, what is the score of AMPs that are actively involved?

578


What do you mean by ttu in teradata?

571


What is smp and mpp platforms?

529


why use references rather than pointers in the public api, particularly for arguments which are modified?

556


What are the various indexes in teradata? Why are they preferred?

561


If RDBMS is halted what will you do ?

1708


What are the things to be considered while creating secondary index?

634


Explain vproc in teradata?

566


What is called partitioned primary index (ppi) and discuss the advantages of using it in a query?

547


What is the multi-insert?

614