All Forums Database
Santanu84 122 posts Joined 04/13
30 Jan 2015
bteq utility query on TD database

Hi All


Need help for one requirement. We are writing a bteq script. The statements are like below.


Insert into TableA ;

Insert into TableB;

Insert into TableC;

Insert into TableA;


Now the statement has failed at step 3 ( TableC insert ). If we want to restart the bteq from step 3 only , where first 2 steps are already comitted, how can we achieve that?


One way I know is to make them a single transaction with multiple statement by changing the ";" position to next line. 

But is there any other way apart from this, where we can start it from step 3 and then continue.


Please let me know your response.


Thanking You

Santanu Ghosh


Raja_KT 1246 posts Joined 07/09
30 Jan 2015

It needs unix/linux working knowledge. You can try  in  windows env too.
After login declare one empty file, run file.
label each dml for ease of retrieval.
perform your dml
check error code such as exit if it does not work.
If it passes thru, then redirect '.goto "your next sequence" > to that file.Here you can use os command.
Since you label each DML , so it replaces each one when it passes thru.
Suppose if it fails at any point of time and you re run, then that run file has the last content of that unix file, so it goes to that label.
Hope it is clear. 

Raja K Thaw
My wiki:
Street Children suffer not by their fault. We can help them if we want.

Santanu84 122 posts Joined 04/13
20 Feb 2015

Thanks Raja for your help.
Thanking You

You must sign in to leave a comment.