luni, 31 mai 2010

Edit/update blob data in Informix

If you are using informix as your data base and you want to upload data in clob or blob column from a file you can use FILETOBLOB or FILETOCLOB.

FILETOBLOB(path, location)
FILETOBLOB(path, location)

path - path to the file to be uploaded
location - client/server - the file is uploaded from the client of from the server of the Data Base

Examples:

UPDATE table SET value = FILETOCLOB("E://MyDocuments/Utils/temp/complInf.xml", 'client');

UPDATE table SET value = FILETOBLOB("E://MyDocuments/Utils/temp/complInf.xml", 'server');

INSERT INTO table
VALUES (437, FILETOBLOB('datafile', 'client'),
FILETOCLOB('tmp/text', 'server'));