Calculates SELECT
, REDUCE
, or PROCESS
without returning the result neither to the client or table. You can't use it along with INTO RESULT.
It's good to combine it with Ensure
to check the final calculation result against the user's criteria.
DISCARD SELECT 1;
INSERT INTO result_table WITH TRUNCATE
SELECT * FROM
my_table
WHERE value % 2 == 0;
COMMIT;
DISCARD SELECT Ensure(
0, -- will discard result anyway
COUNT(*) > 1000,
"Too small result table, got only " || CAST(COUNT(*) AS String) || " rows"
) FROM result_table;