Try OpenEdge Now
skip to main content
ABL Reference
Handle Attributes and Methods Reference : QUERY attribute
 

QUERY attribute

The handle of the query connected to a browse widget, a buffer object, a data-relation object, or a data-source object.
Data type: HANDLE
Access: Readable/Writable
Applies to: BROWSE widget, Buffer object handle, Data-relation object handle, Data-source object handle
If you change the value of a browse's QUERY attribute, you connect the browse to a different query, which contains a different set of records.
For a browse query in Windows platforms:
*The original query and the new query do not need to have the same underlying database fields.
*If the query is changed for a dynamic browse, the browse columns are removed. You should add new columns with the ADD-CALC-COLUMN, ADD-COLUMNS-FROM, and ADD-LIKE-COLUMN methods.
*If the query is changed for a static browse and the underlying fields are the same, the columns are not removed. However, if the underlying fields are not the same, the columns are removed. The columns are also removed if the QUERY attribute is set to the Unknown value (?). You should add new columns with the ADD-CALC-COLUMN, ADD-COLUMNS-FROM, and ADD-LIKE-COLUMN methods.
*Also, a query can now be attached to a static browse that was defined without the optional DISPLAY phrase.
For a browse query on Character Mode platforms:
*If the original query has database tables, the new query must have database tables. The new query can have different buffers as long as they correspond to the same database tables.
*If the original query has temp-tables, the new query must have temp-tables, not work tables.
*The original query and the new query must have the same number of tables.
For a buffer object, this attribute returns the handle to the query currently associated with the buffer (if any). If the buffer does not have an associated query, this attribute returns the Unknown value (?). This attribute is also read-only for a buffer object.
For a data-relation object, this attribute returns the handle to the default dynamic query for a child buffer in the relation. This automatically generated query expresses the relation between parent and child temp-tables, and lets you navigate the child records. This handle cannot be set, and the query cannot be modified except by using the WHERE-STRING attribute.
For a data-source object, this attribute associates a query with a dynamic data-source object. To disassociate the query and data-source object, set this attribute to the Unknown value (?). You can also use the FILL-WHERE-STRING attribute to override the WHERE clause in the query.

See also

FILL-WHERE-STRING attribute, WHERE-STRING attribute