All Forums Training
HenryMiguel 7 posts Joined 05/13
03 Jun 2013
teradeta sql

Can we store the start time , end time & number of rows affected by a SQL  into another table in teradata, Can any one help in this ?

HenryMiguel
dnoeth 4628 posts Joined 11/04
04 Jun 2013

Hi Henry,
you mean within a script in (based on your tags) BTEQ?
There's ACTIVITYCOUNT, but you can't use it outside of .IF ACTIVITYCOUNT  :-(
 
Possible solutions:
- write a NOTIFY exit in C and use it before the SQL statement (check the BTEQ manual for details)
- wrap it in a SP
 
Or simply use DBQL for it (which is probably enabled on your system), there's only one drawback: DBQL is cached, to be able to run this insert within your script you need to ".HANG 600" seconds (or whatever is used on your system for flushing it).
Or set a QueryBand to easily identify the job(s) and then extract the info from dbc.QryLogV a while after the script(s) finished.
 
Dieter
 

Dieter

dnoeth 4628 posts Joined 11/04
04 Jun 2013

Btw,
would you three guys HenryMiguel, ANANDEKBOTE and ManishNayek (if they're actually different people) please stop posting new threads, just to answer them each other promoting the same training institute you're probably working for.
 
Dieter

Dieter

You must sign in to leave a comment.