Re: insert blob
Posted in 2003
MSA wrote: > i would like to insert a file in a column > > i juste created a test table : > > { TABLE "informix".a row size = 56 number of columns = 1 index size = 0 } > create table "informix".a > ( > a byte not null > ) extent size 32 next size 32 lock mode page; > > then i tried to insert some file : can't do it :( > > if found some things from google but only for oracle, mysql or with jdbc. > my problem is that i cant use anything like ifx_create_blob or any 'prepare' > function, i can only use raw SQL. > > can someone give me an exemple if it's possible only with SQL statements ? Which Informix server version? In 9.x, you should replace BYTE by BLOB (a Smart BLOB), worry about where it will be placed (smart blob space usually), and then use the file_to_blob() method to load the data (and unload it). Otherwise, you can do it with ESQL/C statements - there's a bunch of example code included with SQLCMD which is available from the IIUG Software Archive (http://www.iiug.org/software). If you tie your hands behind your back, it makes it difficult to type at the keyboard in front of you. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/