SUPQueryResultSet

The SUPQueryResultSet class provides for querying a result set from the dynamic query API. SUPQueryResultSet is returned as a result of executing a query.

The following example shows how to filter a result set and get values by taking data from two mobile business objects, creating a SUPQuery, filling in the criteria for the query, and filtering the query results:

SUPQuery *query [SUPQuery getInstance];
[query select:@"c.fname,c.lname,s.order_date,s.region"];
[query from:@"Customer":@"c"];
[query join:@"SalesOrder":@"s":@"s.cust_id":@"c.id"];
SUPAttributeTest *at = [SUPAttributeTest getInstance];
at.attribute = @"lname";
at.testValue = @"Devlin";
at.operator = SUPAttributeTest_EQUAL;
query.testCriteria = at;
SUPQueryResultSet *qrs = [SUP101DB executeQuery:query];
while ([qrs next])
{
NSLog(@"%@,",[qrs getString:1 withName:@"c.fname"]);
NSLog(@"%@,",[qrs getString:2 withName:@"c.lname"]);
NSLog(@"%@,",[[qrs getDate:3 withName:@"s.order_date"] description]);
NSLog(@"%@\n",[qrs getString:4 withName:@"s.region"]);
}



}