top-think / think-oracle

Oracle数据库驱动
Apache License 2.0
36 stars 20 forks source link

我这边使用了出现这个错误 #1

Open jb522185660 opened 7 years ago

jb522185660 commented 7 years ago

SQLSTATE[HY000]: General error: 936 OCIStmtExecute: ORA-00936: missing expression (/tmp/PDO_OCI-1.0/oci_statement.c:142)

pengpengzhiyou commented 6 years ago

我遇到[HY000]SQLSTATE[HY000]: General error: 936 OCIStmtExecute: ORA-00936: missing expression (/builddir/build/BUILD/php-7.1.16/ext/pdo_oci/oci_statement.c:159)[/app/project/vendor/topthink/think-oracle/src/Connection.php:98] 处理方式是把 : public function getLastInsID($sequence = null) { $pdo = $this->linkID->query("select {$sequence}.currval as id from dual"); $result = $pdo->fetchColumn(); return $result; } 修改为: public function getLastInsID($sequence = null) { if(!empty($sequence)) { $pdo = $this->linkID->query("select {$sequence}.currval as id from dual"); $result = $pdo->fetchColumn(); }else{ $result = []; } return $result; } 可以正常使用了