I would like to see the Merge clause support Returning as is the case in native Insert/Update/Delete's.
For example
Merge Into xxTmp1
Using (Select Null, 'Test' val From dual) n
On (xxTmp1.id = newrow.id)
When Matched Then Update Set (val=n.val)
Delete Where (pDeleteFlag='Y')
When Not Matched Then Insert (id, val) Values (xxTmp_Seq.NextVal, n.val)
Returning id Into pID;
Duplicate of: Support returning clause in 'merge' and 'insert as select'?