On Sun, 13 Mar 2005 02:59 pm, Bruno Wolff III wrote: > On Sat, Mar 12, 2005 at 23:05:41 +0200, > Andrus Moor <[EMAIL PROTECTED]> wrote: > > I have table containing different types of documents (type A, B and C). > > > > Each document type must have separate sequential ID starting at 1 > > > > ID of first inserted record of type A must be set to 1 > > ID of first inserted record of type B must be also set to 1 > > ID of second record of type A must be set to 2 > > etc. > If you are happy with the fact that a sequence may leave a whole in the numbers. You are probably best to no set a default value for an integer, or big integer. Then run a before trigger for each row. That trigger will assign a value to the column based on the value given for the type.
Regards Russell Smith ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly