title: How to delete records in SQLite in iOS Application
body: <p>I am trying t delete records in my application, but I could not successfully able to do so.</p>
  
  <p>Here is the code snippet. </p>
  
  <pre><code>if(trackingHistory != nil){
      for (NSString *trkNum in trackingHistory) {
          if(trkNum == NULL){
              continue;
          }
          if (sqlite3_open(dbpath, &amp;database) == SQLITE_OK)
          {
              NSString *querySQL = [NSString stringWithFormat: @"delete from TRACK_IT where TRACKING_NUMBER=\"%@\"",trkNum];
              const char *query_stmt = [querySQL UTF8String];
              sqlite3_prepare_v2(database, query_stmt,-1, &amp;statement, NULL);
              if (sqlite3_step(statement) == SQLITE_DONE)
              {
                  NSLog(@"deleted record");
                  //return YES;
              } else {
                  NSLog(@"Failed to delete record");
                  // return NO;
              }
              sqlite3_reset(statement);
          }
      }
  }
  </code></pre>
  
  <p>Please let me know what could be wrong?</p>