Start of change

FREE STABILIZED DYNAMIC QUERY subcommand (DSN)

The FREE STABILIZED DYNAMIC QUERY command removes from certain catalog tables one or more stabilized dynamic queries. If any of the specified queries are in the dynamic statement cache, FREE STABILIZED DYNAMIC QUERY also purges the statements from the dynamic statement cache.

Environment for FREE STABILIZED DYNAMIC QUERY

You can use the FREE STABILIZED DYNAMIC QUERY command from DB2I, or from a DSN session under TSO that runs in either the foreground or background. You can also use the SYSPROC.ADMIN_COMMAND_DSN stored procedure to submit this subcommand from a remote requester.

Data sharing scope: Group

Authorization

To execute this command, you must use a privilege set of the process that includes one of the following authorities:

  • SQLADM authority
  • System DBADM authority
  • SYOPR authority
  • SYSCTRL authority
  • SYSADM authority

Syntax for FREE STABILIZED DYNAMIC QUERY

Read syntax diagramSkip visual syntax diagram FREE STABILIZED DYNAMIC QUERY STBLGRP (stabilization-group*) SDQSTMTID( statement-ID)PLANMGMTSCOPE(ALLINVALID)INVALIDONLY(NOYES)

Option descriptions for FREE STABILIZED DYNAMIC QUERY

STBLGRP (stabilization-group)
Free all stabilized dynamic queries, or for a specific stabilization group.
stabilization-group
Free all stabilized queries for a stabilization group.
*
Free all stabilized queries.
SDQSTMTID (statement-identifier)
Free an individual stabilized dynamic query with the specified big-integer constant statement-identifier value.
PLANMGMTSCOPE
Which copy of a stabilized dynamic query to free.
ALL
Free all the qualified copies of the stabilized dynamic query. This is the default.
INVALID
Free only the invalid copy (COPYID=4) of the stabilized dynamic query.
INVALIDONLY
Whether to free only copies of the stabilized dynamic query that are invalid.
NO
Free all the qualified copies of the stabilized dynamic query. This is the default.
YES
Free only the copies of the stabilized dynamic queries that are invalid (VALID='N').

Usage notes for FREE STABILIZED DYNAMIC QUERY

If you use FREE DYNAMIC QUERY to free multiple copies, each successful free operation is committed before the next dynamic query is freed. If an error occurs during processing for a dynamic SQL statement, command processing ends for that stabilized dynamic query and continues processing the next stabilized dynamic query.

Examples

Free all stabilized dynamic queries for stabilization group APP01
FREE STABILIZED DYNAMIC QUERY STBLGRP(APP01)
Free stabilized dynamic query with statement identifier 1234
FREE STABILIZED DYNAMIC QUERY SDQSTMTID (1234)
Free the invalid copy (COPYID=4) of the stabilized dynamic query with statement identifier 1234
FREE STABILIZED DYNAMIC QUERY SDQSTMTID (1234) PLANMGMTSCOPE(INVALID)
Free all copies of the stabilized dynamic query with statement identifier 1234 that are invalid (VALID='N')
FREE STABILIZED DYNAMIC QUERY SDQSTMTID (1234) INVALIDONLY(YES)
End of change