Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: help plz
ayuready wrote:
>Hi all,
>
>
>
>I've just started using Oracle 8 for my uni course and I'm
>currently stuck on a problem which should be very easy to solve but
>I do not know how.
>
>
>
>The problem is I have to create a table where one of the attributes will
>only allow the user to enter a pre-defined data. E.g. for the
>Payment_Type in my Payment table, the user is only allowed to enter
>either cash, credit or direct credit, how do I enforce this?
>
>
>
>Do I have to specify something in the create statements? Plz help.
>
>
>
>Thank u.
>
>
>--
>Posted via http://dbforums.com
>
>
And where were you when your instructor talked about constraints?
There are many different types of constraints the serve a variety of different purposes. Very quickly they are:
Primary Key Constraint .... type P
Referential Constraint (also known as a foreign key) ... type R
Check Constraint ... type C Unique Constraint ... type U ReadOnly on a view ... type O
Your job is to either refresh your memory from your notes, look it up in your textbook, or find the answer at http://tahiti.oracle.com by look up each and every one of these constraint types.
See what happens when the person that responds to your cry for help is an instructor in an Oracle program. ;-)
And please ... don't anyone just hand over the answer. Let the OP have a chance to learn the material.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Wed Sep 10 2003 - 23:29:15 CDT