RE: Question about Append hint in Insert

  • From: Jared.Still@xxxxxxxxxxx
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Mon, 21 Jun 2004 11:47:57 -0700

> you can disable the constraint without the need to drop the index;
You may also do that with an index created as part of the primary key
constraint:


11:47:28 SQL>drop table x;

Table dropped.

11:47:28 SQL>
11:47:28 SQL>create table x
11:47:28   2  as
11:47:28   3  select distinct object_name
11:47:28   4  from user_objects
11:47:28   5  /

Table created.

11:47:28 SQL>
11:47:28 SQL>alter table x add constraint x_pk
11:47:28   2  primary key(object_name)
11:47:28   3  /

Table altered.

11:47:28 SQL>
11:47:28 SQL>select index_name , uniqueness, status
11:47:28   2  from user_indexes
11:47:28   3  where table_name = 'X'
11:47:28   4  /

INDEX NAME                     UNIQUENES STATUS
------------------------------ --------- --------
X_PK                           UNIQUE    VALID

1 row selected.

11:47:28 SQL>
11:47:28 SQL>select constraint_name, constraint_type, status
11:47:28   2  from user_constraints
11:47:28   3  where table_name = 'X'
11:47:28   4  /

CONSTRAINT_NAME                C STATUS
------------------------------ - --------
X_PK                           P ENABLED

1 row selected.

11:47:28 SQL>
11:47:28 SQL>alter table x disable primary key keep index;

Table altered.

11:47:28 SQL>
11:47:28 SQL>select index_name , uniqueness, status
11:47:28   2  from user_indexes
11:47:28   3  where table_name = 'X'
11:47:28   4  /

INDEX NAME                     UNIQUENES STATUS
------------------------------ --------- --------
X_PK                           UNIQUE    VALID

1 row selected.

11:47:28 SQL>
11:47:28 SQL>select constraint_name, constraint_type, status
11:47:28   2  from user_constraints
11:47:28   3  where table_name = 'X'
11:47:28   4  /

CONSTRAINT_NAME                C STATUS
------------------------------ - --------
X_PK                           P DISABLED

1 row selected.

11:47:28 SQL>

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: