in reply to Re^3: How to insert BLOB into DB2 using DBI?
in thread How to insert BLOB into DB2 using DBI?

Actually, it's not working. My code is:
open(INFILE,"X:\\\\ongoing\\bioinformatics\\db2\\image\\picture1.wmf") +; binmode(INFILE); $img_data = <INFILE>; close(INFILE); my $stmt = "INSERT INTO project_figures (pjfg_id, pjfg_name, pjfg_imag +e) VALUES(?,?,?)"; my $sth = $dbh->prepare($stmt); my $rc = $sth->execute(1,'picture1.wmf', $img_data);
And I get
DBD::ODBC::st execute failed: [IBM][CLI Driver] CLI0110E Invalid outp +ut or indicator buffer specified. SQLSTATE=22002 (SQL-22002)(DBD: st_ +execute/SQLExecute err=-1) at insert_image.pl line 24. DBD::ODBC::st execute failed: [IBM][CLI Driver] CLI0110E Invalid outp +ut or indicator buffer specified. SQLSTATE=22002 (SQL-22002)(DBD: st_ +execute/SQLExecute err=-1) at insert_image.pl line 24.

Replies are listed 'Best First'.
Re^5: How to insert BLOB into DB2 using DBI?
by Tanktalus (Canon) on Jan 14, 2005 at 17:02 UTC

    I'm trying to get this working myself - although I'm using DBD::DB2 rather than DBD::ODBC. I'll try to update this when I figure out what I'm doing wrong ;-)

    First - I suggest using DBD::DB2 if you can (I realise that on Windows it's easier said than done ... which is why I like my Linux box ;->). Second - can you tell me which version of DB2, and which product you're using on Windows? And, if the server is a different machine, what it is (version, product, OS)? e.g., "DB2 Runtime Client v7.2 running against DB2 ESE v8.1FP6a on AIX" - Thanks

    UPDATE: The dtlob.pl script that is part of DB2 v8.2's samples (be sure to install the sample applications) seems to work, although I'm still trying to figure out why when I write it myself it doesn't :-)