maggienelson.com | more blog archives

PDO_OCI does not support CLOBs

2007-06-20

LOB support was added to PDO_OCI in PHP 5.1. This is really cool, however, it appears that the LOB support really means BLOB support. I'm trying to use PDO::PARAM_LOB constant to pass in CLOBs (not BLOBs) and I get the following Oracle error:

ORA-00932: inconsistent datatypes: expected BLOB got CLOB
After much investigation and self-doubt (e.g. "what if we're using streams incorrectly?"), we found out that PDO_OCI does not currently support CLOBs (BLOBs only!). Here's some documentation on this bug: Cannot insert CLOB into table. Chris Jones just let us know that a fix to this bug and a related Seg fault after NLS environment initialization error will be merged into the next PDO_OCI patch shortly. (Comments are open if you have any updates about this bug.)

Comments (1)

2007-06-21 11:39:55 Christopher Jones said:

Any feedback on the patch in the bug would be appreciated.