Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
None
Description
Dear Developers,
Would make sense after getting any default possible value in columns to have INSERT RETURNING syntax , that send back resultset off every columns that do set a default value in a ROW.
In useful in such cases :
- to get back an array of auto increment PK values for connectors batch mode
- to enable ORM to have a real object view of some default values inserted inside records
- in multi master and Galera to stop using auto-increment for PK in profit of uuid_short
- to pack protocol roundtrip like last_insert_id
Oracle allow sequence for this:
https://oracle-base.com/articles/misc/dml-returning-into-clause
postgresql
https://www.postgresql.org/docs/9.2/static/sql-insert.html
MsSQL works for every default like UID
INSERT INTO table (name)
OUTPUT Inserted.ID
VALUES('bob');
SqlLite
https://github.com/jazzyb/sqlite_ecto/wiki/Sqlite.Ecto's-Pseudo-Returning-Clause
Thanks in advance
Attachments
Issue Links
- duplicates
-
MDEV-10014 Add RETURNING to INSERT
- Closed