Re: find max id for forms
Date: Tue, 07 Aug 2001 02:34:03 GMT
Message-ID: <vsIb7.39851$MC1.11660011_at_news1.elcjn1.sdca.home.com>
[Quoted] "CupOfWater" <asiandoof_at_hotmail.com> wrote in message
news:e0c9495d.0108060846.33dad8b_at_posting.google.com...
> Hi, I have a form that has a field, mid denoting membership ids. This
> corresponds to an ORACLE table that has mid, name, etc. Instead of
> having the users find the highest mid from the database and enter the
> next highest one, I want the form to automatically find the largest
> mid and add 1 to that number and put the result into the mid field. I
> don't know how to do this, but I think it involves some triggering of
> some sort and PL/SQL, but I don't know which trigger(s) would be
> appropriate. Thanks.
>
> Kevin
Just write a cursor to get it and then populate your form with it.
SELECT max(mid) + 1
from <table>
where <key values>;
Put it in whatever trigger you want to.
-Matt Received on Tue Aug 07 2001 - 04:34:03 CEST