An END QUERY CAPTURE statement must include the WITH option or the ON ALL RULES option. A BEGIN QUERY CAPTURE session must be active before you can submit an END QUERY CAPTURE statement.
An END QUERY CAPTURE statement that includes the WITH logging_option clause ends the scope of the BEGIN QUERY CAPTURE session issued with the specified option.
You can specify logging options for END QUERY CAPTURE statements throughout a BEGIN QUERY CAPTURE session to decrement the number of logging options being captured.
After an option has been removed from a query capture session, it can again be added later in the same session.
ON ALL RULE Clause
An END QUERY CAPTURE statement that includes the ON ALL RULES option ends the scope of the active BEGIN QUERY CAPTURE session.
All query capture options that had been enabled during the session are terminated and the session ends.