I am using ORDER BY
clause to fetch data but it does not work in simple db amazon web service data base.if i do not use the order by clause in query then it works fine other wise it crashed the app.
below is the code.
select = [[NSString alloc] initWithFormat:@"select * FROM ContentMaster where ContentAddedByUserID='%@' AND HiveletCode='%@' ORDER BY ContentAddedDateTime DESC",appDelegate.userID,appDelegate.organizationCode];
SimpleDBGetAttributesRequest *gar = [[SimpleDBGetAttributesRequest alloc] initWithDomainName:DOMAIN_NAME andItemName:itemNameUser];
SimpleDBGetAttributesResponse *response = [sdbClient getAttributes:gar];
NSString*nextToken;
NSLog(@" Catgeory ID is %@ ", appDelegate.categoryID);
NSLog(@"%@ ", appDelegate.organizationCode);
SimpleDBSelectRequest *selectRequest = [[[SimpleDBSelectRequest alloc] initWithSelectExpression:select] autorelease];
NSLog(@"Select Request is %@",selectRequest);
selectRequest.consistentRead = YES;
nextToken = selectRequest.nextToken;
NSLog(@"Next Token is %@",nextToken);
SimpleDBSelectResponse *selectResponse = [sdbClient select:selectRequest];
From the SimpleDB documentation
This means you will probably need to change your query to:
As for the crash, this an exception from the SDK, you should either disable exceptions and handle errors or put your calls in a @try/@catch block. You can read more about how exceptions and errors are handled in the AWS SDK for iOS in our blog.