0

codeigniter フレームワークの stored_procedure 関数を使用して、PDF ファイルを db oracle (パスではなく) に直接保存しようとしています。

oci8_driver.php ファイルの _execute() 関数を変更し、これを追加しました

protected function _execute($sql)
{
    $this->stmt_id = FALSE;
    $this->_set_stmt_id($sql);
    $blob=FALSE;
    $myarray=array();
    $myarray = $this->binds;

  if (is_array($myarray)) {
  foreach ($myarray as $value)     {     
  if ($value['type'] ===  113 )
   {

$this->lob = oci_new_descriptor($this->conn_id, OCI_D_LOB);

     $blob=TRUE;
  }  }
 ...........
 ..................
 .....

    $exec_worked = ociexecute($this->stmt_id, $this->_commit);

            if (is_array($myarray)) {    
        foreach ($myarray as $value)     {
           if ($value['type'] ===  113 )
        {
      oci_execute($this->stmt_id, OCI_DEFAULT);

          if($blob)
             {
      $this->lob->savefile($value['value'] );
         oci_commit($this->conn_id);
             }

    }  

 }

この行を追加して、同じファイル内の _bind_param() 関数を変更します

     if ($param['type'] === 113)
          oci_bind_by_name($this->stmt_id , $param['name'], $this->lob,    $param['length'], OCI_B_BLOB);

しかし、問題はファイルを2回保存することです...手順自体をテストし、モデル関数はすべて1回実行されたことを示しています。重複がどこで発生するかわかりません

私の変更が問題の原因ですか、どうすればよいですか?

4

1 に答える 1

0

and/or$this->db->simple_query()の代わりに呼び出します。$this->db->query()$this->db->stored_procedure()

于 2012-12-29T02:29:40.713 に答える