As with other dynamic objects, you can create a dynamic query with a form of the CREATE statement. But also, as with other object types, you can attach a handle variable to a static query and use almost all of its methods and attributes to manipulate the query at run time.

The syntax for the CREATE QUERY statement is:
CREATE QUERY query-handle [ IN WIDGET-POOL pool-name ] .

There is no ASSIGN option on the CREATE QUERY statement, primarily because most of the operations you can perform on a dynamic query are methods, not attributes.

You can also attach a handle variable or field to a static query:
query-handle = QUERY query-name:HANDLE.