RE: [firebird-support] Optional FK constraint on 0 (not NULL)

2018-03-29 Thread venussof...@gmail.com [firebird-support]
Thanks András. I see it now, the constraint is on the field that mirrors the non zero values and has NULL instead of zeros, yet I can still use my present field the way it always works in the software, that's great Kind regards Bhavbhuti

RE: [firebird-support] Optional FK constraint on 0 (not NULL)

2018-03-28 Thread Omacht András aoma...@mve.hu [firebird-support]
To: firebird-support@yahoogroups.com Subject: RE: [firebird-support] Optional FK constraint on 0 (not NULL) Hi Bhavbhuti, I can suggest you only a workaround…. 1. your current field name is: MASTER_ID 2. add a new field, e.g.: MASTER_ID_FK 3. create a before insert and update trigger which fill up

RE: [firebird-support] Optional FK constraint on 0 (not NULL)

2018-03-28 Thread Omacht András aoma...@mve.hu [firebird-support]
Hi Bhavbhuti, I can suggest you only a workaround…. 1. your current field name is: MASTER_ID 2. add a new field, e.g.: MASTER_ID_FK 3. create a before insert and update trigger which fill up this field like this: new.master_id_fk = nullif(master_id, 0); 4. create the foreign key on