insert a BLOB via a sql script ?

Posted by David Michel on Stack Overflow See other posts from Stack Overflow or by David Michel
Published on 2010-04-09T12:26:25Z Indexed on 2010/04/09 14:03 UTC
Read the original article Hit count: 595

Filed under:
|
|
|

Hi,

I have an H2 database (http://www.h2database.com) and I'd like to insert a file into a BLOB field via a plain simple sql script (to populate a test database for instance). I know how to do that via the code but I cannot find how to do the sql script itself.

I tried to pass the path , i.e.

INSERT INTO mytable (id,name,file) VALUES(1,'file.xml',/my/local/path/file.xml);

but this fails.

Within the code (java for instance), it's easy to create a File object and pass that in, but directly from a sql script, I'm stuck...

Any idea ?

David

© Stack Overflow or respective owner

Related posts about h2

Related posts about sql