This is a discussion on stored procedures in mysql 5 within the MySQL forums, part of the Database Server Software category; --> HI all I am having trouble creating a stored procedure in Mysql 5. I have even tried the simple ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| HI all I am having trouble creating a stored procedure in Mysql 5. I have even tried the simple examples from the Mysql manual. I am using Mysql 5.0.18-log and phpMyAdmin 2.7.0-pl2. I have even tried it through the console. Here is my statements and sp - mysql> delimiter | mysql> CREATE PROCEDURE GetVerify (IN VarUserId INT, IN VarCallCentreId INT, OUT VarServiceId INT) BEGIN SELECT sa.ServiceApplicationId INTO VarServiceId FROM ServiceApplication AS sa JOIN UserQueue AS uqu ON uqu.StatusId = sa.ServiceApplicationId AND uqu.UserId = VarUserId JOIN UserMaster AS um ON um.UserId = sa.UserId AND um.CallCentreId = VarCallCentreId WHERE sa.StatusId = 62015; IF VarServiceId IS NULL SELECT sa.ServiceApplicationId INTO VarServiceId FROM ServiceApplication sa JOIN UserMaster um ON um.UserId = sa.UserId AND um.CallCentreId = VarCallCentreId WHERE sa.StatusId = 62014; END IF; END| mysql> delimeter ; Unfortunately, it produces the following error - #1064 - 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 'SELECT sa.ServiceApplicationId INTO VarServiceId FROM ServiceApplication AS s' at line 5 Any help with this will be greatly appreciated. Cheers for now. B Pietersen. |