Is it possible to get the row count after doing "CREATE TABLE AS SELECT"?

Viewed 215

In a BQ stored procedure, I'm doing:

DECLARE varRow_count INT64;

CREATE TABLE `<my_table_name>` 
AS 
  SELECT 
   <my SQL>
;

SET varRow_count = @@row_count;

But varRow_count ends up being NULL. The SQL definitely populates the table with rows so there should be a row count returned IMHO.

Is this because @@row_count only works with classic INSERT or SELECT or DELETE DML whereas the above is classed as DDL?

Thanks.

0 Answers
Related