ERRORS

redwarningErrors in the system are all handled by the DBDelegate, if an error is raised within DBAccess it will raise an event on the

– (void)databaseError:(DBError *)error method, passing you an error object that you can use to determine where the fault was. As a general rule, it is always good practice to leave a breakpoint on this event as it will then, via the backtrace, allow you to investigate where the error was raised.

 

Below is the implementation of the error handler on the delegate object.

- (void)databaseError:(DBError *)error {
    NSLog(@"\nerror >> %@ \nSql >> %@\n", error.errorMessage, error.sqlQuery);
}

This will then give you an error message that should enable you to work out what part of the query string is not working.

error >> no such column: ages 

Sql >> SELECT Person.surname as surname, Person.age as age, Person.forename
as forename, Person.currentAddress as currentAddress, Person.Id as Id FROM
Person WHERE ages >= ? AND age <= ?