Thread: Selective sequence..

Selective sequence..

From
"Timo Tuomi"
Date:
Hello Gurus,

I would like to have a table 'members' with columns 'memberid' and
'member_role' implemented so that when I add a member it automatically
inserts a nextval('memberid') into the memberid field ONLY if
member_role='a_particular_role' otherwise 0.

I have a strong feeling that it's not too complicated at all, but I could
use a hint.

Thanks,
Timo


Re: Selective sequence..

From
Vijay Deval
Date:
Hi Timo

will it work if you select maxval+1 of memberid column for certain
condition, otherwise 0?

Vijay

Timo Tuomi wrote:

> when I add a member it automatically
> inserts a nextval('memberid') into the memberid field ONLY if
> member_role='a_particular_role' otherwise 0.