title: Getting Wrong value of image while retrieving from Sqlite DB in iOS
body: <p>Getting wrong value from DB while retrieving image Blob value from sqlite DB in iOS.I store image blob value in DB but when i try to get the value it give me extra number of bytes.Any please help me.</p>
  
  <p>Insert value using below method:</p>
  
  <pre><code>{
   NSData * compressimagestream = UIImageJPEGRepresentation(imageview.image, 0.5);
   sql = [NSString stringWithFormat:@"INSERT INTO IMAGE ('Image') VALUES ('%@')",compressimagestream];
  
   sqlite3_stmt* statement;
  
  
   if( sqlite3_prepare_v2(db, [sql UTF8String], -1, &amp;statement, NULL) == SQLITE_OK )
   {
      sqlite3_bind_blob(statement, 1,[field2 bytes],[field2 length], SQLITE_TRANSIENT);
  
      sqlite3_step(statement);
      NSLog(@"Update %@",field2);
      return TRUE;
   }
   else
   {
     NSLog(@"Update Fail");
     return  FALSE;
   }
  }
  </code></pre>
  
  <p>The insert code is working correctly and store wright amount of bytes as i get from UIImageJPEGRepresentation method.</p>
  
  <p>I am retrieving value from below method:</p>
  
  <pre><code>  {
    NSData *find = NULL;
    sqlite3_stmt *statement;
    sql = [NSString stringWithFormat:
                        @"select * from IMAGE"];
   const char *query_stmt = [sql UTF8String];
  
   if (sqlite3_prepare_v2(db,query_stmt, -1, &amp;statement, NULL) == SQLITE_OK)
   {
      if (sqlite3_step(statement) == SQLITE_ROW)
      {
  
      NSData *content = [[NSData alloc]
                     initWithBytes:sqlite3_column_blob(statement, 1)
                     length:sqlite3_column_bytes(statement, 1)];
          find = content;
      }
      else{
          NSLog(@"Not found");
      }
      sqlite3_reset(statement);
   }
   return find;
   }
  </code></pre>
  
  <p>Thanks in Advance, sorry for my english.</p>