Link to home
Start Free TrialLog in
Avatar of cbdrako99
cbdrako99Flag for United States of America

asked on

How to Convert 1000's of BLOBs to Image Files

Hello Experts,

I have been tasked with the challenge of exporting data contained in an existing medical practise managment database application (Lets call this application "A") into a form which can be imported into a new practice management application ("B").  There is no facility for exporting data out of "A", but by importing a backup file of "A's" database into a newly created MS SQL database, I have gained access to the raw data and I have worked out the mechanics of pulling the raw data and parsing it for import into"B".  

BUT my problem is that "A" stored scans of images and documents (growth charts, lab studies, letters and coorespondence, etc) as BLOBS.  There are several thousands of these BLOBS.  I cannot import the blob data into "B" as it is designed to store them in flat file form (.tiff or .pdf preferred).  

Does anyone know of a tool or application for accomplishing the conversion of blob data fields to image files?  I have heard that Visual Fox Pro may be capable of this, but I don't know VFP so that doesn't help a heck of a lot. (Any volunteers? :-) )

Note: "A" is constructed with MS SQL 2000.  "B" is built with MySQL.

PS. I am not a programmer by anyone's definition, so an off-the-shelf tool would be much preferred, but I'll take all the help I can get.  

Thanks in advance.
Avatar of rw3admin
rw3admin
Flag of United States of America image

you lost me at > "B" is built with MySQL.<< ... you need to post this in MYSQL forum as well,

rw3admin
Avatar of cbdrako99

ASKER

rw,
My problem limited only to the MS SQL side of the equation.  Exporting is the issue.  Once I can convert the MS SQL BLOB data to file, importing is a non-issue.
Thanks
ok tell me is that field really BLOB?, cause SQL have TEXT and IMAGE datatypes, I think BLOB is ORACLE and MySQL standard....
btw, for an example I exported
from following query
Select logo from pub_info where pub_Id='1389'  and I got this in txt file

474946383961C2001D00B30F00000000800000008000808000000080800080008080808080C0C0C0FF000000FF00FFFF000000FFFF00FF00FFFFFFFFFF21F9040100000F002C00000000C2001D004004FFF0C949ABBD38EBCDBBFF60288E1C609E2840AE2C969E6D2CCFB339D90F2CE1F8AEE6BC9FEF26EC01413AA3F2D76BAA96C7A154EA7CC29C449AC7A8ED7A2FDC2FED25149B29E4D479FD55A7CBD931DC35CFA4916171BEFDAABC51546541684C8285847151537F898A588D89806045947491757B6C9A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A95A6A3E64169923B0901A775B7566B25D7F8C888A5150BE7B8F93847D8DC3C07983BEBDC1878BCFAF6F44BBD0AD71C9CBD653BFD5CEC7D1C3DFDB8197D8959CB9AAB8B7EBEEEFF0BA92F1B6B5F4A0F6F776D3FA9EBCFD748C01DCB4AB5DBF7C03CF1454070F61423D491C326BA18E211081250C7AB12867619825F37F2ECE1168AC242B6A274556D121D28FA46C11E78564C5B295308F21BBF5CAD6CCE52C7018813932C4ED5C517346B7C1C2683368349D49A19D0439D31538A452A916135A0B19A59AAB9E6A835A0EABD00E5CD11D1D478C1C59714053AA4C4955AB4B9956879AB497F62E1CBA2373DA25B752239F8787119390AB5806C74E1100003B
actually I just realized I maybe waisting your time, I have knowledge of messing with image data type but I certainely am not any master...
rw,
Your knowledge exceeds mine, so jump in.  I am going to have to log into the client's server to verify the data type.  My teminology of BLOB may be inacurate.  All I know is that the image data must be in some sort of (binary?) form as there is no flat file structure for the images.  (Believe me, I have searched and searched).  I will log in this evening and try to determine the exact specs of the image table and fields within.
Thanks for you input so far.
Avatar of Anthony Perkins
>>My teminology of BLOB may be inacurate.<<
It is correct.  A BLOB (Binary Large Object) in MS SQL Server 2000 are all data types that are of data type text, ntext and image.

>>Does anyone know of a tool or application<<
MS SQL Server 2000 comes with a utility callled TextCopy.exe
ASKER CERTIFIED SOLUTION
Avatar of imran_fast
imran_fast

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Anthony
>>It is correct.  A BLOB (Binary Large Object) in MS SQL Server 2000 are all data types that are of data type text, ntext and image.<<
just a clarification.
There is no BLOB, CLOB or LOB in MSSQL, yes you are right in essense Text, nText and Image are Binary Large Objects, but the keyword BLOB, CLOB and LOB are used in Oracle, and thats what I was pointing.

rw3admin
imran_fast,

Thanks for your in-depth response in the use of TextCopy.exe and for taking the time to suggest using a stored procedure complete with examples. (Experts-Exchange is a life-saver!)

I will have access to the client's database this evening and will give your solution a try.  My email is skipb(at)t3-tech.com if you think of anything else useful, I would appreciate you forwarding your ideas.  

I am still unclear on how I will step through the rows of the table.

Thanks again, experts  
rw3admin,

>>There is no BLOB, CLOB or LOB in MSSQL ...<<
BLOB is a generic DBMS term.  I was not referring to a specific data type.  If you look up BLOB in BOL it points to the section: "ntext, text, and image" and throughout BOL it refers to "BLOB (text, ntext, or image data)".

cbdrako99,

>>My email is skipb(at)t3-tech.com if you think of anything else useful, I would appreciate you forwarding your ideas.  <<
Don't do this.  This is against EE Guidelines.


yes Anthony, but I was just pointing that Oracle have datatypes named as BLOB CLOB and LOB datatypes...
I just wanted to clear it so you dont think I was an oximoron... (whatever that means)...  :)