General error: 24374 OCIStmtFetch: ORA-24374: define not done before fetch or execute and fetch

问题

$sql='insert into "test"("id") values(4)';
$res=$this->conn->query($sql);

用TP连接Oracle执行insert时数据可以插进去就是有这个错,解决了半天。

解决方法

query() 第四个参数为 true即可。

$res=$this->conn->query($sql,[],false,true);

第四个参数的作用是:是否返回PDO对象

灌个水。

原文地址:https://www.cnblogs.com/warcraft/p/8493635.html