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

Primary Key Exceptions ??

From: Joe R Jurgena <jjurgena_at_shell.clark.net>
Date: 1998/03/07
Message-ID: <6ds324$dph$1@clarknet.clark.net>#1/1

How do you set up and use Constraint Exceptions?

create table tst_exc (

        id varchar2(10));

table created

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

(I don't understand why this does not work.)
(So I created the table then added the PK Constraint)

SQL>create table tst (id varchar2(10));

Table created.

SQL>alter table tst
  2 add constraint pk_tst_id PRIMARY KEY (id)   3 exceptions into tst_exc;

Table altered.

(odd, there is no complaint??)

SQL>insert into tst values('apple');

1 row created.

SQL>insert into tst values('apple');
insert into tst values('apple')

            *
ERROR at line 1:
ORA-00001: unique constraint (OPS$JJURGENA.PK_TST_ID) violated

data:SQL>select * from tst_exc;

no rows selected

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

Thanks
Joe
Oracle Release 703020200 Received on Sat Mar 07 1998 - 00:00:00 CST

Original text of this message

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