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
Need help creating stored procedure
-
- Posts: 15
- Joined: Fri 11 Aug 2006 14:04
- Location: Atlanta, GA USA
-
- Posts: 15
- Joined: Fri 11 Aug 2006 14:04
- Location: Atlanta, GA USA
Now I get access denied error
Ok, someone on the mySql forums said I need to use a semicolon after each statement. so i added that and now i get an error msg stating that "Access denied for user 'root'@'%' to database 'mydbase'."
Any idea why I would get this even though I can browse/connect to the database within the DBEXplorer add-in...
Thanks,
Chris
Any idea why I would get this even though I can browse/connect to the database within the DBEXplorer add-in...
Thanks,
Chris