Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Primary Key Exceptions ??
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 FINLANDReceived on Sun Mar 08 1998 - 00:00:00 CST