Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Store procedure to createa new table with existing table structure

deekayAug 19 2010 — edited Aug 19 2010
Hi All,


THis is what I want to achieve,

I want to create procedure which will take a input parameter as name of a table lets say 'EMP',
and this procedure will check whether that table exist or not?
if exist then
it will create a new table with name appending _dummy to existing table name (ex: new table will be EMP_DUMMY) ,
and new table should have the same table structure ,index and constraint imposed on EMP table.


NB: It should not be created using as select like create table EMP_DUMMY as select * from EMP where condition=false;



Can any one please help me how to achieve this?






Thanks,
Deekay

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 16 2010
Added on Aug 19 2010
3 comments
705 views