On Sun, Sep 25, 2005 at 03:56:46PM -0500, Peter Brawley wrote:
> Jim,
> 
> If you really want to return the result in a variable, declare a user 
> var in the client, declare an OUT var in the SP, have the SP SELECT INTO 
> it, and pass the user var to the SP in the call:
> 
> SET @x=0;
> SET GLOBAL log_bin_trust_routine_creators = TRUE;
> DROP PROCEDURE IF EXISTS CountPhoneNumbers;
> DELIMITER |
> CREATE PROCEDURE CountPhoneNumbers ( OUT count INT )
>  BEGIN
>    SELECT COUNT(*) INTO count
>    FROM customer
>    WHERE Phone IS NOT NULL;
>  END;
> |
> DELIMITER ;
> CALL CountPhoneNumbers(@x);
> SELECT @x;
> 

Thanks Peter,

Since she was teaching us about using a variable I am trying your second
example.

Thanks again,

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

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to