justify-content: ...;
justify-items: ...;
align-items: ...;
align-content: ...;
DELIMITER $$
DROP PROCEDURE IF EXISTS addColumnToTable $$
CREATE PROCEDURE addColumnToTable(IN tbl_name VARCHAR(20), IN col_name VARCHAR(20))
BEGIN
DECLARE s VARCHAR(100);
SET s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = tbl_name
AND table_schema = DATABASE()
AND column_name = col_name
) > 0,
"SELECT 1",
CONCAT("ALTER TABLE ",tbl_name," ADD ",col_name," VARCHAR(100)")
));
PREPARE stmt FROM s;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END $$
DELIMITER ;
CALL addColumnToTable('tbl','bonus');
CALL addColumnToTable('tbl','bonus2');
CALL addColumnToTable('tbl','bonus3');
DELIMITER $$
DROP PROCEDURE IF EXISTS addColumnToTable $$
CREATE PROCEDURE addColumnToTable(IN tbl_name VARCHAR(20), IN col_name VARCHAR(20))
BEGIN
IF
NOT EXISTS( (SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=DATABASE()
AND TABLE_NAME = tbl_name AND COLUMN_NAME = col_name ) )
THEN
ALTER TABLE tbl_name ADD col_name varchar(24) NOT NULL DEFAULT '';
END IF;
END $$
DELIMITER ;
-- --------------------- Procedure End
CALL addColumnToTable('tbl','bonus');
CALL addColumnToTable('tbl','bonus2');
CALL addColumnToTable('tbl','bonus3');
DELIMITER $$
DROP PROCEDURE IF EXISTS addColumnToTable $$
CREATE PROCEDURE addColumnToTable(IN tbl_name VARCHAR(20), IN col_name VARCHAR(20))
BEGIN
IF
NOT EXISTS( (SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=DATABASE()
AND TABLE_NAME = tbl_name AND COLUMN_NAME = col_name ) )
THEN
ALTER TABLE tbl_name ADD col_name varchar(24) NOT NULL DEFAULT '';
END IF;
END $$
DELIMITER ;
-- --------------------- Procedure End
CALL addColumnToTable('tbl','bonus');
CALL addColumnToTable('tbl','bonus2');
CALL addColumnToTable('tbl','bonus3');