WHILE STATEMENT
Executes a list of SQL statements in a loop until the WHILE condition is met
WHILE boolean_expression DO sql_statement_list END WHILE;
Sample Source Patterns
DECLARE x INT64 DEFAULT 0;
WHILE x < 5 DO
SET x = x + 1;
END WHILE;
INSERT INTO SNOWPUBLIC.table_while_1 VALUES (x);Row
id
SET x = 0;
BEGIN
WHILE ((
SELECT
$x < 5
)) DO
SET x = $x + 1;
END WHILE;
END;
INSERT INTO SNOWPUBLIC.table_while_1
VALUES ($x);Row
id
Row
id
Row
id
Last updated
Was this helpful?