Page 1 of 1

Need help creating stored procedure

Posted: Fri 11 Aug 2006 14:10
by chrisdouglass
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)

SELECT contacts.FName
FROM contacts INNER JOIN contacttype ON contacts.TypeId = contacttype.Id
WHERE contacts.Id = inContactId


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,

Now I get access denied error

Posted: Fri 11 Aug 2006 16:50
by chrisdouglass
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...


Posted: Mon 14 Aug 2006 07:35
by Serious
We think the problem might be in your server configuration.