bteq utility query on TD database

Database

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

2 REPLIES

Re: bteq utility query on TD database

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. 

Re: bteq utility query on TD database

Thanks Raja for your help.

Thanking You

Santanu