Reputation: 105
whem i do this select:
SELECT COUNT(prd_cod)
FROM product
WHERE prd_name = 'car';
it's return 2
and whem i do this procedure:
CREATE DEFINER=`root`@`localhost` PROCEDURE `selection`(IN text VARCHAR(100),OUT
res VARCHAR(100))
BEGIN
SELECT COUNT(prd_cod) INTO res
FROM product
WHERE prd_name = text;
END;
call selection('car',@res);
gives no error, but also returns nothing
someone knows what's going on ?
tanks...
Upvotes: 0
Views: 80
Reputation: 23228
You're missing just 1 final step: selecting @res :) The procedure call you make is simply placing the count into the @res
variable. In order to display it, do select @res
after the call
!
Upvotes: 1