If we want to test a procedure involving calculations and updating data we are creating a duplicate file as
Create table xxx
as select * from tablename.
If any thing goes wrong we are droping the existing table and then renaming xxx as actual table.
But here the problem is while creating table xxx it is not copying base table constriants, triggers and indexes. How to copy a table along with its constraints , triggers and indexes?