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 -> QUES: Constraints copied from one table to another.

QUES: Constraints copied from one table to another.

From: Ataxia <viagraboy_at_viagraboy.com>
Date: Mon, 22 Nov 1999 17:53:59 GMT
Message-ID: <38398219.260525816@news.supernews.com>


I use this script to create a table:

create table employee as
select * from emp
If I use this script

Create Table Employee
as select * from emp;

Which constraints will be copied to the new table???

If the Emp has these constraints on it:

C: Check constraint; includes Not Nulls
P: Primary Key
R: Foreign Key
U: Unique
V: With Check Option constraint (for views)

Which of these constraints will be on the new Employee table?

I ran this script on the emp table before I created the new table.

SQL> select constraint_name, constraint_type   2 from user_constraints
  3 where table_name = 'EMP';

CONSTRAINT_NAME                        C
------------------------------                                -
S_EMP_MANAGER_ID_FK                  R
S_EMP_DEPT_ID_FK                           R
S_EMP_TITLE_FK                                R
S_EMP_ID_NN                                     C
S_EMP_LAST_NAME_NN                   C
S_EMP_ID_PK                                     P
S_EMP_USERID_UK                          U
S_EMP_COMMISSION_PCT_CK        C
Received on Mon Nov 22 1999 - 11:53:59 CST

Original text of this message

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