Show TOC

QUERY_NAME OptionLocate this document in the navigation structure

Gives a name to an executed query in its query plan.

Allowed Values

Quote-delimited string of up to 80 characters.

Default

'' (the empty string)

Scope

Option can be set at the database (PUBLIC) or user level. At the database level, the value becomes the default for any new user, but has no impact on existing users. At the user level, overrides the PUBLIC value for that user only. No system privilege is required to set option for self. System privilege is required to set at database level or at user level for any user other than self.

Requires the SET ANY PUBLIC OPTION system privilege to set this option. Can be set temporary for an individual connection or for the PUBLIC role. Takes effect immediately.

Remarks

You can assign the QUERY_NAME option any quote-delimited string value, up to 80 characters. For example:

set temporary option Query_Name = 'my third query'

When this option is set, query plans that are sent to the .iqmsg file or .html file include a line near the top of the plan that looks like:

Query_Name:  'my third query'

If you set the option to a different value before each query in a script, it is much easier to identify the correct query plan for a particular query. The query name is also added to the file name for HTML query plans. This option has no other effect on the query.