On Fri, 14 Jun 2002 14:47:32 -0400, Matt
<matthew.berardi@weilpublishing.com> wrote:
>how would you go about enforcing the default value:
>
>I have a nextval('seq') as my default and on an insert I don't want any
>other value to be allowed.
Matt,
CREATE TABLE tab (id INTEGER NOT NULL DEFAULT 0, ...
and add a before insert trigger that *unconditionally* puts
nextval('seq') into new.id. I guess, you don't want to allow your
users to change the id of an existing row, so you might also want to
add a before update trigger that sets new.id to old.id.
ServusManfred