I want to copy structure of a SET table to a New table as MULTISET. Is there any way we can do this?

UDA
Teradata Employee

I want to copy structure of a SET table to a New table as MULTISET. Is there any way we can do this?

I want to copy structure of a SET table to a New table as MULTISET. Is there any way we can do this? 

Tags (3)
2 REPLIES
bwb
Teradata Employee

Re: I want to copy structure of a SET table to a New table as MULTISET. Is there any way we can do this?

Sure. Simply use:

CREATE MULTISET TABLE <new-multiset-table> AS <existing-set-table>;

If the existing table has any UNIQUE indexes (or other UNIQUE constraints), you'll probably want to override them.

For more information, see:

  • Chapter 5 (CREATE TABLE) of SQL Data Definition Language - Syntax and Examples (B035-1144) for the basic syntactic information, and
  • The CREATE TABLE (AS Clause) section of chapter 5 (CREATE TABLE) of SQL Data Definition Language - Detailed Topics (B035-1184) for about 15 pages of more comprehensive information.

Re: I want to copy structure of a SET table to a New table as MULTISET. Is there any way we can do this?

Go to the DDL of the SET table using SHOW command, copy that whole statement, replace SET with MULTISET with a new table name.