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 / yuvaevergreen

Adding to above,assuming usage of a simple restart table,
below logic can be used. Below sql will not take care of
insert or delete statement failure. If the update statement
fails, the script would be restarted from update statement.
If the insert or delete statements fail, the script
would be started from insert statement.



bteq << EOF

.logon tdpid/user,password;

SELECT * FROM RESTART_TABLE WHERE STATUS='RESTART';
IF .ACTIVITYCOUNT=1 THEN .GOTO UPDTDML;
IF .ACTIVITYCOUNT=0 THEN .GOTO INSDML;

.label INSDML;
INSERT STATEMENT;

.IF ERRORCODE <> 0 THEN .EXIT;

.label DELDML;
DELETE STATEMENT;

.IF ERRORCODE <> 0 THEN .EXIT;

.LABEL UPDTDML;
UPDATE STATEMENT;

.IF ERRORCODE <> 0 THEN .GO TO REST;

.IF ERRORCODE = 0 THEN .GO TO REST1;

.LABEL REST;
DEL FROM RESTART_TABLE;
INSERT INTO RESTART_TABLE ('RESTART');
.EXIT;

.LABEL REST1;
DEL FROM RESTART_TABLE;
.EXIT;

.EOF

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by a Parsing Engine?

801


What are the joins in teradata and how many types of joins are there in teradata?

658


What is primary index and secondary index?

660


What are types of partition primary index (ppi) in teradata?

675


List the logical and conditional operators that are used with teradata along with their meanings?

640






Describe the between keyword in teradata?

710


tomorrow i have interview in infosys.can someone pour any suggestions or any interview questions. thank you

457


What is a clique?

682


Highlight the advantages of PPI(Partition Primary Index).

665


what are the uses of fact table and dimension table in banking project?

4201


Different phases of multiload?

662


What is the difference between fastload and multiload? Which one is faster?

733


How you will check the version of teradata?

713


If the PMON is not working then how do you manage and monitor all processes, resources and sessions etc.

1752


Explain Teradata performance tuning and optimization?

803