Cause: While making the first call to write LOB data, an invalid pieceinfo value provided. See the solution below.
Error solution: Correct the call to use OCI_ONE_PIECE or OCI_FIRST_PIECE. If using OCCI, make sure to call writeBuffer before calling writeLastBuffer.
Database version: Oracle 11g Release 2 (11.2)