Bug #7913 | suggestion: allow flow control logic in batch sql | ||
---|---|---|---|
Submitted: | 14 Jan 2005 17:10 | Modified: | 29 Sep 2007 11:20 |
Reporter: | Matthew Murphy | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | MySQL Server: MyISAM storage engine | Severity: | S4 (Feature request) |
Version: | 4.1x and below | OS: | Linux (Linux) |
Assigned to: | CPU Architecture: | Any |
[14 Jan 2005 17:10]
Matthew Murphy
[29 Sep 2007 11:20]
Valeriy Kravchuk
Sorry, but features like this will surely not be implemented in versions 4.x.y.
[6 Aug 2009 13:30]
Jordi Baylina
You can do it this way: select @cond:=1; select @t1:=if(@cond=1,' CREATE TABLE example ( `Field1` int(11) NOT NULL, `Field2` varchar(32) collate latin1_spanish_ci default NULL, `Field3` int(11) default NULL, PRIMARY KEY (`Field1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci ','select 1'); prepare stmt from @t1; execute stmt; drop prepare stmt;