On Fri, 15 Feb 2013 07:27:33 -0800 (PST),
ulric...@googlemail.com
wrote:
> Am Freitag, 15. Februar 2013 15:16:27 UTC+1 schrieb Peter H. Coffin:
>
>> On Fri, 15 Feb 2013 03:07:51 -0800 (PST),
ulric...@googlemail.com
>>
>> wrote:
>>
>> > Hello,
>>
>>
>> > ich have to insert a jpg picture with max 300k into a blob column
>> > of a DB2 8.2 Database. With java it works, but with [php + IBM
>> > odbc] I get an error SQL0102A (String to long) Ist the picture
>> > smaler (15k) then it works. I think the problem is, that the
>> > picture converted in HEX ist larger then 32k.
>> >
>> > Is it possible to insert the picture in parts of 32k into the blob?
>> >
>> > What can be a sulution?
>>
>>
>>
>> Are you using actual formal BLOBs, with formal LOB & locator
>> functions, or are you just stuffing binary data into a really wide
>> column and calling it done? If not using LOBs, start with that. They
>> should be good to 2 147 483 647 bytes.
>
> I do this:
>
> $Data = file_get_contents("picture.jpg");
> $Data = bin2hex($Data);
> $res = odbc_prepare ($dbconn, "insert into tb_picture (EINGANG,DATEN ) values (current timestamp, '".$Data."')");
>
> $result = odbc_execute($res);
>
> If picture.jpg is less the 15k it works. Is the picture larger, I get
> the error SQL0102N (Sting is to long)
But, please show your table. DESCRIBE TABLE tb_picture; would be a good
start.
--
81. If I am fighting with the hero atop a moving platform, have
disarmed him, and am about to finish him off and he glances behind
me and drops flat, I too will drop flat instead of quizzically
turning around to find out what he saw. --Evil Overlord list