Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Check Constraints
"Joshua" <a.j.van.rooijen_at_bluevision.nl> wrote in message news:<R0kl8.396807$hy4.16398396_at_Flipper>...
> you can do that by making database triggers update and/or insert and put the
> validation code in these.
>
>
> "casper44" <dkniveton71_at_msn.com> wrote in message
> news:be3be537.0203170526.a793d85_at_posting.google.com...
> > How do I check to make sure a attribute of type VARCHAR2 is greater
> > than 2 characters? For example if I create a table and the attribute
> > is:
> >
> > organization VARCHAR2(50) NOT NULL,
> >
> > and I also want it to always be greater than 2 characters.
> >
> > Thanks.
Isn't there an easier way to do this like if I want to check for a
number greater than 3 I could do:
CHECK constraint (organization > 3);
or if I wanted to check to ensure users put a @ in a field called
email I could say:
email VARCHAR2(20),
CONSTRAINT email_check
CHECK (email LIKE ('%@%');
Thanks. Received on Mon Mar 18 2002 - 17:20:22 CST