From cc191effcc610a1ff82505d2d7a0eed92af31753 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 12 Jun 2016 17:34:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BOracle=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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/think/db/connector/Oracle.php b/library/think/db/connector/Oracle.php index 7364c506..a9b7e102 100644 --- a/library/think/db/connector/Oracle.php +++ b/library/think/db/connector/Oracle.php @@ -47,6 +47,8 @@ class Oracle extends Connection * @param string $sql sql指令 * @param array $bind 参数绑定 * @param boolean $fetch 不执行只是获取SQL + * @param boolean $getLastInsID 是否获取自增ID + * @param string $sequence 序列名 * @return integer * @throws \Exception * @throws \think\Exception @@ -65,8 +67,10 @@ class Oracle extends Connection } $flag = false; if (preg_match("/^\s*(INSERT\s+INTO)\s+(\w+)\s+/i", $sql, $match)) { - $table = 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($table) . "'"); + 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) . "'"); } //释放前次的查询结果 if (!empty($this->PDOStatement)) {