Board index » delphi » Interbase Autoincrement field

Interbase Autoincrement field

In a paradox table a can asign a field to autoincrement. How can I create
something in Interbase together with Delphi so I also have a Autoincrement
field??

W. v/.d Kruijs

 

Re:Interbase Autoincrement field


Use a combination of generator and trigger. The generator gives you the next
number, the trigger is (roughly) the equivalent of OnNewRecord in TTable.

CREATE GENERATOR MYGEN

CREATE TRIGGER NEWELEMENT FOR MYTABLE
BEFORE INSERT
   POSITION 0
AS BEGIN
  NEW.KEYFIELD = GEN_ID(MYGEN, 1);
END

Robert

Wim van de Kruijs <w...@wkruijs.myweb.nl> wrote in message
news:92dc1d$2gj$1@cyan.nl.gxn.net...

Quote
> In a paradox table a can asign a field to autoincrement. How can I create
> something in Interbase together with Delphi so I also have a Autoincrement
> field??

> W. v/.d Kruijs

Other Threads