I have DB(in MySQL) that looks like:
CREATE TABLE tbl1(... ,title VARCHAR(69) DEFAULT("new title"), ...);
CREATE TABLE tbl3(... ,title VARCHAR(69) DEFAULT("new title"), ...);
CREATE TABLE tbl3(... ,title VARCHAR(69) DEFAULT("new title"), ...);
The question is: Is there any way how to don’t repeat the values(66,”new title”) many times ?
Thanks !
I already have tried 2 solutions, but they doesn’t works.
1-
SET @title_len=69,@title_def="new title";
CREATE TABLE tbl1(... ,title VARCHAR(@title_len) DEFAULT(@title_def), ...);
2-
CREATE TYPE TitleType FROM VARCHAR(69) DEFAULT("new title");
CREATE TABLE tbl1(... ,title TitleType, ...);
Create first table, e.g. –
Then use CREATE TABLE statement with LIKE option to duplicate table structure –