Einstein47
Programmer
I am trying to store an image to an Informix database. But no matter what I try I can't get it to work with simple SQL.
I have done a very simple proof of concept - what am I doing wrong?
I keep getting errors on every single insert line (I try running them individually). But I still can't seem to figure out what I am doing wrong.
Any suggestions?
Einstein47
“Evil abounds when good men do nothing.“ - Nelson R.
[[]Starbase47.com]
I have done a very simple proof of concept - what am I doing wrong?
Code:
CREATE TEMP TABLE tmpimg1 (id serial (101) primary key, pic byte) WITH NO LOG;
CREATE TEMP TABLE tmpimg2 (id serial (101) primary key, pic blob) WITH NO LOG;
CREATE TEMP TABLE tmpimg3 (id serial (101) primary key, pic clob) WITH NO LOG;
insert into tmpimg1 values (0,Filetoblob("C:\dev\draft.gif","client","tmpimg1","pic"));
insert into tmpimg1 (id,pic) values ( 0, Filetoblob( "C:\dev\draft.gif", "client") ) ;
insert into tmpimg1 values (0,Filetoblob("/tmp/draft.gif","client","tmpimg1","pic"));
insert into tmpimg1 values (0,Filetoblob('/tmp/draft.gif','server',"tmpimg1","pic"));
insert into tmpimg2 values (0,Filetoblob("C:\dev\draft.gif","client","tmpimg2","pic"));
insert into tmpimg2 (id,pic) values ( 0, Filetoblob( "C:\dev\draft.gif", "client") ) ;
insert into tmpimg2 values (0,Filetoblob("/tmp/draft.gif","client","tmpimg2","pic"));
insert into tmpimg2 values (0,Filetoblob('/tmp/draft.gif','server',"tmpimg2","pic"));
insert into tmpimg3 values (0,Filetoclob("C:\dev\draft.gif","client","tmpimg3","pic"));
insert into tmpimg3 (id,pic) values ( 0, Filetoclob( "C:\dev\draft.gif", "client") ) ;
insert into tmpimg3 values (0,Filetoclob("/tmp/draft.gif","client","tmpimg3","pic"));
insert into tmpimg3 values (0,Filetoclob('/tmp/draft.gif','server',"tmpimg3","pic"));
drop table tmpimg1;
drop table tmpimg2;
drop table tmpimg3;
I keep getting errors on every single insert line (I try running them individually). But I still can't seem to figure out what I am doing wrong.
Any suggestions?
Einstein47
“Evil abounds when good men do nothing.“ - Nelson R.
[[]Starbase47.com]