Hi,?

Running an update like below with DBD::Oracle that updates 2 rows with the same 
BLOB value bound as ORA_BLOB fails with the following inside oci8.c


    if (row_count  > 1)
        return oci_error(sth, errhp, OCI_ERROR, "LOB refetch attempted for 
multiple rows");

and I'm having a hard time understanding why it isn't possible to do something 
like this?


    UPDATE tbl SET blobcol=? WHERE id IN (?,?)


I've found advise saying I should bind the parameter as SQLT_BIN (which is the 
same as ORA_RAW, both have the value 23) and I'm wondering if anyone can 
explain what is going on here? RAW and BLOB are different data types with 
different storage mechanisms in Oracle so it feels strange to bind it as 
SQLT_BIN when the column is a BLOB. It seems to work ok when binding with 
SQLT_BIN but I would appreciate some clarification on that this is the right 
way to do it.


If I hack oci8.c and literally remove the above if statement the UPDATE goes 
through but seemingly produces a broken result where only the last row gets the 
correct BLOB value and the preceding rows now contain an empty BLOB (i.e. if 
they had a previous value it gets wiped out).


Just trying to understand what is special about BLOBs in this case. It feels 
like a perfectly normal use case to be able to update more than one row in a 
single statement regardless of column data types.


Thanks & kind regards,


/ Marcus

Reply via email to