Class: cDbQuery¶
Include: Use Db\cDbQuery.pkg
Hierarchy: cObject -> cDbQuery
Package: Db\cDbQuery.pkg
cDbQuery creates ad hoc Data Dictionary-backed queries with bound fields, native expressions, constraints, ordering, and paged fetch calls.
Properties¶
See Properties.
| Name | Purpose |
|---|---|
| Server | Data Dictionary server handle. |
| phoServer | Backing server handle. |
| paFields | Fields or native expressions returned by the query. |
| paOrdering | Ordering segments used by the query. |
Methods¶
See Methods.
| Name | Purpose |
|---|---|
| Bind_Data | Adds a Data Dictionary field to the query result. |
| Bind_Native_Expression | Adds a native expression to the query result. |
| FetchEx | Fetches rows using explicit mode, start row, and limit. |
| FetchFirst | Fetches the first page of rows. |
| FetchLast | Fetches the last page of rows. |
| FetchNext | Fetches rows after a start row. |
| FetchPrevious | Fetches rows before a start row. |
| OrderByField | Orders query rows by a Data Dictionary field. |
| OrderByIndex | Orders query rows by index segments. |
| RebuildConstraints | Rebuilds active constraints by sending OnConstrain. |
| ResetOrdering | Clears query ordering. |
Events¶
See Events.
| Name | Purpose |
|---|---|
| OnConstrain | Event used to add query constraints. |
Example¶
Object oQuery is a cDbQuery
Set Server to oCustomer_DD
Entry_Item oCustomer_DD.Name
Entry_Item oCustomer_DD.City
Send OrderByField oCustomer_DD (RefTable(oCustomer_DD.Name)) ASC
Send OrderByField oCustomer_DD (RefTable(oCustomer_DD.City)) ASC
End_Object
Variant[][] aRows
DbRowId[] aRowIds
Get FetchFirst of oQuery 25 (&aRowIds) to aRows