databaseconstraints

hedgehog

New Member
Hi,

I'm trying to add some constraints to my databasefield, but except for the primary key they always fail.

I've tried to create a NOTNULL constraint by checking the mandatory option, but that didn't work, so i tried to do so with validation rules like name != "" and name != null but that didn't work either.

The foreign key i tried to realise with validation rules like id exists in (select id from clients) but that also didn't work.

Can someone help me with this? or is the only possibillity to check the values in the program itself?

Thx
 

cecsno

Member
hedgehog said:
Hi,

I'm trying to add some constraints to my databasefield, but except for the primary key they always fail.

I've tried to create a NOTNULL constraint by checking the mandatory option, but that didn't work, so i tried to do so with validation rules like name != "" and name != null but that didn't work either.

The foreign key i tried to realise with validation rules like id exists in (select id from clients) but that also didn't work.

Can someone help me with this? or is the only possibillity to check the values in the program itself?

Thx
Why didn't the mandatory flag work? Already had a blank field? Are you using Progress, if so why are you writing SQL?
 

hedgehog

New Member
I don't know why the mandatory flag won't work, i'm using a brand new database so there are no blank fields yet.

I'm using SQL because I thought it would work because insert, delete, ... all work. Should i do it some other way to make it work?

thx for your reply
 

cecsno

Member
hedgehog said:
I don't know why the mandatory flag won't work, i'm using a brand new database so there are no blank fields yet.

I'm using SQL because I thought it would work because insert, delete, ... all work. Should i do it some other way to make it work?

thx for your reply
Need some more info on you environment. Is the mandatory flag inaccessable.
The validation you are trying to do should be something like "can-find(sample1-table where sample1-key = sample2-key)" or "can-find(dbk_mstr where dbk_book = abd_book and dbk_entity = ast_entity)" with an appropriate validation message.
 
Top