ACTIVITY_COUNT
Translation specification for the ACTIVITY_COUNT status variable.
Last updated
Translation specification for the ACTIVITY_COUNT status variable.
Last updated
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 .
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
.
If ACTIVITY_COUNT
is called twice or more times before executing a DML statement, the transformation might not return the expected values. Check .
If ACTIVITY_COUNT
is called after a non DML statement was executed, the transformation will not return the expected values. Check .
ACTIVITY_COUNT
requires manual fixing when inside a SELECT/SET INTO VARIABLE
statement and was not able to be identified as a column name. Check .
: 'ACTIVITY_COUNT' TRANSFORMATION MIGHT REQUIRE MANUAL ADJUSTMENTS.