List:General Discussion« Previous MessageNext Message »
From:Jim Seymour Date:September 25 2005 8:27pm
Subject:Stored procedures MS SQL Server to MySQL
View as plain text  
Taking on online class for SQL and am down to the last two classes and
cannot make the following work. This is a MS SQL Server query that I
have not been able to solve through the MySQL Documentation:

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

I have tried numerous variations of the following:

CREATE PROCEDURE CountPhoneNumbers () BEGIN DECLARE @count INT SELECT
@count = COUNT(*) FROM CUSTOMER WHERE HomePhone IS NOT NULL; END//

// was set to be the delimiter for the creation and have tried putting
various parts of the query into the parentheses. The error messages
always seem to occur around the @count variable. I am using MySQL
v.5.0.12 on Debian Etch.

TIA,

Jim Seymour
-- 
I started using something better than the "standard" back when IBM advertised
OS/2 Warp on TV. As Linux matured I made the transition from OS/2 v4 to Linux.
You don't have to accept less than you deserve.
"Use the Power of the Penguin" Registered Linux user #316735
Thread
Stored procedures MS SQL Server to MySQLJim Seymour25 Sep
  • Re: Stored procedures MS SQL Server to MySQLPeter Brawley25 Sep
    • Re: Stored procedures MS SQL Server to MySQLJim Seymour26 Sep