ACTIVITY_COUNT of DBC.SysExecSQL

Database
Enthusiast

ACTIVITY_COUNT of DBC.SysExecSQL

Hi All,

I want to use ACTIVITY_COUNT   with  DBC.SysExecSQL to get how many rows updated by the query executed in DBC.SysExecSQL.

Can anybody help me in this. 

Thanks 

Tags (1)
3 REPLIES
Junior Contributor

Re: ACTIVITY_COUNT of DBC.SysExecSQL

Simply use it:

   CALL dbc.sysexecsql(...);
SET myVAr = ACTIVITY_COUNT;

Btw, better use Standard compliant EXECUTE IMMEDIATE instead of SysExecSQL.

Enthusiast

Re: ACTIVITY_COUNT of DBC.SysExecSQL

Thanks Dieter :)

Re: ACTIVITY_COUNT of DBC.SysExecSQL

Hello ,

I did try above approach, but it seems to capture '0' always. My goal is to capture SP NAME, SQL and ACTIVITY_COUNT

I'm trying  below.


SET   strSQLCmd ='Delete   database.table' ; 

CALL DATABASE.sysexecsql(:strSQLCmd);

SET strActivityCount = ACTIVITY_COUNT; 

CALL DATABASE.CaptureQuery(strSQLCmd, strSPNAME,strActivityCount); 

Can someone please advise.

Thanks in advance !