Copy Table [message #287966] |
Fri, 14 December 2007 02:48  |
sunidhi
Messages: 36 Registered: January 2006 Location: New Delhi
|
Member |
|
|
Dear all,
New to Oracle, need your support !
I want to copy two tables having master-detail relationship.Both the tables having one Long data type field.
While copynig I want to maintain masre-detail relatioship to copied tables as well.
Thnks & Regards,
Sunidhi
|
|
|
|
|
|
Re: Copy Table [message #287979 is a reply to message #287970] |
Fri, 14 December 2007 03:35   |
sunidhi
Messages: 36 Registered: January 2006 Location: New Delhi
|
Member |
|
|
Hello Michel,
Thhanks for your reply.
I want to copy tables in same schema and to maintain Integrity Constaints as well.Both the tables having Long type field as well.
Thanks & Regards,
Sunidhi
|
|
|
|
Re: Copy Table [message #287995 is a reply to message #287982] |
Fri, 14 December 2007 04:48   |
sunidhi
Messages: 36 Registered: January 2006 Location: New Delhi
|
Member |
|
|
Dear Michel,
I want to copy them with different name in same schema but have to maintain same integrity Constraints.
Kindly give me syntax for that.
Thanks
|
|
|
|
Re: Copy Table [message #289492 is a reply to message #287999] |
Sat, 22 December 2007 09:13   |
0551373
Messages: 6 Registered: December 2007
|
Junior Member |
|
|
Try Select * into newtable from source. this will allow you to copy the Schema with the data, you can use the truncate to delete all the data if you need to.
|
|
|
|
|
Re: Copy Table [message #289876 is a reply to message #289498] |
Wed, 26 December 2007 06:26   |
ora_zhp
Messages: 10 Registered: September 2007
|
Junior Member |
|
|
if you want to copy them with different name in same schema but have to maintain same integrity Constraints,you can only first copy table,after recreate Constraints!!!
|
|
|
Re: Copy Table [message #289893 is a reply to message #289494] |
Wed, 26 December 2007 07:45  |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
0551373 wrote on Sat, 22 December 2007 10:26 | I forgot, There is another way you can do this and that is with the following syntax create table newtable as (Select * from tablesource); this will avoid the error ORA-905.
hope this will help.
|
In addition to Michel's post, this will also not work for LONG datatypes.
|
|
|