DISCARD

Calculates SELECT, REDUCE, or PROCESS, but returns no result to the client or to the table. It can't be set at the same time as INTO RESULT.

It's good to combine it with Ensure to check the final calculation result against the user's criteria.

Examples

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;

Previous