DISCARD

Calculates SELECT without returning the result neither to the client or table.

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

Examples

  1. DISCARD SELECT 1;

DISCARD - 图1

  1. INSERT INTO result_table WITH TRUNCATE
  2. SELECT * FROM
  3. my_table
  4. WHERE value % 2 == 0;
  5. COMMIT;
  6. DISCARD SELECT Ensure(
  7. 0, -- will discard result anyway
  8. COUNT(*) > 1000,
  9. "Too small result table, got only " || CAST(COUNT(*) AS String) || " rows"
  10. ) FROM result_table;

DISCARD - 图2