MySQL Forums
Forum List  »  Newbie

Trying to execute a stored procedure and getting an error
Posted by: Ken Bond
Date: June 03, 2015 05:05PM

I'm trying to execute a simple stored procedure that will count and display the number of customers in my Customer table that have a phone number listing. I get the error "1064(42000). You have an error in your SQL syntax".

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

Options: ReplyQuote


Subject
Written By
Posted
Trying to execute a stored procedure and getting an error
June 03, 2015 05:05PM


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.