Save large chunks of text with clob
if(!$this->validate()){
return false;
}
$model = new Article();
$model->TITLE = $this->TITLE;
$model->CID = $this->CID;
$model->CONTENT_DATA = $this->CONTENT_DATA; //CONTENT_DATACLOB
$model->save();
the following error occurs
SQLSTATE[HY000]: General error: 1461 OCIStmtExecute: ORA-01461: can bind a LONG value only for insert into a LONG column (/tmp/pdo_oci/oci_statement.c:159)
then I rewrote the ocicommand class in yii2, the modified bindValues and bindPendingParams methods
protected function bindPendingParams()
{
foreach ($this->_pendParams as $name => $value) {
if(isset($value[2])){
$this->pdoStatement->bindParam($name, $value[0], $value[1], $value[2]);
}else{
$this->pdoStatement->bindParam($name, $value[0], $value[1]);
}
}
$this->_pendParams = [];
}
in this way, no matter how long the data is, it can be written to the database.
but with each update, the content becomes less.
write
there will be fewer updates.
is really incomprehensible.