In Oracle, one can insert multiple rows by doing a query like
INSERT ALL
INTO mytable (column1, column2, column3) VALUES ('val1.1', 'val1.2', 'val1.3')
INTO mytable (column1, column2, column3) VALUES ('val2.1', 'val2.2', 'val2.3')
INTO mytable (column1, column2, column3) VALUES ('val3.1', 'val3.2', 'val3.3')
SELECT * FROM dual;
And with a prepared statement, doing a single insert like this one
BEGIN INSERT
INTO mytable (column1, column2, column3) VALUES (null, 'val1.2', 'val1.3')
RETURNING column1 INTO ?; END;
will result in returning column1
's value (supposing there is a trigger assigning a value to it before insert).
Is there a way, if possible at all, to combine both? Meaning, inserting multiple values while still returning all the column1
values (a resultset) with a single query?