Hi,
I was wondering if it is possible to send two statements and have one database roundtrip. More specifically:
Given (MySQL):
CREATE TABLE t (
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
name VARCHAR(10) NOT NULL
);
I want to send this to the database:
INSERT INTO t VALUES (NULL, 'Bob');SELECT * FROM t WHERE id=LAST_INSERT_ID();
And get the result in one roundtrip. I tried with insert...returning...fetchOne, but it looks like that is taking two trips (not really sure, but looks like it).
Any clues?
Groeten,
Friso