Closed gopalsys closed 7 years ago
FreeTDS only allows one execute operation at a time. You must wait for the completion block to be invoked before you can submit your next operation.
Yes, that is fine. I do the same in my projects. You just can't run multiple execute commands at once. You could use a serial operation queue, or simply block the UI with a modal spinner while an operation executes.
Hi, like I said FreeTDS only allows you to execute one statement at a time. Please review how to chain asynchronous methods in objective-C via nested callbacks, operation queues, or Promises to get your desired behavior.
Here is my code trying to execute multiple commands at a time. i am unable get data getting bad access error.
SQLClient* client = [SQLClient sharedInstance]; client.delegate = (id)self; [client connect:@"port" username:@"un" password:@"pwd" database:@"db" completion:^(BOOL success) { if (success) { for(int i=0;i<=onholdarraycount;i++){ NSString _query=[NSString stringWithFormat:@"select a.Invoice_Number,a.OnHoldID,a.Cashier_ID,a.Section_ID,a.Status,a.Occupied,b.ShapeType from Invoice_OnHold a,Table_Diagram b where a.OnHoldID=b.Table_Number and a.SectionID='%@'",sectionaname]; [client execute:query completion:^(NSArray results) { for (NSArray* table in results) nslog(@“%@”,table); } [client disconnect]; }else{ } }];
Thanks for help in advance.