QUERY attribute
- Last Updated: July 15, 2022
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
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, andADD-LIKE-COLUMNmethods. - 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
QUERYattribute is set to the Unknown value (?). You should add new columns with theADD-CALC-COLUMN,ADD-COLUMNS-FROM, andADD-LIKE-COLUMNmethods. - 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.
?). You can also use the
FILL-WHERE-STRING attribute to override the WHERE clause
in the query.FILL-WHERE-STRING attribute of the data source object only applies to
the default data source query. It does not apply when a named query is specified using the
QUERY attribute.