Need help creating stored procedure
Posted: Fri 11 Aug 2006 14:10
Hi, I'm using VStudio 2005 and I believe the latest .Net provider from coreLab. But, I'm new to mySql and must be doing something wrong with my procedure or sql syntax. Please help. I'm trying to create a procedure as noted below:
PROCEDURE `mydbase`.`spGetContact`(IN inContactId INT)
BEGIN
SELECT contacts.FName
FROM contacts INNER JOIN contacttype ON contacts.TypeId = contacttype.Id
WHERE contacts.Id = inContactId
END
I right clicked on the Procedures node in the DBExplorer and selected New Procedure. It opened the editor window to enter my SQL and when I attempt to save this procedure I get the following error:
'You have an error in your SQL syntax (...) near 'SELECT contacts.FName ...' at line 4'
I have a table in this database named contacts and it includes a field FName with the first two letters capitalized, etc etc... Any ideas????
Thanks for any help,
Chris
PROCEDURE `mydbase`.`spGetContact`(IN inContactId INT)
BEGIN
SELECT contacts.FName
FROM contacts INNER JOIN contacttype ON contacts.TypeId = contacttype.Id
WHERE contacts.Id = inContactId
END
I right clicked on the Procedures node in the DBExplorer and selected New Procedure. It opened the editor window to enter my SQL and when I attempt to save this procedure I get the following error:
'You have an error in your SQL syntax (...) near 'SELECT contacts.FName ...' at line 4'
I have a table in this database named contacts and it includes a field FName with the first two letters capitalized, etc etc... Any ideas????
Thanks for any help,
Chris