我遇到[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;
}
可以正常使用了