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: Create table Employee as........

Re: Create table Employee as........

From: Steve McDaniels <steve.mcdaniels_at_sierra.com>
Date: Thu, 18 Nov 1999 14:58:19 -0800
Message-ID: <8120bc$84g$1@plo.sierra.com>


Try this and then examine the contraints on the new table:

create table employee as
select * from emp
WHERE 1=2; obviously, this will not return any data, but it will create the table as if it did return data.

viagraboy <viagraboy_at_viagraboy.com> wrote in message news:38342dee.159154061_at_news.supernews.com...
> I use this script to create a table:
>
> create table employee as
> select * from emp
>
> 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
>
> 8 rows selected.
Received on Thu Nov 18 1999 - 16:58:19 CST

Original text of this message

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