Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: A simple question, I hope
Thanks, Reidel, but I guess I didn't specify my question well enough. I already have a sequence, and I already have a trigger that puts the next sequence value into the row.
The problem is, at the point I insert the row, I need to know the new ID. I need that value returned to the Java program that performed the insert. And it's a high-transaction, high-activity system, so I can't do this:
I've messed around with a PL/SQL function or procedure, but I was hoping someone had done something like this already.
Thanks,
Darryl
"Reidel Jogie" <reidel_at_usa.net> wrote in message
news:iIgU6.64451$G5.14064108_at_news1.rdc1.md.home.com...
> Have a look a SEQUENCES. You can select the next value of a sequence into
> the ID field in a BEFORE INSERT ROW trigger.
>
> In article <vO%T6.1896$c37.193703_at_newsread1.prod.itd.earthlink.net>,
> "Darryl" <dfs_at_nospam.com> wrote:
>
> > How do I get the trigger-generated ID number for the row I just added to
> > a table? I can't do a SELECT MAX(ID) because it's a high transaction
> > system.
> >
> > Thanks,
> > Darryl
> >
> >
>
Received on Sat Jun 09 2001 - 17:10:37 CDT
![]() |
![]() |