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

In BTEQ, how are the session-mode parameters being set?

683


What is spool space? Why do you get spool space errors? How do trouble-shoot them?

550


How do you set the session mode parameters in bteq?

623


Explain teradata utilities. What is multiload, fast load, tpump?

587


Explain the parallel data extension in teradata?

669






What does sleep function does in fast load?

634


What is a node in teradata? Explain

609


What tools would you use for that?

585


Hi, If anyone has TD 14 Basics dumps or study materials, please share. nirmaaal1991@gmail.com

1977


If RDBMS is halted what will you do ?

1718


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

585


What is the purpose of joins in teradata?

552


In a table can we use primary key in one column and in another column both unique and not null constrains.if yes how?

586


Highlight a few of the advantages that ETL tools have over Teradata.

630


What are the frequently used data types in teradata?

610