Affected row count in BTEQ

Database
Enthusiast

Affected row count in BTEQ

How can I get to know the rows affected by DML(Insert, Update, Merge, Delete) statements executed in a BTEQ? I need to use this data for logging purpose.

4 REPLIES
Apprentice

Re: Affected row count in BTEQ

Hi,

Logging where ?

 

You can test it in a BTEQ script using ActivityCount but BTEQ does not have a capability to extract that information so that you can write it anywhere (e.g. a table).

 

You have to have a shell script or similar to read the BTEQ output log.

 

Cheers,

Dave

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com
Enthusiast

Re: Affected row count in BTEQ

Hi Dave,

 

I wanted to do the logging into a table and wanted to avoid sheel script route to read from logs. 

 

Thanks

Abdul

Apprentice

Re: Affected row count in BTEQ

Hi Abdul,

 

You and lots of other people Smiley Happy

 

If using BTEQ there is no built-in way to do this. if using TPT then you can do it. Not straight forward but you can do it. If this is of interest then look in the "Teradata Parallel Transporter User Guide" manual, chapter 14 (TTU 15.10).

 

Cheers,

Dave

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com
Apprentice

Re: Affected row count in BTEQ

One further thought about this.

 

The only way I can see doing this in a BTEQ environment is to use the NOTIFY feature. This causes BTEQ to pass certain information including the ActivityCount to a user-written module ('notify exit') at different points in the processing.

 

To get ActivityCount you'll need to use the HIGH verbosity option and trap the 'fetch start' or 'fetch start 2' event.

 

Cheers,

Dave

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com