I followed the steps in the Internet, but it failed.
1.create a table
CREATE TABLE `proctest` (
`id` int ( 11 ) NOT NULL auto_increment,
`Name` varchar ( 20 ) default '''''' ,
`age` int ( 11 ) default NULL ,
`address` varchar ( 50 ) default '' ,
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = gb2312;
2.insert something into it.
INSERT INTO `proctest` VALUES ( 1 , ' tom ' , 22 , '
http://www.blogjava.net ' );
INSERT INTO `proctest` VALUES ( 2 , ' wujun ' , 25 , '
http://www.blogjava.net/wujun ' );
INSERT INTO `proctest` VALUES ( 3 , ' jerry ' , 30 , ' shenzhen ' );
INSERT INTO `proctest` VALUES ( 4 , ' wujun ' , 40 , ' nanchang ' );
3.create PROCEDURE
create PROCEDURE testProc()
begin
select * from proctest;
end ;
but some problem occured...
mysql> create PROCEDURE testProc()
-> begin
-> select * from proctest;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '' at
line 3
T_T
Can you tell me what the problem is, please?