Yes, you can access any data in the found records quite easily.
from the manual:
Code: Select all
Once the query has been generated you can process the results in the same manner that you would process any other records in a database or index.
For example, the following code shows you how to traverse through the query result set.
'queries do not require the index parameter - it would be ignored anyway.
CALL xdbMoveFirst(Query1&, 0)
DO UNTIL xdbEOF&(Query1&) 'process the record here using functions such as xdbFieldValue$
Manuf$ = xdbFieldValue$(Query1&, "MANUF", 0)
'if you need to know the record number in the database then call 'the xdbRecordNumber function with the Query handle, not the 'database handle.
RecNum& = xdbRecordNumber&(Query1&)
CALL xdbMoveNext(Query1&, 0)
LOOP
You can also use xdbGetRecord to specify the "i-th" record in a query result. In this case you would use the query handle instead of the database handle and pass the position in the query result instead of the record number. For example, to retrieve the 5th record in the query result you would use:
CALL xdbGetRecord(Query1&, 5)
You can also include mulitple conditions in the query.
From the Manual:
Code: Select all
Example: To create a condition such as trying to find all customers with a customer ID between 1000 and 2000, and who have purchases of between $5000 and $10000, you would use the following conditions. (Note, the first condition should always have a join phrase equal to ZERO).
CALL xdbQueryCondition(Query1&, 0, "CUSTID", %BETWEEN, "1000", "2000")
CALL xdbQueryCondition(Query1&, %QUERY_AND, "PURCH", %BETWEEN, "5000", "10000")
Example: Create a condition to find all customer names containing the words "Bill" or "William". (Note, the first condition should always have a join phrase equal to ZERO).
CALL xdbQueryCondition(Query1&, 0, "CUSTNAME", %CONTAINS, "BILL", "")
CALL xdbQueryCondition(Query1&, %QUERY_OR, "CUSTNAME", %CONTAINS, "WILLIAM","")
For my projects, I was going to write my own database procedures, and I am glad I tried Cheetah before I did any of the procedures. It saved me a lot of time and energy.