From 37fa2bceca4cec31d1b9c0f53d64ad3368b5615b Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 30 Jun 2016 21:43:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Oracel=E9=A9=B1=E5=8A=A8?= =?UTF-8?q?=E7=9A=84execute=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/connector/Oracle.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/library/think/db/connector/Oracle.php b/library/think/db/connector/Oracle.php index f50ec5f1..840ed44d 100644 --- a/library/think/db/connector/Oracle.php +++ b/library/think/db/connector/Oracle.php @@ -47,7 +47,7 @@ class Oracle extends Connection * @param string $sql sql指令 * @param array $bind 参数绑定 * @param boolean $getLastInsID 是否获取自增ID - * @param string $sequence 序列名 + * @param string $sequence 序列名 * @return integer * @throws \Exception * @throws \think\Exception @@ -60,16 +60,16 @@ class Oracle extends Connection } // 根据参数绑定组装最终的SQL语句 - $this->queryStr = $this->getBindSql($sql, $bind); + $this->queryStr = $this->getRealSql($sql, $bind); $flag = false; if (preg_match("/^\s*(INSERT\s+INTO)\s+(\w+)\s+/i", $sql, $match)) { - if(is_null($sequence)){ + if (is_null($sequence)) { $sequence = Config::get("db_sequence_prefix") . str_ireplace(Config::get("database.prefix"), "", $match[2]); } - $flag = (boolean) $this->query("SELECT * FROM all_sequences WHERE sequence_name='" . strtoupper($sequence) . "'"); + $flag = (boolean) $this->query("SELECT * FROM all_sequences WHERE sequence_name='" . strtoupper($sequence) . "'"); } - + //释放前次的查询结果 if (!empty($this->PDOStatement)) { $this->free(); @@ -89,7 +89,7 @@ class Oracle extends Connection $this->lastInsID = $this->linkID->lastInsertId(); if ($getLastInsID) { return $this->lastInsID; - } + } } return $this->numRows; } catch (\PDOException $e) { @@ -130,7 +130,7 @@ class Oracle extends Connection /** * 取得数据库的表信息(暂时实现取得用户表信息) * @access public - * @param string $dbName + * @param string $dbName * @return array */ public function getTables($dbName = '') @@ -155,7 +155,8 @@ class Oracle extends Connection return []; } - protected function supportSavepoint(){ + protected function supportSavepoint() + { return true; } }