extract BLOBS
Posted in 2000
Topics: General Discussion
Is there a (simple and comfortable) way to extract BLOBS from a database table? Let's say, there are pictures stored in a table. Is it possible to extract them from the table and to store them in single files on disk? Thanks in advance. Norbert
Norbert Heidbrink wrote: > Is there a (simple and comfortable) way to extract BLOBS from a database > table? > > Let's say, there are pictures stored in a table. Is it possible to > extract them from the table and to store them in single files on disk? > > Thanks in advance. > Norbert It would be easy using 4GL in a few lines you can do it. -- Compliments of QueriX -------------------------------------------------------------------------------------------------- QueriX 4GL Compilers are Informix 4GL Compatible, and Connection to other RDBMS such as Oracle. Hydra 4GL Compiler (Compatible with I4GL) Compile once, run everywhere Phoenix Windows GUI. (Front End to 4GL) Chimera Java GUI The only GUI you will ever need... (Front End to 4GL) Arachne Web Technology (Front End to 4GL on the Web & HTML Report Generator) ESQL/C Compiler For more details visit: http://www.querix.com/ ---------------------------------------------------------------------------------------------------
there is a smart large object function 'lotofile' which does this. lotofile ( blob-column,pathname, file_destination) pathname = directory path and name of the file. file destination = 'client' to identify the client computer as the location of the file. file destination = 'server' to identify the server computer as the location of the file. page 4-149 of informix guide to sql - reference,syntax 2nd edition. Norbert Heidbrink wrote: > Is there a (simple and comfortable) way to extract BLOBS from a database > table? > > Let's say, there are pictures stored in a table. Is it possible to > extract them from the table and to store them in single files on disk? > > Thanks in advance. > Norbert
Norbert Heidbrink wrote: > > Is there a (simple and comfortable) way to extract BLOBS from a database > table? > > Let's say, there are pictures stored in a table. Is it possible to > extract them from the table and to store them in single files on disk? Store them on disk INSTEAD of in the database? Or do you mean at query time select the BLOB from the table into a disk file so an external program can access it? If the former, just do the suggestion below for the latter and keep the files around, then alter the table to include a column to hold the file path and update the row with the path. Now alter the table to drop the BLOB column and poof they are out of the database and into the filesystem. Look in the 4GL or ESQL manuals. There are examples of FETCHing BLOBs to disk files. You can tell the engine to unload the BLOB directly to a disk file either to a filename/path or to write to an open file descriptor you have previously opened. Art S. Kagel