MySQL Forums
Forum List  »  Triggers

Re: TRIGGER BEFORE INSERT - ALTER ADD column form insert value
Posted by: Mihai Grososiu
Date: May 29, 2008 12:50AM

Thanks for inspiration, finaly I did it with a procedure:

PROCEDURE `pr_new_type`( IN column_name varchar(10) )
BEGIN
SET @queryText = CONCAT('ALTER TABLE `user_rights` ADD ', column_name, ' BINARY( 9 ) NULL');
PREPARE query FROM @queryText;
EXECUTE query;
DEALLOCATE PREPARE query;
END

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: TRIGGER BEFORE INSERT - ALTER ADD column form insert value
2909
May 29, 2008 12:50AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.