Author Topic: problem creating a stored procedure in mysql 5  (Read 274 times)

0 Members and 1 Guest are viewing this topic.

Offline fogofogoTopic starter

  • Irregular
  • Posts: 31
    • View Profile
problem creating a stored procedure in mysql 5
« on: June 15, 2010, 06:54:56 AM »
Hello,

I'm trying to create a stored procedure through phpmyadmin and its giving me an error. Heres my query...

DROP PROCEDURE IF EXISTS `LoginUser`
GO

CREATE PROCEDURE LoginUser(
IN p_Alias varchar(30)

)

BEGIN

SELECT FirstName  FROM users WHERE Alias = p_Alias;

END

GO

Its giving me an error saying ...

check the manual that corresponds to your MySQL server version for the right syntax to use near 'GO

Can anyone see the obvious error I'm making? Sorry I'm new to this.

Cheers




Offline fogofogoTopic starter

  • Irregular
  • Posts: 31
    • View Profile
Re: problem creating a stored procedure in mysql 5
« Reply #1 on: June 15, 2010, 08:51:59 AM »
looks like I messed it up.

This fixed it

CREATE PROCEDURE LoginUsers(IN palias VARCHAR(30), OUT pFirstName VARCHAR(30))
BEGIN
SELECT FirstName INTO pFirstName FROM users WHERE Alias=palias;
END