Board index » delphi » Getting primary key generated by trigger.

Getting primary key generated by trigger.

Hi,
    Can anyone tell or point my in the right direction on how i would obtain
the primary key field that is generated when i insert another record.  I
need to know the one it creates so that i can link another table to it using
this.

Thanks for any pointers.

 

Re:Getting primary key generated by trigger.


Use the GeneratorField property of your TIBQuery or TIBDataSet component to
fill in the new generator value into your key field, after inserting a new
record in your masterdataset you just have to read it (MyKeyField.Value).
You have to set Apply Event to 'On New Record' (default) when configuring
the GeneratorField property of course.

Quote
Alan wrote in message <3ac6dc28$1_2@dnews>...
>Hi,
>    Can anyone tell or point my in the right direction on how i would
obtain
>the primary key field that is generated when i insert another record.  I
>need to know the one it creates so that i can link another table to it
using
>this.

>Thanks for any pointers.

Other Threads