Re: Automatic creation of PK with Triggers ...
Posted in 1998
Art S. Kagel — — source: Informix-list mailing list archive (1991-1998)
Oliver Schmitt wrote: > > My Problem : > > I want to create the primary keys of my tables automaticaly. > > I want to create them by a trigger (before insert). But it doesn't work > ... > > Is there another method to create the PK's automaticaly ?? If you can use a sequential integer as the primary key you can take advantage of Informix's SERIAL data type. There can be one column in any table of type SERIAL. If you insert a zero (0) into the serial field Informix will assign the next sequential, unused, serial value to the new row. The assigned value is returned in the sqlca structure after the INSERT succeeds and is also available via the DBINFO function.