Need help creating stored procedure

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
chrisdouglass
Posts: 15
Joined: Fri 11 Aug 2006 14:04
Location: Atlanta, GA USA

Need help creating stored procedure

Post by chrisdouglass » 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

chrisdouglass
Posts: 15
Joined: Fri 11 Aug 2006 14:04
Location: Atlanta, GA USA

Now I get access denied error

Post by chrisdouglass » Fri 11 Aug 2006 16:50

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

Serious

Post by Serious » Mon 14 Aug 2006 07:35

We think the problem might be in your server configuration.

Post Reply