SL23
Programmer
- Nov 3, 2005
- 12
I want to create 1000 tables using one script. Sam set of tables but the table name and the pk should be incremented, Is there a way to do this in teradata...
CREATE SET TABLE s.at1
(
student_number INTEGER NOT NULL,
f_name VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
lt_name VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
dpt VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
stdnt_ln_amount DECIMAL(10,2),
expd_grad DATE FORMAT 'yyyy-mm-dd' NOT NULL)
PRIMARY INDEX PK_student1 ( student_number );
REATE SET TABLE s.at2
(
student_number INTEGER NOT NULL,
f_name VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
lt_name VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
dpt VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
stdnt_ln_amount DECIMAL(10,2),
expd_grad DATE FORMAT 'yyyy-mm-dd' NOT NULL)
PRIMARY INDEX PK_student2 ( student_number );
.....
CREATE SET TABLE s.at1
(
student_number INTEGER NOT NULL,
f_name VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
lt_name VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
dpt VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
stdnt_ln_amount DECIMAL(10,2),
expd_grad DATE FORMAT 'yyyy-mm-dd' NOT NULL)
PRIMARY INDEX PK_student1 ( student_number );
REATE SET TABLE s.at2
(
student_number INTEGER NOT NULL,
f_name VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
lt_name VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
dpt VARCHAR(30) CHARACTER SET LATIN NOT CASESPECIFIC,
stdnt_ln_amount DECIMAL(10,2),
expd_grad DATE FORMAT 'yyyy-mm-dd' NOT NULL)
PRIMARY INDEX PK_student2 ( student_number );
.....