Hi Why don't you use a stored procedure for this? For FB2.X in doc section in README.returning.txt you can find this: INSERT INTO T2 (F1, F2) VALUES (1, 2) RETURNING ID INTO :PK;
This return desired value, that you can insert in second table! Regard's Paul > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Jose Perez > Sent: Thursday, December 13, 2007 1:38 PM > To: firebird list > Subject: [Firebird-net-provider] Easy way to know the idkey of a > registry just inserted? > > Well. I have an insertion on a table like this: > > idtrabajo --- integer autoincremet primary key > trabajo -- varchar > contratista -- varchar > idgestion -- integer > > I do the insertion with a FbCommand and ExecuteNonQuery. > But now I want to know the "idtrabajo" for the inserted element, cause > I > need it to pass it to another form. I need to pass it to another form > cause I have another table that uses this "idtrabajo" as a foreign key, > and I need it to make the insertions on that other table. Is there an > easy way to do it other than do a select query after the insert?? > > Thanks! > > ----------------------------------------------------------------------- > -- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/market > place > _______________________________________________ > Firebird-net-provider mailing list > Firebird-net-provider@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider