views:

183

answers:

3

Hey guys,

I need to check on the contents of blobs in my databases (yes, plural, but one problem at a time).

In one database, I have about 900 images of potentially varying sizes. I need to check to see if the versioning system that's built into our application is actually correctly replicating the image data from the previous version to the new version of a record.

How do I compare values en masse so I don't have to pick through each record one at a time and open up the blob using FlameRobin or Firebird Maestro and visually compare these images?

Thanks for any assistance.

+1  A: 

try to do a hash (like md5) on each bolb and see if they are the same.

SELECT
    oldTable.PK
    FROM oldTable
        LEFT OUTER JOIN newTable ON oldTable.PK=newTable.PK
    WHERE MD5(oldTable.blob_column)!=MD5(newTable.blob_column)
KM
Now there is an interesting idea... thank you for that. Let me try....
Michael Beck
Firebird doesn't appear to have an MD5 function according to this: http://en.wikibooks.org/wiki/SQL_Dialects_Reference/Functions_and_expressions/String_functions Really good idea though. Thank you.
Michael Beck
KM
+1  A: 

You can handle this in two ways:

  1. create some kind of function that returns a unique value for each image, store it in a different column and compare these values
  2. get an "external function library" (also called "User Defined Function library") that includes a "blob compare" function: install the library at your server, declare the function in your database and use it.

See IBPhoenix for a list of UDF libraries for Firebird.

Martijn Tonies
A: 

Zidsoft CompareData database data comparison/sync tool, it is free for Firebird

Farid Z