How do I combine BLOB object from two different rows into one?
Posted on 2005-05-10
I have SQL table with a BLOB object. The BLOB contains an 8K image. This is due to a limitation in getting a larger chunk generated from the source. The table also contains an identifier for each BLOB. So it is possible that an image could spread into 2 or three different rows. These are small images.
I need to find a way to merge these object into a single row. For example:
I have row1 and row2 each with an 8k image.
PhotoNumber PhotoPart Photo
Row1 1000 0 Binary
Row2 1000 1 Binary
I need to find a way to locate these two rows based on the PhotoNumber and then merge the two photos together into one row with the same PhotoNumber (1000) in this case. Row2 will also need to be deleted.
Can this be setup in a trigger so that anytime a multi-part photo hits the system, it gets merged into one row?