saving value of count(*)
Date: October 10, 2009 08:20PM
in a procedure I am creating, I need to save the value of Count(*) from my select statement so I can use the value to determine if a row was selected or not. Something like below.
Select count(*) as positiontaken from position where Level=AL and Position = AP;
Set rowcount = positiontaken;
If rowcount = 0 then
Update associates
Set aLevel = AL, aPosition = AP
Where Associate_ID = AN;
insert into position Set Level = AL, Position = AP;
END IF;
How do I do this?