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

问题#

 

Copy

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

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

解决方法#

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

 

Copy

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

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

转自:https://www.cnblogs.com/warcraft/p/8493635.html

猜你喜欢

转载自blog.csdn.net/z3287852/article/details/111230309