SUPQuery *query = [SUPQuery getInstance];
[query select:@"c.fname,c.lname,s.order_date,s.id"];
[query from:@"Customer":@"c"];
[query join:@"SalesOrder":@"s":@"s.cust_id":@"c.id"];
query.testCriteria = [SUPAttributeTest match:@"c.lname":@"Smith"];
SUPQueryResultSet* resultSet = [SMP101SMP101DB executeQuery:query];
if(resultSet == nil)
{
MBOLog(@"executeQuery Failed !!");
return;
}
for(SUPDataValueList* result in resultSet)
{
MBOLog(@"Firstname,lastname,order date,region = %@ %@ %@ %@",
[SUPDataValue getNullableString:[result item:0]],
[SUPDataValue getNullableString:[result item:1]],
[[SUPDataValue getNullableDate:[result item:2]] description],
[SUPDataValue getNullableString:[result item:3]]);
}