Subject Re: Getting id of last inserted record
Author hay77772000
Okay....how would I do that?! Never created stored procedure
before! Also, would I have to use that in the insert statement?
With triggers, the programmer never has to worry about whether it's
autoincrement or not.

Thanks very much,

David


--- In ib-support@yahoogroups.com, "Robert DiFalco" <rdifalco@t...>
wrote:
> What about using a stored procedure instead of a trigger? The
stored
> procedure could return the generated value that was used to set the
> identity column.
>
> -----Original Message-----
> From: hay77772000 [mailto:david.hay@e...]
> Sent: Monday, April 28, 2003 1:22 PM
> To: ib-support@yahoogroups.com
> Subject: [ib-support] Getting id of last inserted record
>
>
> Hi. Am still continuing to port our system from mySQL to
> Firebird.
>
> Have set up the database correctly, along with generators
and
> triggers that simulate an autoincrement field.
>
> However, I still need a way to get the id back of the record
> just
> inserted, in a distributed, multiple-user environment.
>
> Can anyone let me know how to do so, please? I understand I
> could
> use SELECT GEN_ID(GEN_ATABLE, 0) FROM RDB$DATABASE; but that
> this
> cannot be relied on with other transactions etc..
>
> Thanks,
>
> David
>
>
>
>
>
> Yahoo! Groups Sponsor
>
>
<http://rd.yahoo.com/M=229633.3212141.4526654.2595810/D=egroupweb/S=1
705
> 115386:HM/A=1556779/R=0/*http://shop.store.yahoo.com/cgi-bin/clink?
ftd2+
>
shopping:dmad/M=229633.3212141.4526654.2595810/D=egroupweb/S=17051153
86:
>
HM/A=1556779/R=1/1051561355+http://us.rmi.yahoo.com/rmi/http://www.ft
d.c
> om/rmi-framed-url/http://www.ftd.com/yahoo36>
>
> <http://us.adserver.yahoo.com/l?
M=229633.3212141.4526654.2595810/D=egrou
> pmail/S=:HM/A=1556779/rand=309980560>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/> .
>
>
>
>
> [Non-text portions of this message have been removed]