troubleshooting Question

Select multiple blobs in one coloum one record

Avatar of tonelm54
tonelm54 asked on
MySQL ServerSQL
3 Comments2 Solutions221 ViewsLast Modified:
Good evening,
Ive been dealing with blobs over the past few days, and experienced several issues with my application dealing with them. I have solved it by splitting a blob file up over multiple records, so instead of having one massive blob in a record, I now have a table:-
CREATE TABLE `fileBlob` (
`fileID` BIGINT NOT NULL ,
`part` INT NOT NULL ,
`blob` TINYBLOB NOT NULL 
)

Open in new window


Which works great for uploading files into the table, but messy when downloading. Currently I call the statment and work through each row appending the blob output:-
SELECT * 
FROM `fileBlob` 
WHERE `fileID` =27
ORDER BY `part` ASC 

Open in new window


Is it possible to group all the blob data together ordered by `part` from a `fileID`, so something like:-
SELECT GROUP_CONCAT(`blob`) as blobData 
FROM fileblob
WHERE `fileID` =27

Open in new window

However the GROUP_CONCAT would obviously have to be ordered, and I dont know how to tell it to only dislay the blob data.

Any help would be appriciated.

Thank you
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros