MySQL Forums
Forum List  »  Stored Procedures

Error in MySQL when trying to execute a stored procedure
Posted by: Ken Bond
Date: June 08, 2015 04:43PM

Trying to execute a stored procedure. When it runs, it should simply count the number of customers that have a listed phone number in the column HomePhone. Instead I'm getting the message "Error 1064(42000). You have an error in your SQL syntax."


mysql> CREATE PROCEDURE CountPhoneNumbers
    -> AS
    -> DECLARE @count INTEGER
    -> SELECT @count=COUNT(*)
    -> FROM Customer
    -> WHERE HomePhone IS NOT NULL
    -> Print @count
    -> EXECUTE CountPhoneNumbers
    -> ;


Options: ReplyQuote


Subject
Views
Written By
Posted
Error in MySQL when trying to execute a stored procedure
2779
June 08, 2015 04:43PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.