DESIGNER_ADD_DESIGN_QUERIES_FROM_RESULTS

Executes the specified query and evaluates results in the following columns:

After evaluating the queries in QUERY_TEXT, DESIGNER_ADD_DESIGN_QUERIES_FROM_RESULTS adds all accepted queries to the design. An unlimited number of queries can be added to the design.

Before you add queries to a design, you must add the queried tables with DESIGNER_ADD_DESIGN_TABLES.

Behavior Type

Immutable

Syntax

DESIGNER_ADD_DESIGN_QUERIES_FROM_RESULTS ( 'design‑name', 'query' )

Parameters

design‑name

Name of the target design.

query

A valid SQL query whose results contain columns named QUERY_TEXT and, optionally, QUERY_WEIGHT.

Privileges

Errors

Database Designer returns an error in the following cases:

Example

The following example queries the system table QUERY_REQUESTS for all long-running queries (> 1 million microseconds) and adds them to the VMART_DESIGN design. The query returns no information on query weights, so all queries are assigned a weight of 1:

=> SELECT DESIGNER_ADD_DESIGN_QUERIES_FROM_RESULTS ('VMART_DESIGN', 
   'SELECT request as query_text FROM query_requests where request_duration_ms > 1000000 AND request_type = 
   ''QUERY'';');

See Also

Running Database Designer Programmatically