Best practices: .NET: How to return PK against an oracle database?

前端 未结 3 1267
不知归路
不知归路 2020-12-30 14:42

With SQLServer, it seems to be generally accepted that adding a SELECT SCOPE_IDENTITY() to the end of your insert is the best way to return the PK of the newly-inserted reco

3条回答
  •  误落风尘
    2020-12-30 14:59

    The RETURNING clause is intended for just this kind of usage, so I would call it a best practice to use it.

    An alternative would be to select seq.CURRVAL after the insert. That returns the last value obtained from the sequence by this session.

提交回复
热议问题