Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Constraints question

Re: Constraints question

From: Mark A. Framness <mframness_at_NOSPAM.lakefield.net>
Date: 23 Dec 1999 00:37:20 GMT
Message-ID: <8Sd1uPikEGru-pn2-R16dsdrV8HUo@www.framnett.net>


On Wed, 22 Dec 1999 20:59:29, Thomas Kyte <tkyte_at_us.oracle.com> wrote:

> A copy of this was sent to Mark Framness <framnesso_at_my-deja.com>
> (if that email address didn't require changing)
> On Wed, 22 Dec 1999 20:01:03 GMT, you wrote:
>
> >Greetings All
> >
> >I am preparing for the SQL-PL/SQL OCP exam. One of the practice exams I
> >have been working with has a question that I get right, but I don't know
> >why it is right.
> >
> >The customer table is an existing table.
> >CREATE TABLE sale
> >(purchose_no NUMBER(9),
> > customer_no NUMBER(9),
> > CONSTRAINT sale_customer_id_fk REFERENCES customer(id),
> > CONSTRAINT sale_purchase_no_pk PRIMARY KEY (purchase_no),
> > CONSTRAINT sale_customer_no_nn NOT NULL (customer_no));
> >
> >The question is which line causes an error?
> >
>
> line 4 (and when you fix that, line 6)

Line 4 must be a typo. Because the exam clearly marks line 6 as the one in error.

Anyway is it permitted to declare NOT NULL constraints like that? What is the problem if it is.

I went in and changed it all so the NOT NULL constraint was defined on the line of the not null column and then it worked. Is that the problem? One would think that this would be mentioned in the OCP Prep book.

From: Mark A. Framness
http://netnet.net/~farmer/
mframness_at_lakefield.net

Go Pack Go!
Oh balsam tree oh balsam tree I see you when I deer hunt! Brian Framness Received on Wed Dec 22 1999 - 18:37:20 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US