Zend:在CLOB和BLOB中插入大数据?

时间:2013-06-13 07:40:57

标签: zend-framework blob clob

我从Google Places API中提取数据并尝试使用zend框架将评论插入到oracle数据库中。但是很长的评论会给出错误:

  

ORA-01461:只能插入LONG值才能插入LONG

当我尝试在Orqcle SQL Developer中运行插入查询时,它给出了以下错误:

enter image description here

我尝试了一些google和stackoverflow上的解决方案,但仍无法正常工作。

这是我在zend中的db代码:

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;
    }

}

1 个答案:

答案 0 :(得分:0)

以某种方式创建插入评论的程序!以下是程序:

create or replace procedure google_review (lid in int,author_name in varchar2, author_url in varchar2,ratings in varchar2,
type in varchar2,time in varchar2,status int,text in varchar2)
as
begin

INSERT INTO TBL_REVIEWS
  (
    LID,
    AUTHOR_NAME,
    AUTHOR_URL,
    RATINGS,
    TYPE,
    TIME,
    STATUS,
    TEXT
  )
  VALUES
  (
    LID,
    AUTHOR_NAME,
    AUTHOR_URL,
    RATINGS,
    TYPE,
    TIME,
    STATUS,
    TEXT
  );
  end;