Skip to content

DO statement

View as Markdown

The DO statement evaluates an expression and discards the result. Use it to check that an expression is valid (an invalid one returns an error) or to call a function only for its side effects. Because no result set is built and sent back, DO is slightly cheaper than the equivalent SELECT.

DO expression
  • expression: any expression, including a subquery that returns one value.
DO 1 + 1;
DO SYSDATE + 1;
DO (SELECT COUNT(*) FROM orders);

Each statement succeeds and returns nothing. An expression that cannot be evaluated is reported as an error, just as it would be in a SELECT.