QUERY_NAME option

Function

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

DBA permissions are not required to set this option. Can be set temporary for an individual connection or for the PUBLIC group. Takes effect immediately.

Description

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.