Subject Re: [firebird-php] How to get result from insert... returning ... SQL statement? Related to Yii2 Firebird extension.
Author Lester Caine
On 13/09/16 10:58, jonatan.lauritsen@... [firebird-php] wrote:
> 2) Do anyone uses Yii2 Firebird extension (driver)?

jonatan ... The problemover the last many years is that PHP does not
have a 'standard' for handling database connections. PDO was intended to
be the start of that, but never got passed the 'data abstraction' level
at all. But for some private motives, ADOdb could have been moved in to
core as a starting point to provide the whole cross database system.

I can't comment on pdo actions, but

INSERT INTO CONTRACTS (contract_no) VALUES (10002) RETURNING contract_no
is a little strange since you are providing the return value.

INSERT INTO CONTRACTS ( ...data... ) VALUE ( ...fields...) RETURNING
contract_no where the contract_no is supplied via a generator in the
Firebird business logic. In this case the query just needs running, and
the return result processed.

INSERT INTO CONTRACTS (contract_no) VALUES (?) RETURNING contract_no
Is more like my own method of working, but again I don't need the return
value as I will have provided it into the prepared statement. I just
need that

INSERT INTO CONTRACTS (contract_no) VALUES (?) works and one can set up
a prepared statement to perhaps scan an array of values to add a list of
contracts.

What is the real prepare statement creating $this->pdoStatement

I'm deep in my own code at the moment so can't try things, but I'm using
the same sort o actions without a problem, so it may be Yii2 has a
problem. The Zend framework certainly needs a few updates for it to work
with pdo-firebird.

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk