I want to clone a table in DB2 . My requirement is to create the new table using base table and In the new table I need same number of columns and I don’t need the data of old table.please help me how to achieve this.
Thanks in Advance ,
Raj
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In DB2, you can use this syntax:
This will create a table of the same type as the original table. I doubt that indexes/keys are copied, too, though.
Here’s some documentation on that topic