Derek Lavine wrote:
> Is there any way I can prevent rows being inserted when they have
> certain columns specified as empty strings
> for example I know I can prevent rows being inserted where no value has
> been specified
> CREATE TABLE job
> ( job_number char(5) Default '00000' NOT NULL
> , client char(40) NOT NULL
> , Primary Key (job_number)
> , Unique id (job_number)
> insert into job values ( '00001'');
> but still allows
> insert into job values ( '00001', '');
> is there anyway to force the client field to have to containe values.
> Also is there anyway to ensure that job_number contains no spaces. Or
> more specificly can I ensure that it only contains 0..9 and a-z or A-Z
> Of course I realise I can do this at the application level but I was
> hoping I could add these restrictions to the database schema.
> Thanks for any suggestions
You can't do this through the database schema.