Larry, Your suggestion of using sequence.currval works great. I just left the ID column off of the insert statement. I assume there is some risk of getting the wrong ID during simultaneous updates. I'll get triggers turned off as soon as we cut over to the new application and go back to pre-generated keys with sequence.nextval.
Thanks. Steve -----Original Message----- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Monday, June 27, 2005 2:51 PM To: [email protected] Subject: Re: Post Generated Keys Use sequence.currval instead. On 6/27/05, Mitchell, Steven C <[EMAIL PROTECTED]> wrote: > > I'm converting an Oracle application to iBatis. I discovered that the > database is using triggers to generate ids (I was using > sequence.nextval and my ids were off by one). The documentation says > iBatis supports both pre and post generated keys. Is that true for > Oracle too? The post-generated example is for SQL Server @@IDENTITY. > I would have the DBAs turn off the triggers, but I have to run in > parallel for some time. Am I stuck doing a select on some other key > immediately following the insert to find out the generated ID?
