GET DIAGNOSTICS - ROW_COUNT

Description

This command allows retrieval of system status indicators. ROW_COUNT: the number of rows processed by the most recent SQL command.

Click here to navigate to the PostgreSQL documentation page for this syntax.

The GET DIAGNOSTICS - ROW_COUNT is translated to SQLROWCOUNT in snowflake.

Grammar Syntax

GET [ CURRENT ] DIAGNOSTICS variable { = | := } item [ , ... ];

Sample Source Patterns

Input

DO $$
DECLARE
  var1 INTEGER;
BEGIN
  insert into test_table2 values (1), (2), (3);
  GET DIAGNOSTICS var1 = ROW_COUNT;
  RAISE NOTICE '%', var1;
END;
$$;

Output

3

Last updated