Myles Penlington wrote:
>
> This must get asked several times ...
>
> If you are using an generator for a primary key (PK) in conjunction with an
> Insert Trigger, is there any way with FIB/IBX/TQuery to get back the
> generated PK
> value?
No that I know of, tho I'll be watching this list for an answer :)
I do it by calling an SP to get the generator value, then inserting as
normal - assuming I care about the generator value (usually, I dont)
> Or do I have to use a Stored procedure to create an new PK value inside the
> same transaction and then use that in the SQL insert statement?
Doesn't have to be in the same transaction, AFAIK.
> Are there any other methods of doing this?
>
> I was just looking for a way to do this without doing 2 SQL statements back
> to the server (ie the SQL select for the stored procedure/generator and the
> SQL
> Insert).
you could write one SP that does it all, and has a return value of the
generator value....? may be over kill tho.
Nic.
--
Nic Wise - Inprise New Zealand / Brocker Technologies Web Monkey.
mob:+64.21.676.418 - wk:+64.9.481.9999 x9753 - wk-em:[EMAIL PROTECTED]
hm: +64.9.277.5309 - hm-em:[EMAIL PROTECTED]
---------------------------------------------------------------------------
New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz