ACTIVITY_COUNT
Translation specification for the ACTIVITY_COUNT status variable.
Description
The ACTIVITY_COUNT
status variable returns the number of rows affected by an SQL DML statement in an embedded SQL or stored procedure application. For more information check here.
There is no direct equivalent in Snowflake. However, there is a workaround to emulate the ACTIVITY_COUNT
's behavior. One must simply use the following query:
This query retrieves and returns the first column of the result set from the last executed query in the current session. Furthermore, $1
can be replaced by "number of rows inserted"
, "number of rows updated"
or "number of rows deleted"
based on the query type.
As expected, this translation behaves like its Teradata counterpart only when no other queries besides the SQL DML statement are executed before calling LAST_QUERY_ID
.
Sample Source Patterns
Setup data
Teradata
Snowflake
Supported usage
Teradata
Snowflake
Known Issues
If
ACTIVITY_COUNT
is called twice or more times before executing a DML statement, the transformation might not return the expected values. Check here.If
ACTIVITY_COUNT
is called after a non DML statement was executed, the transformation will not return the expected values. Check here.ACTIVITY_COUNT
requires manual fixing when inside aSELECT/SET INTO VARIABLE
statement and was not able to be identified as a column name. Check here.
Related EWIs
SSC-FDM-TD0033: 'ACTIVITY_COUNT' TRANSFORMATION MIGHT REQUIRE MANUAL ADJUSTMENTS.
Last updated