Issues

ZF-11099: ORA-24816: Expanded non LONG bind data supplied after actual LONG or LOB column

Description

Problem hit when using PDO_OCI and Oracle 10g. When inserting row a ORA-24816: Expanded non LONG bind data supplied after actual LONG or LOB column exception was (sometimes) thrown.

ORA-24816: Expanded non LONG bind data supplied after actual LONG or LOB column Cause: A Bind value of length potentially > 4000 bytes follows binding for LOB or LONG. Action: Re-order the binds so that the LONG bind or LOB binds are all at the end of the bind list.

As solution (or rather work-around) i modified Zend_Db_Table_Abstract::insert() adding this piece of code at top


        /**
         * 
         * ORA-24816: Expanded non LONG bind data supplied after actual LONG or LOB column - Oracle Errors  
         */
        foreach ($data as $key => $value) {
             if ($this->_metadata[$key]['DATA_TYPE'] == 'LONG' OR $this->_metadata[$key]['DATA_TYPE'] == 'LOB') {
                unset($data[$key]);
                $data[$key] = $value;
             }
        }

Comments

fixed code quoting