Is there an Oracle equivalent to SQL Server's OUTPUT INSERTED.*?

后端 未结 2 1148
暖寄归人
暖寄归人 2020-12-03 21:31

In SQL Server, you can do things like this:

INSERT INTO some_table (...) OUTPUT INSERTED.*
VALUES (...)

So that you can insert arbitrary se

2条回答
  •  眼角桃花
    2020-12-03 21:42

    Maybe I don't understand the question, but wouldn't this do it? (you must know what you want back)

    INSERT INTO some_table (...)
    VALUES (...)
    RETURNING some_column_a, some_column_b, some_column_c,  ...  INTO :out_a, :out_b, :out_c, ...
    

    @Vincent returning bulk collect into for multi-row insert works only in conjunction with forall (in another words if you insert from collection you can retrieve "results" into another)

提交回复
热议问题