Analyzing dynamic parameters

Adaptive Server lets you analyze dynamic parameters (which are indicated by question marks) before running a query, helping you avoid inefficient query plans.

Analyze dynamic parameters using:

Using the value provided by @@plwpid as the value for the show_dynamic_params_in_xml object_id parameter, Adaptive Server displays information about the dynamic parameters in the query. Continue refining the parameters until you find the ones that provide you with the best query plan.

Disable the statement cache before you analyze dynamic parameters for a query. The statement cache reuses query plans to avoid compilation.

The output of show_dynamic_params_in_xml is similar to:

<!ELEMENT query (parameter*)>
<!ELEMENT parameter (number, type, column?)>
<!ELEMENT number (#PCDATA)>
<!ELEMENT type (#PCDATA)>
<!ELEMENT column (#PCDATA)>

The root element of the document is <query>, which can have zero or more <parameter> elements. Each <parameter> element includes: