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: Primary Key Exceptions ??

Re: Primary Key Exceptions ??

From: Kirmo Uusitalo <kirmo.uusitalo.NO.SPAM_at_iki.fi>
Date: 1998/03/08
Message-ID: <35035ad1.1239201@192.1.1.13>#1/1

On 7 Mar 1998 18:18:44 GMT, Joe R Jurgena <jjurgena_at_shell.clark.net> wrote:

>How do you set up and use Constraint Exceptions?
 ...
>create table tst (
> id varchar2(10),
> CONSTRAINT pk_tst_id PRIMARY KEY (id)
> EXCEPTIONS INTO tst_exc);
>
> *
>ERROR at line 4:
>ORA-00922: missing or invalid option

 ...
>(What is wrong? The documentation is a little sparse on
>this subject, though it seems like a rather straight forward
>option)

As far as I know, the exceptions into clause is meant for situations when you add a constraint to an existing table, such as:

alter table tst add constraint pk_tst_id PRIMARY KEY (id)

                EXCEPTIONS INTO tst_exc);

If there were rows with duplicate id's in the tst table at the time the above statement was given, they would be moved into tst_exc.

Afterwards the exceptions table won't be populated by the PK constraint.

HTH,

Kirmo.Uusitalo_at_iki.fi                   Key Technologies Oy 
System Analyst                          Uotinmaenkuja 9
tel. +358-9-323451,+358-500-439125      00970  HELSINKI
fax         324031                      FINLAND
Received on Sun Mar 08 1998 - 00:00:00 CST

Original text of this message

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