我正在从 Google Places API 中提取数据并尝试使用 zend 框架将评论插入到 oracle 数据库中。但是很长的评论会给出错误,例如:
ORA-01461: 只能绑定 LONG 值以插入 LONG
当我尝试在 Orqcle SQL Developer 中运行插入查询时,会出现以下错误:
我尝试了一些我在 google 和 stackoverflow 上获得的解决方案,但仍然无法正常工作。
这是我在zend中的数据库代码:
public function addReview($bind) {
$bind['STATUS'] = 1;
$bind['CREATED_TIME'] = $this->_curDate;
$text = htmlentities($bind['TEXT']);
$query = "Insert INTO ".$this->_name." (LID,AUTHOR_NAME,AUTHOR_URL,RATINGS,TYPE,TIME,STATUS,TEXT)
VALUES (".$bind['LID'].",
'".$bind['AUTHOR_NAME']."',
'".$bind['AUTHOR_URL']."',
'".$bind['RATINGS']."',
'".$bind['TYPE']."',
'".$bind['TIME']."',
".$bind['STATUS'].",'".$text."')";
try {
$insert = $this->_dbAdpt->query($query);
} catch (Exception $e) {
echo $query; exit;
}
}