Home » SQL & PL/SQL » SQL & PL/SQL » creating a new table from another table (Oracle 10g)
creating a new table from another table [message #440380] Sat, 23 January 2010 01:29 Go to next message
ram anand
Messages: 244
Registered: February 2008
Location: india
Senior Member
Hi all,

I am creating a new table test1 from the table test as below

create table test1 as select * from test;


Here the table is created and all the records have populated.
but the constraints and the primary key aren't created ,normally using above query it creates only NOT NULL columns in the table from one table to another table

My question:-
Is there is possible to create table using the above condition and also need to create all other objects like referential,primary keys etc...

Thanks in advance..
Re: creating a new table from another table [message #440381 is a reply to message #440380] Sat, 23 January 2010 02:00 Go to previous message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
There is no sungle intruction to do it.
You can get the constraints using DBMS_METADATA.

Regards
Michel
Previous Topic: Query Re-structure
Next Topic: BULK UPDATE examples
Goto Forum:
  


Current Time: Tue Sep 27 04:15:24 CDT 2016

Total time taken to generate the page: 0.13147 seconds