Unable to save image in iPhone sqlite Table
I am trying to save image in sqlite but it is giving error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error while creating update statement. 'out of memory''
My code is :

      sqlite3_stmt *insert_statement;
      const char *sql = "Insert into Gallery ('Image') VALUES(?)";
      if(sqlite3_prepare_v2(database, sql, -1, &insert_statement, NULL) != SQLITE_OK) {
      NSAssert1(0, @"Error while creating update statement. '%s'", sqlite3_errmsg(database));
     }
     if(shareImage != nil){       
         NSData *imgData = UIImagePNGRepresentation(shareImage);
         sqlite3_bind_blob(insert_statement,0,[imgData bytes], [imgData length],SQLITE_TRANSIENT);
      }
     else {
        sqlite3_bind_blob(insert_statement, 2, nil, -1, NULL);
    }
    sqlite3_close(database);

Unable to save image in iPhone sqlite Table
===

I am trying to save image in sqlite but it is giving error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error while creating update statement. 'out of memory''
My code is :

      sqlite3_stmt *insert_statement;
      const char *sql = "Insert into Gallery ('Image') VALUES(?)";
      if(sqlite3_prepare_v2(database, sql, -1, &insert_statement, NULL) != SQLITE_OK) {
      NSAssert1(0, @"Error while creating update statement. '%s'", sqlite3_errmsg(database));
     }
     if(shareImage != nil){       
         NSData *imgData = UIImagePNGRepresentation(shareImage);
         sqlite3_bind_blob(insert_statement,0,[imgData bytes], [imgData length],SQLITE_TRANSIENT);
      }
     else {
        sqlite3_bind_blob(insert_statement, 2, nil, -1, NULL);
    }
    sqlite3_close(database);
