将PHP PDO与Firebird INSERT一起使用...返回/存储过程,无需暂停 [英] Use of PHP PDO with Firebird INSERT... RETURNING / STORED PROCEDURE without SUSPEND

查看:93
本文介绍了将PHP PDO与Firebird INSERT一起使用...返回/存储过程,无需暂停的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有执行PDOStatement并试图获取返回数据的PHP代码:

I have PHP code that executes PDOStatement and tries to fetch the returned data:

$this->pdoStatement->execute();
$this->pdoStatement->fetch();

PDO语句的SQL是:

The SQL of PDO statement is:

INSERT INTO CONTRACTS (contract_no) VALUES (10010) RETURNING contract_no

但是不带suspend子句的存储过程也可以在这里.问题在于,上述提到的PHP PDO命令序列在执行提取时返回以下错误:

But the stored procedure without suspend clause can also be here. The problem is that the mentioned sequence of PHP PDO commands return the following error while executing fetch:

SQLSTATE[HY000]: General error: -502 Cursor is not open 

如何以及完全有可能使用PHP数据对象PDO从Firebird中将数据从insert ...插入其中?

How and is it possible at all to get data from insert... into from Firebird using PHP Data Objects PDO?

这个问题涉及的范围更广-我尝试通过插件 http:将Yii 2.0与Firebird一起使用//www.yiiframework.com/extension/yii2-firebird/,我发现由于此问题中所述的问题,insert命令无法正常工作.

This question has a wider context - I try to use Yii 2.0 with Firebird using plugin http://www.yiiframework.com/extension/yii2-firebird/ and I have discovered that the insert command is not working due the problem described in this question.

Firebird 2.1.

Firebird 2.1.

推荐答案

尝试升级PHP.我已经修复了PHP7 Firebird PDO扩展中的一些错误,包括带有"returning"子句的语句.

Try upgrading PHP. I've fixed some bugs in the PHP7 Firebird PDO extension, including statements with "returning" clause.

这篇关于将PHP PDO与Firebird INSERT一起使用...返回/存储过程,无需暂停的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆