QUERY_NAME option

Function

Gives a name to an executed query.

Allowed values

Quote-delimited string of up to 80 characters.

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.

Default

Empty string.

Description

The QUERY_NAME option can be assigned 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 the option is set to a different value before each query in a script, it is much easier to identify the correct query plan for a particular query. It also prevents previous query plans from being overwritten. This option has no other effect on the query.