All Forums Tools
ANIMESH.DUTTA 35 posts Joined 05/09
03 Aug 2009
How to COLLECT STATS in BTET Mode in Multi-Statement BTEQ Scripts!

I need to COLLECT STATS after an Update Statement.

BT
; Update Table
; COLLECT STATS
; Delete
;
ET;

I've to use BT; ET; as a Multi-statement request in my BTEQ scripts.
But I'm getting Error - as DDL statement (COLLECT STATS) can't allowed in Multi-statement request.
Also DDL statement (COLLECT STATS) has to be the last statement of the script.

How should I use COLLECT STATS inside a Multi-statement request using BTET?
Also the below process throwing the error.

BT;
Update....;
ET;

BT;
COLLECT STATS...;
ET;

BT;
DELETE....;
ET;

Help please!!!!!!!!!

Animesh Dutta Teradata Certified Master
dnoeth 683 posts Joined 11/04
04 Aug 2009

In BTEQ there's no need to use BT/ET for a multistatement, because it's already a transaction.

COLLECT STATS is considered as a DDL statement, thus it's not allowed within a multistatement unless it's the last statement.

There's no way to bypass that restriction.

"Also the below process throwing the error."
Which error? This is supposed to run.

Dieter

ANIMESH.DUTTA 35 posts Joined 05/09
21 Aug 2009

Yeah - we need to use an ET after COLLECT STATS
that's working fine....
there is no error in the last statement...
thanks Dieter...

n/a
You must sign in to leave a comment.