LastInsertId and Oracle

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tobias_cd
Posts: 56
Joined: Thu 18 Dec 2008 22:10

LastInsertId and Oracle

Post by tobias_cd » Tue 07 Apr 2009 10:55

Hello Plash et al,

I'd like to kindly ask for details about the following problem we ran into:
When is the LastInsertID correctly returned (especially for Oracle 10 and MS SQL 2005+) for TUniQuery components? Specifically, what UDac properties/settings might prevent it to be returned?
Is it only supposed to be returned for explicit INSERT statements and not after "UniQuery.Post" maybe?

We use both TUniQueries with single table selects as well as multiple table join selects, set the "UpdatingTable" property as well (CachedUpdates disabled). But often after Post'ing a row, both the key field of the new row as well as the "LastInsertId" are null. Do we manually need to call Refresh or Resync?

It'd be really great, if you could eloborate on this issue in detail. The help file (12/2008) does not provide enough details, unfortunately.

Thank you in advance,
Tobias

tobias_cd
Posts: 56
Joined: Thu 18 Dec 2008 22:10

Post by tobias_cd » Tue 07 Apr 2009 20:09

I'm sorry, I just read about LastInsertId being supported only for MySQL etc.

Anyway, the question remains about empty keyfields after "Post".
Maybe the "SpecificOptions.SequenceMode" and ".KeySequence" (if available) are to be used?

Thanks for any insight.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 08 Apr 2009 08:02

You can use the DMLRefresh property or the SequenceMode and KeySequence specific options.

Post Reply