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对象

灌个水。

posted @ 2018-03-02 15:50  姜小豆  阅读(2901)  评论(0编辑  收藏  举报