Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Wanted to mark this as an improvement but that type wasn't available.
For insert (and delete statements), the RETURNING clause can be used to return the records that were actually inserted into a table
Currently however the returned resultset can only be returned to the caller. It cannot be stored into a temporary table, used as the values for a CTE, be used as subquery for a select statement, etc.
i.e. we should be able to do this:
CREATE TEMPORARY TABLE test(ikey INT NOT NULL AUTO_INCREMENT, ival INT, PRIMARY KEY(ikey)); |
 |
with inserted as( |
INSERT INTO test(ival) |
VALUES (10),(20),(30) |
RETURNING ikey, ival
|
)
|
.
I believe both postgres and oracle support this syntax, and mssql has the OUTPUT clause.
Attachments
Issue Links
- relates to
-
MDEV-5092 Implement UPDATE with result set
- Open